Unreal: Add support for Atheme

This commit is contained in:
Valentin Lorentz 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

@ -64,6 +64,7 @@ SOPEL_SELECTORS := \
# test_regressions::testTagCap fails: https://bugs.unrealircd.org/view.php?id=5948
# test_messages::testLineTooLong fails: https://bugs.unrealircd.org/view.php?id=5947
# testCapRemovalByClient and testNakWhole fail pending https://github.com/unrealircd/unrealircd/pull/148
# test_account_tag::testInvite fails: https://bugs.unrealircd.org/view.php?id=5951
# Tests marked with arbitrary_client_tags can't pass because Unreal whitelists which tags it relays
# Tests marked with react_tag can't pass because Unreal blocks +draft/react https://github.com/unrealircd/unrealircd/pull/149
UNREALIRCD_SELECTORS := \
@ -74,6 +75,7 @@ UNREALIRCD_SELECTORS := \
and not (test_regressions and testTagCap) \
and not (test_messages and testLineTooLong) \
and not (test_cap and (testCapRemovalByClient or testNakWhole)) \
and not (test_account_tag and testInvite) \
and not arbitrary_client_tags \
and not react_tag \
$(EXTRA_SELECTORS)

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]: