From 73237237ef8a14bb68f1c98f8826ebd67b023fee Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Wed, 13 Feb 2019 17:27:32 -0500 Subject: [PATCH] test incorrect PASS passwords --- irctest/server_tests/test_connection_registration.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/irctest/server_tests/test_connection_registration.py b/irctest/server_tests/test_connection_registration.py index a719768..e26b08c 100644 --- a/irctest/server_tests/test_connection_registration.py +++ b/irctest/server_tests/test_connection_registration.py @@ -31,6 +31,16 @@ class PasswordedConnectionRegistrationTestCase(cases.BaseServerTestCase): self.assertNotEqual(m.command, '001', msg='Got 001 after NICK+USER but missing PASS') + @cases.SpecificationSelector.requiredBySpecification('RFC1459', 'RFC2812') + def testWrongPassword(self): + self.addClient() + self.sendLine(1, 'PASS {}'.format(self.password + "garbage")) + self.sendLine(1, 'NICK foo') + self.sendLine(1, 'USER username * * :Realname') + m = self.getRegistrationMessage(1) + self.assertNotEqual(m.command, '001', + msg='Got 001 after NICK+USER but incorrect PASS') + @cases.SpecificationSelector.requiredBySpecification('RFC1459', 'RFC2812') def testPassAfterNickuser(self): """“The password can and must be set before any attempt to register