The test-tunnel sample test tools
test_tunnel.cmd_test
A collection of sample command-line tools to test tunnel implementations.
Test the microsocks
simple SOCKS5 server implementation
test_tunnel.cmd_test.microsocks
Run some tests on the microsocks proxy server and client.
ATYP_INET: Final = 1
module-attribute
The SOCKS5 address type for IPv4.
ATYP_INET6: Final = 4
module-attribute
The SOCKS5 address type for IPv6.
TestMicroSOCKS
Bases: TestTunnel
Run the tunnel tests using a microsocks server.
Source code in src/test_tunnel/cmd_test/microsocks.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
do_handshake(cli_sock, svc_listen)
Perform the SOCKS5 handshake.
Source code in src/test_tunnel/cmd_test/microsocks.py
do_spawn_server(proxy_listen, svc_listen)
Spawn the microsocks proxy process.
Source code in src/test_tunnel/cmd_test/microsocks.py
quirk_server_returns_null_ipv4_response()
classmethod
Expect 4 + 2 zeroes as a response to the "connect" request.
The microsocks server does not bother returning any connection information in the response to the "connect" request; instead, it returns an address type of IPv4 and four + two bytes of zeroes.
Source code in src/test_tunnel/cmd_test/microsocks.py
UnsupportedAddressTypeError
dataclass
Bases: Exception
An unsupported address family was specified.
Source code in src/test_tunnel/cmd_test/microsocks.py
main(cfg)
Parse command-line arguments, prepare the environment, run tests.
Test the socat
tool's TCP connection forwarding
test_tunnel.cmd_test.socat
Run some tests using the socat tool in forwarding mode.
TestSoCat
Bases: TestTunnel
Run the tunnel tests using a socat instance.
Source code in src/test_tunnel/cmd_test/socat.py
do_handshake(cli_sock, svc_listen)
No handshake for socat.
Source code in src/test_tunnel/cmd_test/socat.py
do_spawn_server(proxy_listen, svc_listen)
Spawn the socat proxy process.
Source code in src/test_tunnel/cmd_test/socat.py
main(cfg)
Parse command-line arguments, prepare the environment, run tests.