diff --git a/irctest/server_tests/cap.py b/irctest/server_tests/cap.py index 05892897..8cc8258d 100644 --- a/irctest/server_tests/cap.py +++ b/irctest/server_tests/cap.py @@ -20,7 +20,7 @@ def testInvalidCapSubcommand(self): m = self.getRegistrationMessage(1) self.assertTrue( self.messageDiffers(m, command="PONG", params=[ANYSTR, "test123"]), - "Sending “CAP NOTACOMMAND” as first message got no reply" + "Sending “CAP NOTACOMMAND” as first message got no reply", ) self.assertMessageMatch( m, @@ -56,18 +56,24 @@ def testNoReq(self): ) @cases.mark_specifications("IRCv3") + @cases.xfailIfSoftware( + ["UnrealIRCd"], + "UnrealIRCd sends a trailing space on CAP ACK: https://github.com/unrealircd/unrealircd/pull/148", + ) def testReqOne(self): """Tests requesting a single capability""" self.addClient(1) - self.sendLine(1, "CAP LS 302") + self.sendLine(1, "CAP LS") self.getCapLs(1) self.sendLine(1, "USER foo foo foo :foo") self.sendLine(1, "NICK foo") - self.sendLine(1, "CAP REQ :server-time") + self.sendLine(1, "CAP REQ :multi-prefix") m = self.getRegistrationMessage(1) self.assertMessageMatch( - m, command="CAP", params=[ANYSTR, "ACK", "server-time"], - fail_msg="Expected CAP ACK after sending CAP REQ, got {msg}." + m, + command="CAP", + params=[ANYSTR, "ACK", "multi-prefix"], + fail_msg="Expected CAP ACK after sending CAP REQ, got {msg}.", ) self.sendLine(1, "CAP LIST") @@ -75,8 +81,8 @@ def testReqOne(self): self.assertMessageMatch( m, command="CAP", - params=[ANYSTR, "LIST", "server-time"], - fail_msg="Expected CAP LIST after sending CAP LIST, got {msg}." + params=[ANYSTR, "LIST", "multi-prefix"], + fail_msg="Expected CAP LIST after sending CAP LIST, got {msg}.", ) self.sendLine(1, "CAP END") @@ -86,18 +92,24 @@ def testReqOne(self): ) @cases.mark_specifications("IRCv3") + @cases.xfailIfSoftware( + ["UnrealIRCd"], + "UnrealIRCd sends a trailing space on CAP ACK: https://github.com/unrealircd/unrealircd/pull/148", + ) def testReqTwo(self): """Tests requesting two capabilities at once""" self.addClient(1) - self.sendLine(1, "CAP LS 302") + self.sendLine(1, "CAP LS") self.getCapLs(1) self.sendLine(1, "USER foo foo foo :foo") self.sendLine(1, "NICK foo") - self.sendLine(1, "CAP REQ :server-time userhost-in-names") + self.sendLine(1, "CAP REQ :multi-prefix userhost-in-names") m = self.getRegistrationMessage(1) self.assertMessageMatch( - m, command="CAP", params=[ANYSTR, "ACK", "server-time userhost-in-names"], - fail_msg="Expected CAP ACK after sending CAP REQ, got {msg}." + m, + command="CAP", + params=[ANYSTR, "ACK", "multi-prefix userhost-in-names"], + fail_msg="Expected CAP ACK after sending CAP REQ, got {msg}.", ) self.sendLine(1, "CAP LIST") @@ -105,8 +117,8 @@ def testReqTwo(self): self.assertMessageMatch( m, command="CAP", - params=[ANYSTR, "LIST", "server-time userhost-in-names"], - fail_msg="Expected CAP LIST after sending CAP LIST, got {msg}." + params=[ANYSTR, "LIST", "multi-prefix userhost-in-names"], + fail_msg="Expected CAP LIST after sending CAP LIST, got {msg}.", ) self.sendLine(1, "CAP END") @@ -116,26 +128,34 @@ def testReqTwo(self): ) @cases.mark_specifications("IRCv3") + @cases.xfailIfSoftware( + ["UnrealIRCd"], + "UnrealIRCd sends a trailing space on CAP ACK: https://github.com/unrealircd/unrealircd/pull/148", + ) def testReqOneThenOne(self): """Tests requesting two capabilities in different messages""" self.addClient(1) - self.sendLine(1, "CAP LS 302") + self.sendLine(1, "CAP LS") self.getCapLs(1) self.sendLine(1, "USER foo foo foo :foo") self.sendLine(1, "NICK foo") - self.sendLine(1, "CAP REQ :server-time") + self.sendLine(1, "CAP REQ :multi-prefix") m = self.getRegistrationMessage(1) self.assertMessageMatch( - m, command="CAP", params=[ANYSTR, "ACK", "server-time"], - fail_msg="Expected CAP ACK after sending CAP REQ, got {msg}." + m, + command="CAP", + params=[ANYSTR, "ACK", "multi-prefix"], + fail_msg="Expected CAP ACK after sending CAP REQ, got {msg}.", ) self.sendLine(1, "CAP REQ :userhost-in-names") m = self.getRegistrationMessage(1) self.assertMessageMatch( - m, command="CAP", params=[ANYSTR, "ACK", "userhost-in-names"], - fail_msg="Expected CAP ACK after sending CAP REQ, got {msg}." + m, + command="CAP", + params=[ANYSTR, "ACK", "userhost-in-names"], + fail_msg="Expected CAP ACK after sending CAP REQ, got {msg}.", ) self.sendLine(1, "CAP LIST") @@ -143,8 +163,8 @@ def testReqOneThenOne(self): self.assertMessageMatch( m, command="CAP", - params=[ANYSTR, "LIST", "server-time userhost-in-names"], - fail_msg="Expected CAP LIST after sending CAP LIST, got {msg}." + params=[ANYSTR, "LIST", "multi-prefix userhost-in-names"], + fail_msg="Expected CAP LIST after sending CAP LIST, got {msg}.", ) self.sendLine(1, "CAP END") @@ -154,19 +174,25 @@ def testReqOneThenOne(self): ) @cases.mark_specifications("IRCv3") + @cases.xfailIfSoftware( + ["UnrealIRCd"], + "UnrealIRCd sends a trailing space on CAP ACK: https://github.com/unrealircd/unrealircd/pull/148", + ) def testReqPostRegistration(self): """Tests requesting more capabilities after CAP END""" self.addClient(1) - self.sendLine(1, "CAP LS 302") + self.sendLine(1, "CAP LS") self.getCapLs(1) self.sendLine(1, "USER foo foo foo :foo") self.sendLine(1, "NICK foo") - self.sendLine(1, "CAP REQ :server-time") + self.sendLine(1, "CAP REQ :multi-prefix") m = self.getRegistrationMessage(1) self.assertMessageMatch( - m, command="CAP", params=[ANYSTR, "ACK", "server-time"], - fail_msg="Expected CAP ACK after sending CAP REQ, got {msg}." + m, + command="CAP", + params=[ANYSTR, "ACK", "multi-prefix"], + fail_msg="Expected CAP ACK after sending CAP REQ, got {msg}.", ) self.sendLine(1, "CAP LIST") @@ -175,7 +201,7 @@ def testReqPostRegistration(self): m, command="CAP", params=[ANYSTR, "LIST", "server-time"], - fail_msg="Expected CAP LIST after sending CAP LIST, got {msg}." + fail_msg="Expected CAP LIST after sending CAP LIST, got {msg}.", ) self.sendLine(1, "CAP END") @@ -189,8 +215,10 @@ def testReqPostRegistration(self): self.sendLine(1, "CAP REQ :userhost-in-names") m = self.getRegistrationMessage(1) self.assertMessageMatch( - m, command="CAP", params=[ANYSTR, "ACK", "userhost-in-names"], - fail_msg="Expected CAP ACK after sending CAP REQ, got {msg}." + m, + command="CAP", + params=[ANYSTR, "ACK", "userhost-in-names"], + fail_msg="Expected CAP ACK after sending CAP REQ, got {msg}.", ) self.sendLine(1, "CAP LIST") @@ -199,7 +227,7 @@ def testReqPostRegistration(self): m, command="CAP", params=[ANYSTR, "LIST", "server-time userhost-in-names"], - fail_msg="Expected CAP LIST after sending CAP LIST, got {msg}." + fail_msg="Expected CAP LIST after sending CAP LIST, got {msg}.", ) @cases.mark_specifications("IRCv3")