(tctx: Context, success)
| 64 | |
| 65 | @pytest.mark.parametrize("success", ["success", "fail"]) |
| 66 | def test_tunnel_handshake_start(tctx: Context, success): |
| 67 | server = Server(address=("proxy", 1234)) |
| 68 | server.state = ConnectionState.OPEN |
| 69 | |
| 70 | tl = TTunnelLayer(tctx, server, tctx.server) |
| 71 | tl.child_layer = TChildLayer(tctx) |
| 72 | assert repr(tl) |
| 73 | |
| 74 | playbook = Playbook(tl, logs=True) |
| 75 | ( |
| 76 | playbook |
| 77 | << SendData(server, b"handshake-hello") |
| 78 | >> DataReceived(tctx.client, b"client-hello") |
| 79 | >> DataReceived(server, b"handshake-" + success.encode()) |
| 80 | << SendData(server, b"handshake-" + success.encode()) |
| 81 | ) |
| 82 | if success == "success": |
| 83 | playbook << Log("Got start. Server state: OPEN") |
| 84 | else: |
| 85 | playbook << CloseConnection(server) |
| 86 | playbook << Log("Got start. Server state: CLOSED") |
| 87 | |
| 88 | playbook << SendData(tctx.client, b"client-hello-reply") |
| 89 | if success == "success": |
| 90 | playbook >> DataReceived(server, b"tunneled-server-hello") |
| 91 | playbook << SendData(server, b"tunneled-server-hello-reply") |
| 92 | |
| 93 | assert playbook |
| 94 | |
| 95 | |
| 96 | @pytest.mark.parametrize("success", ["success", "fail"]) |
nothing calls this directly
no test coverage detected
searching dependent graphs…