From 3b489a2125ce9cf47a494f5c08a560be3a5cc0c5 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Mon, 30 Nov 2020 13:18:02 -0500 Subject: [PATCH] test long-line DoS attacks --- irctest/server_tests/test_readq.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 irctest/server_tests/test_readq.py diff --git a/irctest/server_tests/test_readq.py b/irctest/server_tests/test_readq.py new file mode 100644 index 0000000..e5abf31 --- /dev/null +++ b/irctest/server_tests/test_readq.py @@ -0,0 +1,19 @@ +from irctest import cases + + +class ReadqTestCase(cases.BaseServerTestCase): + """Test responses to DoS attacks using long lines.""" + + @cases.SpecificationSelector.requiredBySpecification('Oragono') + def testReadqTags(self): + self.connectClient('mallory', name='mallory', capabilities=['message-tags']) + self.joinChannel('mallory', '#test') + self.sendLine('mallory', 'PRIVMSG #test ' + 'a' * 16384) + self.assertDisconnected('mallory') + + @cases.SpecificationSelector.requiredBySpecification('Oragono') + def testReadqNoTags(self): + self.connectClient('mallory', name='mallory') + self.joinChannel('mallory', '#test') + self.sendLine('mallory', 'PRIVMSG #test ' + 'a' * 16384) + self.assertDisconnected('mallory')