Semi-automated conformance checking for IRC implementations (RFC1459/RFC2812, the "modern spec" by ircdocs, and IRCv3)
Go to file
Val Lorentz 805635c839
Add Sable (#229)
* [WIP] Add support for Sable

* tweak sable controller

* echo_message: Add missing synchronization for Sable

* update sable

* whois: Simplify test

* WHO: Remove test for oper flag from testWhoChan

So it won't fail on Sable, which hides oper status

* WHO: Skip/xfail tests for Sable as needed

* Skip NakWhole when multi-prefix is not supported

* [WIP] Run Sable on CI

* working-directory is not setable on actions

* this isn't ergo

* this really isn't ergo

* minimize rust install and cache cargo deps

* Need to specify packages to install...

* Phony target

* Give up on 'cargo install', it seems to ignore the cache

* try again to cache the target dir

* This isn't Solanum

* Comment out BaseServicesController

* Parallelize Sable tests

* target is relative...

* sigh

* Fix prefix

* Re-add the other software

* chathistory: Test TOPIC is not sent unless event-playable is enabled

* sable: Dynamically generate certificates

This allows using custom server/services names

* sable: Enable services

* sable: Add support for account registration

Sable doesn't support REGISTER via NickServ

* sable: Lower log verbosity

* Fix lint

* Re-add Sable to CI

* Fix/skip tests on Sable

* Kill sable_services' subprocesses

* Bump Sable to include the labeled-response fix

* Bump Sable to the channel-rename downgrade fix
2023-09-21 09:18:23 +02:00
.github Add Sable (#229) 2023-09-21 09:18:23 +02:00
data Configure Unreal with --with-system-argon2 2023-07-23 11:40:01 +02:00
irctest Add Sable (#229) 2023-09-21 09:18:23 +02:00
patches Update CI to run on Ubuntu 22.04. (#210) 2023-06-25 23:14:08 +02:00
.gitignore add a test for INVITE 2018-12-23 16:41:54 -05:00
.pre-commit-config.yaml Bump linter versions (#188) 2023-03-04 10:51:40 +01:00
CONTRIBUTING.md Split channel_operations.py by command. 2021-08-11 20:46:10 +02:00
LICENSE Initial commit 2015-12-18 17:26:55 +01:00
Makefile Add Sable (#229) 2023-09-21 09:18:23 +02:00
README.md inspircd: Use upstream mainloop hack when available (#200) 2023-05-20 20:06:59 +02:00
conftest.py Fix deprecation warning 2023-09-02 16:24:57 +02:00
make_workflows.py Add Sable (#229) 2023-09-21 09:18:23 +02:00
mypy.ini Bump linter versions (#188) 2023-03-04 10:51:40 +01:00
pyproject.toml Make black ignore irctest/scram/ 2021-11-12 22:34:48 +01:00
pytest.ini Add tests for draft/extended-monitor (#180) 2023-03-04 10:11:51 +01:00
report.py Bump linter versions (#188) 2023-03-04 10:51:40 +01:00
requirements.txt basic server test for SCRAM-SHA-256 (#84) 2021-08-08 20:47:42 +02:00
setup.cfg exhaustive testing of Modern's WHOIS spec (#104) 2021-08-29 16:38:38 +02:00
workflows.yml Add Sable (#229) 2023-09-21 09:18:23 +02:00

irctest

This project aims at testing interoperability of software using the IRC protocol, by running them against common test suites.

The big picture

This project contains:

  • IRC protocol test cases
  • small wrappers around existing software to run tests on them

Wrappers run software in temporary directories, so running irctest should have no side effect.

Prerequisites

Install irctest and dependencies:

sudo apt install faketime  # Optional, but greatly speeds up irctest/server_tests/list.py
cd ~
git clone https://github.com/ProgVal/irctest.git
cd irctest
pip3 install --user -r requirements.txt

Add ~/.local/bin/ (and/or ~/go/bin/ for Ergo) to your PATH if it is not.

export PATH=$HOME/.local/bin/:$HOME/go/bin/:$PATH

Using pytest

irctest is invoked using the pytest test runner / CLI.

You can usually invoke it with python3 -m pytest command; which can often be called by the pytest or pytest-3 commands (if not, alias them if you are planning to use them often).

The rest of this README assumes pytest works.

Test selection

A major feature of pytest that irctest heavily relies on is test selection. Using the -k option, you can select and deselect tests based on their names and/or markers (listed in pytest.ini). For example, you can run LUSERS-related tests with -k lusers. Or only tests based on RFC1459 with -k rfc1459.

By default, all tests run; even niche ones. So you probably always want to use these options: -k 'not Ergo and not deprecated and not strict. This excludes:

  • Ergo-specific tests (included as Ergo uses irctest as its official integration test suite)
  • tests for deprecated specifications, such as the IRCv3 METADATA specification
  • tests that check for a strict interpretation of a specification, when the specification is ambiguous.

Running tests

Servers

Ergo:

cd /tmp/
git clone https://github.com/ergochat/ergo.git
cd ergo/
make install
cd ~/irctest
pytest --controller irctest.controllers.ergo -k 'not deprecated'

Solanum:

cd /tmp/
git clone https://github.com/solanum-ircd/solanum.git
cd solanum
./autogen.sh
./configure --prefix=$HOME/.local/
make -j 4
make install
pytest --controller irctest.controllers.solanum -k 'not Ergo and not deprecated and not strict'

Charybdis:

cd /tmp/
git clone https://github.com/atheme/charybdis.git
cd charybdis
./autogen.sh
./configure --prefix=$HOME/.local/
make -j 4
make install
cd ~/irctest
pytest --controller irctest.controllers.charybdis -k 'not Ergo and not deprecated and not strict'

InspIRCd:

cd /tmp/
git clone https://github.com/inspircd/inspircd.git
cd inspircd

# Optional, makes tests run considerably faster. Pick one depending on the InspIRCd version:
# on Insp3 <= 3.16.0 and Insp4 <= 4.0.0a21:
patch src/inspircd.cpp < ~/irctest/patches/inspircd_mainloop.patch
# on Insp3 >= 3.17.0 and Insp4 >= 4.0.0a22:
export CXXFLAGS=-DINSPIRCD_UNLIMITED_MAINLOOP

./configure --prefix=$HOME/.local/ --development
make -j 4
make install
cd ~/irctest
pytest --controller irctest.controllers.inspircd -k 'not Ergo and not deprecated and not strict'

Mammon:

pip3 install --user git+https://github.com/mammon-ircd/mammon.git
cd ~/irctest
pytest --controller irctest.controllers.mammon -k 'not Ergo and not deprecated and not strict'

UnrealIRCd:

cd /tmp/
git clone https://github.com/unrealircd/unrealircd.git
cd unrealircd
./Config  # This will ask a few questions, answer them.
make -j 4
make install
cd ~/irctest
pytest --controller irctest.controllers.unreal -k 'not Ergo and not deprecated and not strict'

Servers with services

Besides Ergo (that has built-in services), most server controllers can optionally run service packages.

Atheme:

You can install it with

sudo apt install atheme-services

and add this to the pytest call:

--services-controller irctest.controllers.atheme_services

Anope:

Build with:

cd /tmp/
git clone https://github.com/anope/anope.git
cd anope
./Config  # This will ask a few questions, answer them.
make -C build -j 4
make -C build install

and add this to the pytest call:

--services-controller irctest.controllers.anope_services

Clients

Limnoria:

pip3 install --user limnoria pyxmpp2-scram
cd ~/irctest
pytest --controller  irctest.controllers.limnoria

Sopel:

pip3 install --user sopel
mkdir ~/.sopel/
cd ~/irctest
pytest --controller irctest.controllers.sopel

What irctest is not

A formal proof that a given software follows any of the IRC specification, or anything near that.

At best, irctest can help you find issues in your software, but it may still have false positives (because it does not implement itself a full-featured client/server, so it supports only “usual” behavior). Bug reports for false positives are welcome.