mirror of
https://github.com/progval/irctest.git
synced 2025-04-04 22:39:50 +00:00
Some fixes for Bahamut
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
|
@ -38,6 +38,7 @@ def validate_chathistory_batch(msgs):
|
||||
return result
|
||||
|
||||
|
||||
@cases.mark_specifications("IRCv3")
|
||||
@cases.mark_services
|
||||
class ChathistoryTestCase(cases.BaseServerTestCase):
|
||||
@staticmethod
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user