Shivaram Lingamneni
729b7cb8d8
regression test for oragono/oragono#1642
2021-05-05 22:08:22 +02:00
Valentin Lorentz
cfe0b0d3dd
Add test for message matching commands
...
+ fix a bug in tested code
+ change conftest.py to allow missing --controller arg (which is
an UI improvement, as it allows using 'pytest --help' now)
2021-04-18 09:21:27 +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
4d2976c7e6
Use TCP_NODELAY on the socket, it may be better to make test_buffering relevant
2021-03-05 20:21:48 +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
62a87b5957
type-annotate all functions outside the tests themselves.
2021-02-28 18:45:13 +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
1c1b8214a0
normalize_namreply_params: Fix typo in function call
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
06972fc1c4
Add Solanum
2021-02-27 15:34:59 +01:00
Valentin Lorentz
72eee6114f
Add ircd-seven
2021-02-27 15:23:33 +01:00
Valentin Lorentz
407fe663d1
Add Solanum
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
309a0e45e7
assertMessageEqual: fix error msg
2021-02-27 14:14:08 +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
ae09b99d0e
Overload the < <= > >= comparison assertion methods.
2021-02-26 21:06:17 +01:00
Valentin Lorentz
0a1ccfec24
Fix assertMessageEqual to actually raise the exception
2021-02-26 21:05:01 +01:00
Valentin Lorentz
e6ca463dce
Make testCapRemovalByClient not specific to Oragono
2021-02-26 19:16:24 +01:00
Valentin Lorentz
ff67739c67
Add _IrcTestCase.messageDiffers to allow matching messages without using assertions.
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
Valentin Lorentz
2bd5093df9
Remove strip_first_param argument, it's unused.
2021-02-24 18:19:29 +01:00
Valentin Lorentz
8ea7197f76
Crash when a controlled process stopped instead of waiting forever.
2021-02-24 16:18:08 +01:00
Valentin Lorentz
932e9ade5a
sopel: Create ~/.sopel/ if it does not exist
2021-02-24 13:49:14 +01:00
Shivaram Lingamneni
2ef4689004
restore print statement when waiting
2021-02-22 21:55:15 +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
4ac891382e
make pyxmpp2-scram an optional dependency.
2021-02-22 19:44:41 +01:00
Valentin Lorentz
ca93caa69d
Make the dependency on ecdsa optional
2021-02-22 19:44:41 +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
34ed62fd85
Merge branch 'cherry-picking' ('Cherry pick commits from my old branch of irctest' GH-17)
2021-02-22 18:44:41 +01:00
Valentin Lorentz
e9a2bdd008
Fix merges
2021-02-22 18:33:42 +01:00
Valentin Lorentz
f0141b0a93
Fix compatibility with return value of SSLSocket.sendall in python >= 3.6.
...
https://bugs.python.org/issue25951
2021-02-21 23:18:55 +01:00
Valentin Lorentz
e45a1fb9db
limnoria: add support for STS.
2021-02-21 23:18:55 +01:00
Valentin Lorentz
28f1ceb4e6
Fix ecdsa tests to use the same protocol as Atheme.
...
Which requires not hashing the challenge.
2021-02-21 23:18:55 +01:00
Valentin Lorentz
ff54d9cfd6
Temporarily disabling sts on Limnoria until it's released.
2021-02-21 22:05:15 +01:00
Valentin Lorentz
b4873fdea4
Ignore return value of sendall; it's not None on py < 3.6.
...
https://bugs.python.org/issue25951
2021-02-21 22:05:15 +01:00
Valentin Lorentz
373c705247
Add STS tests.
2021-02-21 22:05:15 +01:00
Valentin Lorentz
68c2dad8d9
For SCRAM, check clients send an empty response at the end.
...
https://github.com/ircv3/ircv3-specifications/pull/326
2021-02-21 22:05:15 +01:00
Valentin Lorentz
4ded96fbba
Fix LUSER tests to pass with Charybdis.
2021-02-21 21:50:24 +01:00
Valentin Lorentz
85f02c4626
Use pytest as a test runner instead of unit test
...
'./test <controller> -s spec1 -s spec2' becomes:
'pytest --controller <controller> -k "spec1 or spec2"'
This uses pytest's test selection, which allows finer selection of which tests
to run (for example, it will allow running all tests but those requiring one
feature or combination of features).
It also allows running only a particular test (or set of test) by
filtering on their name or file name.
pytest also shows a much nicer output while testing (grouped by file,
percentage of tests run, manages the verbosity); and it captures all the output
and only shows it if the test fails, which makes --show-io irrelevant.
2021-02-21 18:03:20 +01:00
Valentin Lorentz
efa5b5eb3b
client_tests/test_sasl: Update to work with newer versions of Sopel
2021-02-20 10:53:23 +01:00
Valentin Lorentz
fe694487c7
Better handling of connections closed by clients.
2021-02-20 10:43:00 +01:00
Valentin Lorentz
c4a9592156
Fix Sopel tests; broken by 9b2a6a063c
.
2021-02-20 10:42:37 +01:00
Valentin Lorentz
3d7a539d06
Fix some tests to pass with inspircd
2021-02-20 09:53:30 +01:00
Valentin Lorentz
3932a40d74
Fix client tests broken by a14ebf9ec2
.
2021-02-19 23:00:00 +01:00
Valentin Lorentz
0dfe0de549
Fix client tests broken by 020564bdcb
.
2021-02-19 22:57:59 +01:00
Valentin Lorentz
c9c08c7f6f
client_mock: Write client name in 'waiting...' message
2021-02-19 22:25:41 +01:00
Valentin Lorentz
684c889304
Fix testWhoisUser to pass with inspircd.
2021-02-19 19:22:00 +01:00
Valentin Lorentz
c9dbba985c
Fix crash when sendLine() is called with bytes and --show-io is given.
2021-02-19 19:19:58 +01:00
Valentin Lorentz
fe0d65f7c8
Fix oragono tests broken by 9b2a6a063c
.
2021-02-19 19:19:37 +01:00
Shivaram Lingamneni
8d427c80c8
fix stall on failed channel join
2021-02-18 19:35:11 +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