Expand description
Reusable differential test harness for comparing eggress with Python pproxy.
All tests using this harness are gated on EGGRESS_RUN_PPROXY_DIFFERENTIAL=1
and require Python 3 with pproxy installed (pip install pproxy==2.7.9).
§Usage
use eggress_testkit::differential::*;
require_differential_gate();
let (echo_addr, echo_jh) = eggress_testkit::start_echo_server().await;
let mut pproxy = start_pproxy_server("socks5", 1080).await;
// ... run tests ...
pproxy.kill();
echo_jh.abort();Structs§
- Process
Guard - RAII guard that kills a child process on drop.
Constants§
- GATE_
VAR - Environment variable that gates differential tests.
- LEGACY_
PYTHON_ VAR - Legacy environment variable for the Python binary path.
- ORACLE_
PYTHON_ VAR - Canonical environment variable for the oracle Python interpreter.
- PINNED_
PPROXY_ VERSION - Pinned pproxy version for reproducible test results.
- PYTHON_
BIN_ VAR - Deprecated alias — prefer
ORACLE_PYTHON_VARorLEGACY_PYTHON_VAR.
Functions§
- assert_
coarse_ failure_ equivalence - Assert coarse failure equivalence: both succeeded or both failed.
- assert_
port_ ready - Assert that a port becomes reachable within the timeout.
- build_
socks5_ udp_ packet - Build a SOCKS5 UDP datagram with an IPv4 or IPv6 target.
- build_
socks5_ udp_ packet_ domain - Build a SOCKS5 UDP datagram with a domain target.
- build_
socks5_ udp_ packet_ frag - Build a SOCKS5 UDP datagram with a custom FRAG field.
- compare_
tcp_ echo - Compare two TCP echo results.
- compare_
udp_ echo - Compare two UDP echo results.
- differential_
gate_ enabled - Check if the differential test gate is enabled.
- extract_
http_ body - Extract the body from an HTTP response (after the first
\r\n\r\n). - extract_
http_ status - Extract the HTTP status code from a response (e.g., “200” from “HTTP/1.1 200 OK”).
- extract_
udp_ payload - Extract the payload from a SOCKS5 UDP datagram.
- find_
oracle_ python - Find the oracle Python interpreter with version validation.
- find_
python_ binary - Find a working Python binary that has pproxy installed.
- read_
with_ timeout - Read all available data from an
AsyncReadwithin a timeout. - recv_
udp_ response - Receive a UDP response with a timeout.
- require_
differential_ gate - Require the differential gate to be enabled.
- start_
pproxy_ server - Start a pproxy server with the given protocol and port.
- start_
pproxy_ server_ with_ auth - Start a pproxy server with username/password authentication.
- start_
pproxy_ with_ args - Start a pproxy server with arbitrary CLI arguments.
- start_
udp_ echo - Start a UDP echo server that echoes received packets back to the sender.
- wait_
for_ port - Wait for a TCP port to become reachable.