Some fixes for Bahamut

This commit is contained in:
Valentin Lorentz 2021-08-09 01:47:18 +02:00
parent 84d667e95e
commit dfaec16c47
4 changed files with 21 additions and 9 deletions

View File

@ -186,6 +186,7 @@ class BaseServerController(_BaseController):
services_controller_class: Type[BaseServicesController]
extban_mute_char: Optional[str] = None
"""Character used for the 'mute' extban"""
nickserv = "NickServ"
def run(
self,
@ -279,7 +280,7 @@ class BaseServicesController(_BaseController):
timeout = time.time() + 5
while True:
c.sendLine("PRIVMSG NickServ :HELP")
c.sendLine(f"PRIVMSG {self.server_controller.nickserv} :HELP")
msgs = self.getNickServResponse(c)
for msg in msgs:
if msg.command == "401":
@ -332,7 +333,11 @@ class BaseServicesController(_BaseController):
while case.getRegistrationMessage(client).command != "001":
pass
case.getMessages(client)
case.sendLine(client, f"PRIVMSG NickServ :REGISTER {password} foo@example.org")
case.sendLine(
client,
f"PRIVMSG {self.server_controller.nickserv} "
f":REGISTER {password} foo@example.org",
)
msgs = self.getNickServResponse(case.clients[client])
if self.server_controller.software_name == "inspircd":
assert "900" in {msg.command for msg in msgs}, msgs

View File

@ -23,7 +23,7 @@ options {{
services_name services.example.org;
// if you need to link more than 1 server, uncomment the following line
# servtype hub;
servtype hub;
}};
/* where to listen for connections */
@ -64,7 +64,7 @@ class {{
/* our services */
connect {{
name services.example.org;
host *@*;
host *@127.0.0.1; # unfortunately, masks aren't allowed here
apasswd password;
cpasswd password;
class services;
@ -72,10 +72,11 @@ connect {{
"""
class UnrealircdController(BaseServerController, DirectoryBasedController):
class BahamutController(BaseServerController, DirectoryBasedController):
software_name = "Bahamut"
supported_sasl_mechanisms = {"PLAIN"}
supported_sasl_mechanisms: Set[str] = set()
supports_sts = False
nickserv = "NickServ@services.example.org"
def create_config(self) -> None:
super().create_config()
@ -150,5 +151,5 @@ class UnrealircdController(BaseServerController, DirectoryBasedController):
)
def get_irctest_controller_class() -> Type[UnrealircdController]:
return UnrealircdController
def get_irctest_controller_class() -> Type[BahamutController]:
return BahamutController

View File

@ -38,6 +38,7 @@ def validate_chathistory_batch(msgs):
return result
@cases.mark_specifications("IRCv3")
@cases.mark_services
class ChathistoryTestCase(cases.BaseServerTestCase):
@staticmethod

View File

@ -118,7 +118,12 @@ class ConnectionRegistrationTestCase(cases.BaseServerTestCase):
self.sendLine(1, "NICK foo")
self.sendLine(2, "NICK foo")
self.sendLine(1, "USER username * * :Realname")
self.sendLine(2, "USER username * * :Realname")
try:
self.sendLine(2, "USER username * * :Realname")
except (ConnectionClosed, ConnectionResetError):
# Bahamut closes the connection here
pass
try:
m1 = self.getRegistrationMessage(1)