| 128 | self.assertEqual(server_cmds[0].getData(), connectionTimeout.getData()) |
| 129 | |
| 130 | def test_4(self): |
| 131 | # PING |
| 132 | resp = b'\x05\x00\x14\x03\x10\x00\x00\x00\x14\x00\x00\x00\x00\x00' + \ |
| 133 | b'\x00\x00\x01\x00\x00\x00' |
| 134 | |
| 135 | packet = rpch.RTSHeader(resp) |
| 136 | packet.dump() |
| 137 | |
| 138 | pduData = packet['pduData'] |
| 139 | numberOfCommands = packet['NumberOfCommands'] |
| 140 | |
| 141 | server_cmds = [] |
| 142 | while numberOfCommands > 0: |
| 143 | numberOfCommands -= 1 |
| 144 | |
| 145 | cmd_type = unpack('<L', pduData[:4])[0] |
| 146 | cmd = rpch.COMMANDS[cmd_type](pduData) |
| 147 | server_cmds.append(cmd) |
| 148 | pduData = pduData[len(cmd):] |
| 149 | |
| 150 | for cmd in server_cmds: |
| 151 | cmd.dump() |
| 152 | |
| 153 | self.assertEqual(packet['Flags'], rpch.RTS_FLAG_PING) |
| 154 | |
| 155 | def test_5(self): |
| 156 | # CONN/C2 |