Unreal: Add support for Atheme

This commit is contained in:
2021-07-03 11:05:40 +02:00
committed by Val Lorentz
parent 4271d5d986
commit 63f4130ab5
4 changed files with 17 additions and 4 deletions

View File

@ -252,7 +252,10 @@ class BaseServicesController(_BaseController):
c.connect(self.server_controller.hostname, self.server_controller.port)
c.sendLine("NICK chkNS")
c.sendLine("USER chk chk chk chk")
c.getMessages(synchronize=False)
for msg in c.getMessages(synchronize=False):
if msg.command == "PING":
# Hi Unreal
c.sendLine("PONG :" + msg.params[0])
c.getMessages()
timeout = time.time() + 5

View File

@ -58,7 +58,7 @@ class AthemeServices(BaseServicesController, DirectoryBasedController):
def run(self, protocol: str, server_hostname: str, server_port: int) -> None:
self.create_config()
assert protocol in ("inspircd", "charybdis")
assert protocol in ("inspircd", "charybdis", "unreal4")
with self.open_file("services.conf") as fd:
fd.write(

View File

@ -7,6 +7,7 @@ from irctest.basecontrollers import (
DirectoryBasedController,
NotImplementedByController,
)
from irctest.controllers.atheme_services import AthemeServices
from irctest.irc_utils.junkdrawer import find_hostname_and_port
TEMPLATE_CONFIG = """
@ -63,7 +64,7 @@ listen {{
link services.example.org {{
incoming {{
mask localhost;
mask *;
}}
password "password";
class servers;
@ -73,6 +74,7 @@ ulines {{
}}
set {{
sasl-server services.example.org;
kline-address "example@example.org";
network-name "ExampleNET";
default-server "irc.example.org";
@ -175,7 +177,13 @@ class UnrealircdController(BaseServerController, DirectoryBasedController):
)
if run_services:
raise NotImplementedByController("Registration services")
self.wait_for_port()
self.services_controller = AthemeServices(self.test_config, self)
self.services_controller.run(
protocol="unreal4",
server_hostname=services_hostname,
server_port=services_port,
)
def get_irctest_controller_class() -> Type[UnrealircdController]: