Commit Graph

418 Commits

Author SHA1 Message Date
Shivaram Lingamneni cac4428cbd
regression test for ergochat/ergo#1898 (#130) 2022-01-10 23:22:46 +01:00
Shivaram Lingamneni 8240cd95cf
regression test for ergochat/ergo#1876 (#125) 2022-01-10 21:35:17 +01:00
Val Lorentz 6c393c4e00
Add tests for WHO (#122)
* Add tests for WHO

* Make the mask in RPL_ENDOFWHO case-insensitive + skip test when there is a space in the mask

* Remove 'o' flag of WHO, it's not consistently implemented

* Skip matches on username and realname (for now?)

* Add workarounds from irc2 and ircu2.

* Add test for 'WHO *'.

* Exclude mask tests in test_who.py for Bahamut
2021-12-23 17:15:10 +01:00
Val Lorentz 05e78802ca
Add support for Unreal 6 (#123)
List of issues we had:
 
* echo wallops missing `!user@host` [wallops: Send a full NUH as prefix in echoed WALLOPS unrealircd/unrealircd#186](https://github.com/unrealircd/unrealircd/pull/186)
* RPL_MONONLINE is (re)sent on nick case change - https://bugs.unrealircd.org/view.php?id=6013
* MONITOR accepts masks - https://bugs.unrealircd.org/view.php?id=6014
* KICK doesn't support multiple channels anymore, despite unchanged TARGMAX - https://bugs.unrealircd.org/view.php?id=6015
2021-12-19 00:45:51 +01:00
Valentin Lorentz 16533de157 Fix invalid nick 2021-12-10 17:14:26 +01:00
Shivaram Lingamneni d29c0035e6 test that ERR_UNKNOWNCOMMAND is labeled
If an invalid command is sent with a valid label, it should receive
ERR_UNKNOWNCOMMAND with a label (comparable to other error responses).
2021-12-03 10:15:32 +01:00
Valentin Lorentz b895539bdd Update links to WHOIS spec. 2021-11-12 22:34:58 +01:00
Valentin Lorentz 39587c3c49 Add testBanList 2021-11-06 09:49:12 +01:00
Val Lorentz 5e4ae7c999
Add tests for WALLOPS (#109)
* Add tests for WALLOPS

* Add perms on plexus/hybrid, skip on ergo, laxer matching for ircu2

* Fix again for irc2 and ircu2

* Servers MAY send WALLOPS only to operators.
2021-09-19 15:33:31 +02:00
Shivaram Lingamneni 33f0702c26 fix some tests not being discovered due to their class names
Follow up from #112
2021-09-10 08:46:25 +02:00
Valentin Lorentz 3630a25c11 Add ngircd controller 2021-09-05 17:45:09 +02:00
Val Lorentz 50b253fda8
Fix some mode tests not being collected because of their class name (#112)
* Fix some mode tests not being collected because of their class name

* testBan: Remove unnecessary dependency on echo-message (fixes support for servers without CAP LS)
2021-09-04 21:07:17 +02:00
Val Lorentz 5e33a82af6
Split irctest/server_tests/mode.py into a subpackage
It was getting too big
2021-09-04 20:26:14 +02:00
Valentin Lorentz 8bc9c5b057 Exclude ircu2 and fill in the spec 2021-09-04 20:18:53 +02:00
Valentin Lorentz e03bb4734d Add test testEmptyRealname. 2021-09-04 20:18:53 +02:00
Valentin Lorentz cc3d70c7d3 testQuitErrors: Make it slightly less flaky with solanum? 2021-09-04 20:02:49 +02:00
Valentin Lorentz ff0d795485 Add TARGMAX test 2021-09-04 20:02:20 +02:00
Val Lorentz 23c7c1642b
exhaustive testing of Modern's WHOIS spec (#104)
* Add testWhoisNumerics, to check Modern exhaustively covers known numerics

* ircu2: Workaround for server name in testWhoisNumerics.

* testWhoisUser: Work around ircu2 restrictions on nick and username

* testWhoisNumerics: Add variant with authenticated user

* testWhoisNumerics: Add support for RPL_AWAY and RPL_WHOISSPECIAL

* testWhoisNumerics: Add variant where the WHOIS sender opers up first

* testWhoisUser: Also test with targets

* inspircd: Fix oper configuration

* Fix RPL_WHOISACTUALLY matching for Unreal.
2021-08-29 16:38:38 +02:00
Valentin Lorentz 03a401f911 Add tests for PING and PONG 2021-08-28 18:54:35 +02:00
Valentin Lorentz 15d21f4ee4 Exhaustively test AWAY. 2021-08-28 18:54:13 +02:00
Valentin Lorentz 6106fc3b98 invite & kick: update links to Modern 2021-08-26 21:15:57 +02:00
Val Lorentz 44ce324c7c
kick: Exhaustive implementation of the Modern spec + honor TARGMAX in testDoubleKickMessages (#100) 2021-08-26 21:05:23 +02:00
Val Lorentz a9e6605640
Add exhaustive testing of INVITE. (#87)
* Add exhaustive testing of INVITE.

Only tested with Modern, because no one implements the RFC syntax.

* Mark testInviteUnopped* as strict tests.

* Exclude testInviteInviteOnlyModern on Plexus4

* Add test for ERR_USERONCHANNEL.
2021-08-26 21:04:45 +02:00
Valentin Lorentz de66606b4f Fix excessive timeout 2021-08-13 08:58:38 +02:00
Valentin Lorentz 57a08a0a57 Deselect testKeyValidation[empty] for ircu2 2021-08-11 22:46:54 +02:00
Valentin Lorentz 3cca1ce29e testKeyValidation: Add checks for long and empty keys 2021-08-11 22:46:54 +02:00
Valentin Lorentz 3fb8cbc3ff testKeyValidation: Check format of ERR_INVALIDMODEPARAM. 2021-08-11 22:46:54 +02:00
Valentin Lorentz 6641b3245f Split user_commands.py by command
For consistency with channel commands.
2021-08-11 20:46:10 +02:00
Valentin Lorentz 7a8acb44cf Split channel_operations.py by command.
It was messy.
2021-08-11 20:46:10 +02:00
Valentin Lorentz 9b02222c4c Remove 'test_' prefix for all file names.
It's redundant.
2021-08-11 19:34:33 +02:00
Valentin Lorentz c9911da9b8 testDoubleKickMessages: Also test with a single chan 2021-08-11 18:33:05 +02:00
Val Lorentz 56906302b7
Add ircu2/snircd/irc2 controllers + fix tests to support them (#89) 2021-08-10 18:42:37 +02:00
Valentin Lorentz 8744a49073 Make tests pass + update testKeyValidation to match the Modern PR 2021-08-09 23:43:30 +02:00
Valentin Lorentz d130ae89f2 testNickReleaseUnregistered: I don't think RFC1459 requires QUIT to be accepted this early. 2021-08-09 23:43:30 +02:00
Valentin Lorentz dfaec16c47 Some fixes for Bahamut 2021-08-09 23:43:30 +02:00
Valentin Lorentz 42582f430a bahamut wip 2021-08-09 23:41:46 +02:00
Valentin Lorentz 299c915505 'batch' is required for 'labeled-response' to be active according to the spec 2021-08-09 23:41:37 +02:00
Shivaram Lingamneni 9de76b6063
basic server test for SCRAM-SHA-256 (#84) 2021-08-08 20:47:42 +02:00
Valentin Lorentz 93a989b746 Test NAMES on invalid/nonexisting channel returns RPL_ENDOFNAMES. 2021-08-08 10:33:28 +02:00
Shivaram Lingamneni f63de0548a reenable some account-registration tests for Ergo
These were incorrectly being skipped. If `CAP LS 302` precedes
`requestCapabilities`, `requestCapabilities` sees the LS response
instead of the ACK it expects. Then it assumes that the request was
NAK'ed and skips the test.
2021-07-30 19:10:48 +02:00
Valentin Lorentz 59c7252da1 testUnsetTopicResponses: Assert reply to clearing topic is a TOPIC command. 2021-07-11 17:23:00 +02:00
Valentin Lorentz 4fb7ebcd2c testUnsetTopicResponses: Also check the TOPIC command is forwarded when unsetting the topic 2021-07-11 17:13:31 +02:00
Val Lorentz 77272f83fb
Fix Hybrid support + enable it on CI (#82)
* Fix Hybrid support + enable it on CI

* Can't make Hybrid linking work on Github CI

because the reverse DNS is 'cpu-pool.com' for some reason, and I don't
want to hardcode it, so I give up.
2021-07-10 16:33:32 +02:00
Shivaram Lingamneni a29b7c5631 update draft/register -> draft/account-registration 2021-07-07 09:04:22 -04:00
Valentin Lorentz 08a74096d0 test_cap: Fix random failure. 2021-07-04 22:44:18 +02:00
Valentin Lorentz 450a413036 Fix random failure (again) 2021-07-04 20:11:35 +02:00
Valentin Lorentz 15f9875ae5 chathistory: Parametrize tests by subcommand
This means that:

* if one subcommand implementation is buggy, other subcommands are still tested and
  have a chance to pass
* we can exclude known-buggy subcommands from the Makefile
* when a test failure happens, we get much shorter logs (only logs for
  that subcommand's I/O)
2021-07-04 17:31:18 +02:00
Valentin Lorentz 92a73ad4a5 Use pytest parametrization instead of ad-hoc method generation 2021-07-04 17:06:37 +02:00
Val Lorentz 06f053bf61
Remove some Ergo marks (#70)
* Remove some 'Ergo' marks

These are not ergo-specific specs

* Make chathistory test less Ergo-specific

Although they can only run on Ergo for now, as Unreal has a couple
of minor bugs that prevents them from passing.

* Fix synchronization issue

(NickServ sets MODE +r, which is unexpected caught by the next
self.assertMessageMatch call)
2021-07-04 15:04:48 +02:00
Valentin Lorentz 61974e6d0c Enable mute extban tests on Ergo 2021-07-04 09:55:46 +02:00
Shivaram Lingamneni 4932d410e2 fix chathistory spec violation in INVALID_TARGET
https://github.com/ergochat/ergo/issues/1731
2021-07-04 09:51:04 +02:00
Valentin Lorentz 4271d5d986 test_bot_mode: Fix racey failures
cause by the sent message being processed after the target
user's recv
2021-07-03 09:59:31 +02:00
Val Lorentz d74b0e74c6
Merge pull request #62 from ProgVal/unreal
Add Unreal controller
2021-07-03 09:54:22 +02:00
Valentin Lorentz 83152bdc24 unreal: deselect tests depending on +draft/react
Unreal won't support them 1st-party:
https://github.com/unrealircd/unrealircd/pull/149
2021-07-03 09:40:49 +02:00
Valentin Lorentz c4d19d44e8 test_labeled_responses: Actually check 'label' tags aren't relayed
The existing assertion's comment said it checked the label wasn't
relayed, but the code actually let any tag through.
2021-07-03 09:31:51 +02:00
Valentin Lorentz 3fafc76baa fix comment 2021-07-02 22:25:45 +02:00
Valentin Lorentz 42225a68b7 test_buffering: improve log readability 2021-07-02 22:25:07 +02:00
Valentin Lorentz a1040a4553 Minor bug fixes 2021-07-02 21:48:12 +02:00
Valentin Lorentz f83f2a4edf Make all tests pass with Unreal (minus service tests) 2021-07-02 21:41:35 +02:00
Valentin Lorentz 2d2e788275 Start adding support for Unreal
Not all tests pass yet, Unreal uses the protocol in ways we did not anticipate.
2021-07-01 23:10:37 +02:00
Valentin Lorentz 2972706ca6 Add a 'services' mark, to allow disabling tests that depend on them. 2021-07-01 17:17:59 +02:00
Valentin Lorentz 26a0245a6a Add tests for the draft bot mode. 2021-07-01 16:44:48 +02:00
Shivaram Lingamneni cccb937068
Merge pull request #59 from ergochat/master
merge in a new ergo regression test
2021-06-28 01:48:18 -04:00
Shivaram Lingamneni 50cd718871 explicitly request sasl cap in new test 2021-06-28 00:23:26 -04:00
Shivaram Lingamneni 342ffcbdbe enable run_services for new test 2021-06-28 00:18:39 -04:00
Valentin Lorentz 7ee3c562d1 Run Atheme with InspIRCd, to enable tests depending on SASL 2021-06-27 16:45:43 +02:00
Valentin Lorentz 48eeeb7312 Always request the 'sasl' cap before using AUTHENTICATE
InspIRCd ignores AUTHENTICATE when the cap is not negotiated.
2021-06-27 14:38:54 +02:00
Valentin Lorentz 7ac4d7f80f Use `getRegistrationMessage()` when relevant
It's an alias for
`filter_pred=lambda m: m.command != "NOTICE", synchronize=False`
2021-06-27 14:38:54 +02:00
Valentin Lorentz cc8b9748a7 Always request the 'sasl' cap before using AUTHENTICATE
It's required by InspIRCd.

This commit also adds a check so we don't forget it when testing
locally only with Ergo.
2021-06-27 14:38:54 +02:00
Valentin Lorentz 829edddeb8 Remove some Ergo-specific assumptions.
We need to remove them before we can start running these tests
on Inspircd.
2021-06-27 14:38:54 +02:00
Shivaram Lingamneni 65b479c609 add regression test for ergochat/ergo#1696 2021-06-27 04:41:30 -04:00
Valentin Lorentz a29e46c17a Add test for account tag on INVITE messages.
This will catch issues like https://github.com/solanum-ircd/solanum/issues/166
(when we have registration support for solanum)
2021-06-26 18:44:55 +02:00
Shivaram Lingamneni 7be29ad801 rename Oragono to Ergo 2021-05-27 00:07:32 -04:00
Shivaram Lingamneni db0c64fa30 remove draft/resume-0.5 tests 2021-05-19 08:49:49 +02:00
Shivaram Lingamneni 729b7cb8d8 regression test for oragono/oragono#1642 2021-05-05 22:08:22 +02:00
Shivaram Lingamneni 498b67ae96 Remove CHATHISTORY * and znc.in/playback *self
CHATHISTORY * is being removed here:

https://github.com/ircv3/ircv3-specifications/pull/450

znc.in/playback *self was an Oragono extension that didn't catch on:

https://github.com/oragono/oragono/issues/1205
2021-04-17 23:26:06 +02:00
Valentin Lorentz 5e622a34d3 test_buffering: add support for ERR_INPUTTOOLONG 2021-03-05 20:29:44 +01:00
Valentin Lorentz c58c238875 Add a set of buffering/truncation test cases.
Also checks for UTF8ONLY
2021-03-05 19:30:30 +01:00
Shivaram Lingamneni 100b53fb18 test for Oragono disallowing truncation 2021-03-05 19:30:15 +01:00
Valentin Lorentz 6d74a06327 always negotiate batch with labeled-response, it's required by the spec 2021-03-04 17:38:50 +01:00
Shivaram Lingamneni 0f2445c1eb review fixes 2021-03-03 14:37:03 -05:00
Shivaram Lingamneni 74f40ad23d allow ERR_INPUTTOOLONG if a PRIVMSG cannot be relayed 2021-03-03 13:57:11 -05:00
Valentin Lorentz 1e0de7aefb assertMessageMatch: Add pattern-matching on tags, and start using it. 2021-03-01 21:59:50 +01:00
Valentin Lorentz 3c2db1531a register: Update error name to COMPLETE_CONNECTION_REQUIRED to follow the spec 2021-02-28 23:34:23 +01:00
Valentin Lorentz 3f231403ba Use assertMessageMatch whenever possible, and generalize listMatch to accept regexps
it's stricter this way + hopefully more readable and better error msgs
2021-02-28 23:22:31 +01:00
Valentin Lorentz e012c5248b Move list_match to its own module, and prepare generalizing AnyStr 2021-02-28 23:22:31 +01:00
Valentin Lorentz b8867cf4a2 Use a new 'magic' class AnyStr instead of Ellipsis for pattern-matching messages. 2021-02-28 20:44:31 +01:00
Valentin Lorentz 1fbd51c0b5 Rename assertMessageEqual to assertMessageMatch
it describes the function better
2021-02-28 20:44:31 +01:00
Valentin Lorentz ac2a37362c Use dataclasses instead of dicts/namedtuples 2021-02-28 18:45:13 +01:00
Valentin Lorentz 12da7e1e3b Enable mypy, and do the minimal changes to make it pass 2021-02-28 18:45:13 +01:00
Valentin Lorentz 04ae1dcba1 echo_message: run black 2021-02-28 11:59:25 +01:00
Valentin Lorentz 00ff27f277 resume: rename bar/baz to observer/mainnick to improve readability 2021-02-28 11:31:56 +01:00
Valentin Lorentz 6125381598 fix typo in spec name 2021-02-28 10:00:24 +01:00
Valentin Lorentz daa182bcd2 Make testDirectMessageEcho not Oragono-specific 2021-02-28 09:57:37 +01:00
Valentin Lorentz f7be6cf016 Make all remaining tests not Oragono-specific when relevant. 2021-02-28 09:57:16 +01:00
Valentin Lorentz 6b6b86415d Make testKeyValidation not Oragono-specific. 2021-02-28 09:43:08 +01:00
Valentin Lorentz 28ecfc4608 testStatusmsgFromOp: Fix interleaved events causing the test to be flaky. 2021-02-28 09:41:44 +01:00
Valentin Lorentz 96a8d1f7ff Make MuteExtban not Oragono-specific. 2021-02-28 09:24:47 +01:00
Valentin Lorentz 8cefc57e61 cases: Get rid of the subcommand/subparams nonsense
Tt was specific to the CAP command but pretended to be generic.

Instead, allow matching on the params argument using Ellipsis.
2021-02-28 08:59:48 +01:00
Valentin Lorentz 70fcc15e00 statusmsg: Make tests non Oragono-specific. 2021-02-28 08:57:39 +01:00
Valentin Lorentz da9567b612 Add BanMode tests. 2021-02-28 08:56:20 +01:00
Valentin Lorentz 51d0ce4483 Remove getIsupport(), it's redundant with server_support 2021-02-27 16:00:28 +01:00
Valentin Lorentz 22eb8d4369 inspircd: Enable all modules for caps/commands that we can test
Instead of skipping these tests.
2021-02-27 15:34:59 +01:00
Valentin Lorentz 72eee6114f Add ircd-seven 2021-02-27 15:23:33 +01:00
Valentin Lorentz 4d50c3eabc Rewrite PART tests to actually follow the RFCs. 2021-02-27 14:27:22 +01:00
Valentin Lorentz 0352a83a73 Change IRCv3 marks to reference capabilities instead of v3.1 / v3.2 2021-02-27 12:59:28 +01:00
Valentin Lorentz 5ab2fa709e Fix testNickReleaseUnregistered on inspircd
PING is not valid before registration.
2021-02-27 10:33:57 +01:00
Valentin Lorentz de243b38eb Fix testCapRemovalByClient for Charybdis 2021-02-26 21:26:25 +01:00
Valentin Lorentz e6ca463dce Make testCapRemovalByClient not specific to Oragono 2021-02-26 19:16:24 +01:00
Valentin Lorentz 05e75782c9 testNoticeNonexistentChannel: also quote RFC 1459 2021-02-24 19:46:36 +01:00
Valentin Lorentz c90141bc61 Use a dedicated 'deprecated' mark instead of add '-deprecated' for each spec
Also rename `@cases.SpecificationSelector.requiredBySpecification("xxx")`
to `@cases.mark_specifications("xxx")` because it's shorter and looks
like pytest's own syntax
2021-02-24 19:19:35 +01:00
Valentin Lorentz 2a1324fc94 lusers: Fix tests to allow missing optional args
According to https://defs.ircdocs.horse/defs/numerics.html , they are not mandatory;
and InspIRCd doesn't return them.
2021-02-24 19:07:22 +01:00
Valentin Lorentz f92b0e2889 lusers: Assert GlobalInvisible and GlobalVisible are lower or equal to the total 2021-02-24 19:07:22 +01:00
Valentin Lorentz fb04da39cc lusers: deduplicate assertions 2021-02-24 19:07:22 +01:00
Valentin Lorentz 0cf2726f78 away_notify: Better errors 2021-02-24 18:59:45 +01:00
Valentin Lorentz 79399e5c99 account_tag: Fix/proofread assertions. 2021-02-24 18:55:30 +01:00
Shivaram Lingamneni efab101890 remove sleep from read loops
recv() should block as necessary up to the 1-second timeout;
connection failures will break out of the loop with an exception.
There shouldn't be a case where we incur a busy wait.
2021-02-22 21:55:15 +01:00
Shivaram Lingamneni 10edb9dd9d fix LUSERS tests to work with oragono 2021-02-22 20:21:39 +01:00
Valentin Lorentz f9d0ec18ff Make flake8 pass, and run it automatically. 2021-02-22 19:42:18 +01:00
Valentin Lorentz 836cc5d6d2 Use isort to order imports. 2021-02-22 19:42:18 +01:00
Valentin Lorentz 8016e01daf Use Black code style 2021-02-22 19:42:18 +01:00
Valentin Lorentz e9a2bdd008 Fix merges 2021-02-22 18:33:42 +01:00
Valentin Lorentz 4ded96fbba Fix LUSER tests to pass with Charybdis. 2021-02-21 21:50:24 +01:00
Valentin Lorentz 3d7a539d06 Fix some tests to pass with inspircd 2021-02-20 09:53:30 +01:00
Valentin Lorentz 684c889304 Fix testWhoisUser to pass with inspircd. 2021-02-19 19:22:00 +01:00
Valentin Lorentz fe0d65f7c8 Fix oragono tests broken by 9b2a6a063c. 2021-02-19 19:19:37 +01:00
Valentin Lorentz a74f893942 Fix IRCv3 tests to not fail with Charybdis. 2021-02-17 21:35:36 +01:00
Valentin Lorentz 75dafa47fe testWhoisUser: use a shorter username, so it doesn't get truncated
eg. charybdis limits it to 10 characters
2021-02-17 10:45:52 +01:00
Valentin Lorentz d69c41756b Fix RFC1459 tests to pass with charybdis
only oragono replies to PINGs before a valid NICK afaik.
2021-02-16 00:33:46 +01:00
Valentin Lorentz 9b2a6a063c Don't pass a 'config' argument to the controller, only Oragono had it.
Instead, annotate tests with the optional features they may need from the IRCd.
2021-02-15 23:29:10 +01:00
Shivaram Lingamneni de49571b1e add test coverage for RPL_TOPIC 2021-02-08 17:47:11 -05:00
Shivaram Lingamneni b58fe44b5b update relaymsg test 2020-12-21 22:06:13 -05:00
Shivaram Lingamneni 307722fbec test the multiline batch tag 2020-12-15 04:41:25 -05:00
Shivaram Lingamneni 0b9087cc39 rename test 2020-12-14 22:55:49 -05:00
Shivaram Lingamneni 40ac45cdbe add a channel forwarding test 2020-12-14 05:22:41 -05:00
Shivaram Lingamneni 5aeb297de5 fix relaymsg test fail code 2020-12-07 02:25:20 -05:00
Shivaram Lingamneni 8c66157a9e test that TAGMSG are not sent to users with only server-time 2020-11-30 17:00:06 -05:00
Shivaram Lingamneni 3b489a2125 test long-line DoS attacks 2020-11-30 13:18:02 -05:00
Shivaram Lingamneni 14435ce0e8 regression test for oragono #1411 2020-11-29 19:32:29 -05:00
Shivaram Lingamneni a723791942 add a test for message-tags and ERR_INPUTTOOLONG 2020-11-29 18:54:37 -05:00
Shivaram Lingamneni d741ab86d5 add a test for message-tags 2020-11-26 00:25:52 -05:00
Shivaram Lingamneni b7975ada46 allow message-tags to enable account tag implicitly
Servers MAY send arbitrary server tags (time, msgid, account) to clients
that have enabled message-tags.
2020-11-24 21:22:59 -05:00
Shivaram Lingamneni b43e127805 modify chathistory test to check for INVALID_TARGET 2020-11-04 01:51:51 -05:00
Shivaram Lingamneni 512b4bd74d add regression test for oragono #1370 2020-11-01 18:14:57 -05:00
Shivaram Lingamneni d48cbc4287 oragono-specific test for unregistered lusers counts 2020-10-21 19:47:49 -04:00
Shivaram Lingamneni 215ed3171b test unregistered counts in LUSERS 2020-10-21 19:46:00 -04:00
Shivaram Lingamneni 95a26bfa57 add a test for +m 2020-10-21 19:26:31 -04:00
Shivaram Lingamneni 706e794df6 test for mute extban 2020-10-21 11:08:14 -04:00
Shivaram Lingamneni 62197e4c4d test for +U opmoderated 2020-10-20 13:42:51 -04:00
Shivaram Lingamneni f0eb6e4e80 test for lusers 2020-10-15 22:40:11 -04:00