MCPcopy
hub / github.com/jtesta/ssh-audit / test_ssh2_server_simple

Method test_ssh2_server_simple

test/test_ssh2.py:156–168  ·  view source on GitHub ↗
(self, output_spy, virtual_socket)

Source from the content-addressed store, hash-verified

154 assert kex1.payload == kex2.payload
155
156 def test_ssh2_server_simple(self, output_spy, virtual_socket):
157 vsocket = virtual_socket
158 w = self.wbuf()
159 w.write_byte(self.protocol.MSG_KEXINIT)
160 w.write(self._kex_payload())
161 vsocket.rdata.append(b'SSH-2.0-OpenSSH_7.3 ssh-audit-test\r\n')
162 vsocket.rdata.append(self._create_ssh2_packet(w.write_flush()))
163 output_spy.begin()
164 out = self.OutputBuffer()
165 self.audit(out, self._conf())
166 out.write()
167 lines = output_spy.flush()
168 assert len(lines) == 78
169
170 def test_ssh2_server_invalid_first_packet(self, output_spy, virtual_socket):
171 vsocket = virtual_socket

Callers

nothing calls this directly

Calls 9

_kex_payloadMethod · 0.95
_create_ssh2_packetMethod · 0.95
_confMethod · 0.95
writeMethod · 0.95
write_byteMethod · 0.80
write_flushMethod · 0.80
beginMethod · 0.80
flushMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected