From a9f7daf82339b4c19d4b6634d80a6835843d72e7 Mon Sep 17 00:00:00 2001 From: moparisthebest Date: Sun, 15 Dec 2019 13:30:54 -0500 Subject: [PATCH] Add more tests to test.sh --- README.md | 2 +- test.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ec5c6dc..9783c5f 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,9 @@ Proxy wireguard UDP packets over TCP/TLS Testing: `udp-test` is a utility to send a UDP packet and then receive a UDP packet and ensure they are the same, this verifies packets sent through proxy/proxyd are unmolested -`test.sh` runs udp-test against itself and then through proxyd/proxy `udp-test -s` runs udp-test against itself through proxyd/proxy by spawning actual binaries `udp-test -is` runs udp-test against itself through proxyd/proxy in same executable by using library, so does not test command line parsing etc +`test.sh` runs udp-test against itself, then the udp-test self tests above, and then through proxyd/proxy in the shell script Testing with GNU netcat: diff --git a/test.sh b/test.sh index cfdcccb..a4331cd 100755 --- a/test.sh +++ b/test.sh @@ -1,8 +1,15 @@ #!/bin/sh +set -x # first make sure udp-test succeeds running against itself cargo run --release --bin udp-test || exit 1 +# now run udp-test without spawning other processes +cargo run --release --bin udp-test -- -is || exit 1 + +# now run udp-test essentially just like the script below, but all in rust +cargo run --release --bin udp-test -- -s || exit 1 + # now run proxyd pointing to udp-test cargo run --release --bin wireguard-proxyd -- 127.0.0.1:5555 127.0.0.1:51822 & proxyd_pid=$!