From ec386a1fc9138d6a22df03868ff164ffc58a4e32 Mon Sep 17 00:00:00 2001 From: Val Lorentz Date: Sun, 8 Aug 2021 20:46:33 +0200 Subject: [PATCH] Add Plexus4 (#90) --- .github/workflows/test-devel.yml | 79 +++++++++++++++++++++++++++ .github/workflows/test-stable.yml | 79 +++++++++++++++++++++++++++ Makefile | 6 ++ irctest/controllers/anope_services.py | 2 +- irctest/controllers/base_hybrid.py | 2 +- irctest/controllers/charybdis.py | 1 + irctest/controllers/hybrid.py | 1 + irctest/controllers/plexus4.py | 77 ++++++++++++++++++++++++++ workflows.yml | 35 ++++++++++++ 9 files changed, 280 insertions(+), 2 deletions(-) create mode 100644 irctest/controllers/plexus4.py diff --git a/.github/workflows/test-devel.yml b/.github/workflows/test-devel.yml index 5ff4662..559f90f 100644 --- a/.github/workflows/test-devel.yml +++ b/.github/workflows/test-devel.yml @@ -97,6 +97,46 @@ jobs: name: installed-inspircd path: ~/artefacts-*.tar.gz retention-days: 1 + build-plexus4: + runs-on: ubuntu-latest + steps: + - name: Create directories + run: cd ~/; mkdir -p .local/ go/ + - name: Cache dependencies + uses: actions/cache@v2 + with: + key: ${{ runner.os }}-plexus4-devel + path: |- + ~/.cache + $GITHUB_WORKSPACE/placeholder + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: clone + run: 'curl https://gitlab.com/rizon/plexus4/-/archive/master/plexus4-master.tar.gz + | tar -zx + + mv plexus4* plexus4' + - name: build + run: 'cd $GITHUB_WORKSPACE/plexus4 + + ./autogen.sh + + ./configure --prefix=$HOME/.local/ + + make -j 4 + + make install' + - name: Make artefact tarball + run: cd ~; tar -czf artefacts-plexus4.tar.gz .local/ go/ + - name: Upload build artefacts + uses: actions/upload-artifact@v2 + with: + name: installed-plexus4 + path: ~/artefacts-*.tar.gz + retention-days: 1 build-solanum: runs-on: ubuntu-latest steps: @@ -186,6 +226,7 @@ jobs: - test-inspircd - test-inspircd-anope - test-limnoria + - test-plexus4 - test-solanum - test-sopel - test-unrealircd @@ -368,6 +409,44 @@ jobs: with: name: pytest results limnoria (devel) path: pytest.xml + test-plexus4: + needs: + - build-plexus4 + - build-anope + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Download build artefacts + uses: actions/download-artifact@v2 + with: + name: installed-plexus4 + path: '~' + - name: Download build artefacts + uses: actions/download-artifact@v2 + with: + name: installed-anope + path: '~' + - name: Unpack artefacts + run: cd ~; find -name 'artefacts-*.tar.gz' -exec tar -xzf '{}' \; + - name: Install Atheme + run: sudo apt-get install atheme-services + - name: Install irctest dependencies + run: |- + python -m pip install --upgrade pip + pip install pytest -r requirements.txt + - name: Test with pytest + run: PYTEST_ARGS='--junit-xml pytest.xml' PATH=$HOME/.local/bin:$PATH make + plexus4 + - if: always() + name: Publish results + uses: actions/upload-artifact@v2 + with: + name: pytest results plexus4 (devel) + path: pytest.xml test-solanum: needs: - build-solanum diff --git a/.github/workflows/test-stable.yml b/.github/workflows/test-stable.yml index d7a5e57..a5b8000 100644 --- a/.github/workflows/test-stable.yml +++ b/.github/workflows/test-stable.yml @@ -135,6 +135,46 @@ jobs: name: installed-inspircd path: ~/artefacts-*.tar.gz retention-days: 1 + build-plexus4: + runs-on: ubuntu-latest + steps: + - name: Create directories + run: cd ~/; mkdir -p .local/ go/ + - name: Cache dependencies + uses: actions/cache@v2 + with: + key: ${{ runner.os }}-plexus4-stable + path: |- + ~/.cache + $GITHUB_WORKSPACE/placeholder + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: clone + run: 'curl https://gitlab.com/rizon/plexus4/-/archive/20200510_0-610/plexus4-20200510_0-610.tar.gz + | tar -zx + + mv plexus4* plexus4' + - name: build + run: 'cd $GITHUB_WORKSPACE/plexus4 + + ./autogen.sh + + ./configure --prefix=$HOME/.local/ + + make -j 4 + + make install' + - name: Make artefact tarball + run: cd ~; tar -czf artefacts-plexus4.tar.gz .local/ go/ + - name: Upload build artefacts + uses: actions/upload-artifact@v2 + with: + name: installed-plexus4 + path: ~/artefacts-*.tar.gz + retention-days: 1 build-solanum: runs-on: ubuntu-latest steps: @@ -226,6 +266,7 @@ jobs: - test-inspircd-anope - test-inspircd-atheme - test-limnoria + - test-plexus4 - test-solanum - test-sopel - test-unrealircd @@ -472,6 +513,44 @@ jobs: with: name: pytest results limnoria (stable) path: pytest.xml + test-plexus4: + needs: + - build-plexus4 + - build-anope + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Download build artefacts + uses: actions/download-artifact@v2 + with: + name: installed-plexus4 + path: '~' + - name: Download build artefacts + uses: actions/download-artifact@v2 + with: + name: installed-anope + path: '~' + - name: Unpack artefacts + run: cd ~; find -name 'artefacts-*.tar.gz' -exec tar -xzf '{}' \; + - name: Install Atheme + run: sudo apt-get install atheme-services + - name: Install irctest dependencies + run: |- + python -m pip install --upgrade pip + pip install pytest -r requirements.txt + - name: Test with pytest + run: PYTEST_ARGS='--junit-xml pytest.xml' PATH=$HOME/.local/bin:$PATH make + plexus4 + - if: always() + name: Publish results + uses: actions/upload-artifact@v2 + with: + name: pytest results plexus4 (stable) + path: pytest.xml test-solanum: needs: - build-solanum diff --git a/Makefile b/Makefile index 15e506d..3ec09c4 100644 --- a/Makefile +++ b/Makefile @@ -147,6 +147,12 @@ mammon: --controller=irctest.controllers.mammon \ -k '$(MAMMON_SELECTORS)' +plexus4: + $(PYTEST) $(PYTEST_ARGS) \ + --controller irctest.controllers.plexus4 \ + -m 'not services' \ + -k "$(HYBRID_SELECTORS)" + solanum: $(PYTEST) $(PYTEST_ARGS) \ --controller=irctest.controllers.solanum \ diff --git a/irctest/controllers/anope_services.py b/irctest/controllers/anope_services.py index 9aaaf71..e41203c 100644 --- a/irctest/controllers/anope_services.py +++ b/irctest/controllers/anope_services.py @@ -76,7 +76,7 @@ class AnopeController(BaseServicesController, DirectoryBasedController): def run(self, protocol: str, server_hostname: str, server_port: int) -> None: self.create_config() - assert protocol in ("inspircd3", "charybdis", "hybrid", "unreal4") + assert protocol in ("inspircd3", "charybdis", "hybrid", "plexus", "unreal4") with self.open_file("conf/services.conf") as fd: fd.write( diff --git a/irctest/controllers/base_hybrid.py b/irctest/controllers/base_hybrid.py index 11a5bc9..f91229a 100644 --- a/irctest/controllers/base_hybrid.py +++ b/irctest/controllers/base_hybrid.py @@ -93,5 +93,5 @@ class BaseHybridController(BaseServerController, DirectoryBasedController): self.services_controller.run( protocol=self.services_protocol, server_hostname=hostname, - server_port=port, + server_port=services_port, ) diff --git a/irctest/controllers/charybdis.py b/irctest/controllers/charybdis.py index 2729441..2569699 100644 --- a/irctest/controllers/charybdis.py +++ b/irctest/controllers/charybdis.py @@ -25,6 +25,7 @@ listen {{ host = "{hostname}"; port = {port}; + port = {services_port}; }}; auth {{ diff --git a/irctest/controllers/hybrid.py b/irctest/controllers/hybrid.py index bfc9dcc..38cd212 100644 --- a/irctest/controllers/hybrid.py +++ b/irctest/controllers/hybrid.py @@ -30,6 +30,7 @@ listen {{ host = "{hostname}"; port = {port}; + port = {services_port}; }}; class {{ diff --git a/irctest/controllers/plexus4.py b/irctest/controllers/plexus4.py new file mode 100644 index 0000000..c38d107 --- /dev/null +++ b/irctest/controllers/plexus4.py @@ -0,0 +1,77 @@ +from typing import Set, Type + +from .base_hybrid import BaseHybridController + +TEMPLATE_CONFIG = """ +serverinfo {{ + name = "My.Little.Server"; + sid = "42X"; + description = "test server"; + + # Hybrid defaults to 9 + max_nick_length = 20; +{ssl_config} +}}; + +general {{ + throttle_count = 100; # We need to connect lots of clients quickly + sasl_service = "SaslServ"; + + # Allow connections quickly + throttle_num = 100; + + # Allow PART/QUIT reasons quickly + anti_spam_exit_message_time = 0; + + # Allow all commands quickly + pace_wait_simple = 0; + pace_wait = 0; +}}; + +listen {{ + defer_accept = yes; + + host = "{hostname}"; + port = {port}; + + flags = server; + port = {services_port}; +}}; + +class {{ + name = "server"; + ping_time = 5 minutes; + connectfreq = 5 minutes; +}}; +connect {{ + name = "services.example.org"; + host = "localhost"; # Used to validate incoming connection + port = 0; # We don't need servers to connect to services + send_password = "password"; + accept_password = "password"; + class = "server"; +}}; +service {{ + name = "services.example.org"; +}}; + +auth {{ + user = "*"; + flags = exceed_limit; + {password_field} +}}; +""" + + +class Plexus4Controller(BaseHybridController): + software_name = "Hybrid" + binary_name = "ircd" + services_protocol = "plexus" + + supported_sasl_mechanisms: Set[str] = set() + + template_config = TEMPLATE_CONFIG + + +def get_irctest_controller_class() -> Type[Plexus4Controller]: + return Plexus4Controller diff --git a/workflows.yml b/workflows.yml index 9a51d7d..b30c1d2 100644 --- a/workflows.yml +++ b/workflows.yml @@ -39,6 +39,38 @@ software: make -j 4 make install + plexus4: + name: Plexus4 + path: plexus4 + separate_build_job: true + install_steps: + stable: + - name: clone + run: |- + curl https://gitlab.com/rizon/plexus4/-/archive/20200510_0-610/plexus4-20200510_0-610.tar.gz | tar -zx + mv plexus4* plexus4 + - name: build + run: |- + cd $GITHUB_WORKSPACE/plexus4 + ./autogen.sh + ./configure --prefix=$HOME/.local/ + make -j 4 + make install + release: null + devel: + - name: clone + run: |- + curl https://gitlab.com/rizon/plexus4/-/archive/master/plexus4-master.tar.gz | tar -zx + mv plexus4* plexus4 + - name: build + run: |- + cd $GITHUB_WORKSPACE/plexus4 + ./autogen.sh + ./configure --prefix=$HOME/.local/ + make -j 4 + make install + devel_release: null + solanum: name: Solanum repository: solanum-ircd/solanum @@ -178,6 +210,9 @@ tests: inspircd-anope: software: [inspircd, anope] + plexus4: + software: [plexus4, anope] + unrealircd: software: [unrealircd]