Add more tests to test.sh

This commit is contained in:
Travis Burtrum 2019-12-15 13:30:54 -05:00
parent e5a309f66f
commit a9f7daf823
2 changed files with 8 additions and 1 deletions

View File

@ -8,9 +8,9 @@ Proxy wireguard UDP packets over TCP/TLS
Testing: 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 `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 -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 `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: Testing with GNU netcat:

View File

@ -1,8 +1,15 @@
#!/bin/sh #!/bin/sh
set -x
# first make sure udp-test succeeds running against itself # first make sure udp-test succeeds running against itself
cargo run --release --bin udp-test || exit 1 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 # now run proxyd pointing to udp-test
cargo run --release --bin wireguard-proxyd -- 127.0.0.1:5555 127.0.0.1:51822 & cargo run --release --bin wireguard-proxyd -- 127.0.0.1:5555 127.0.0.1:51822 &
proxyd_pid=$! proxyd_pid=$!