proxy wireguard over TCP/TLS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.8 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. # This script takes care of testing your crate
  2. set -ex
  3. # TODO This is the "test phase", tweak it as you see fit
  4. main() {
  5. cross rustc --bin wireguard-proxy --target $TARGET --release --no-default-features --features $CARGO_FEATURES
  6. cross rustc --bin udp-test --target $TARGET --release --no-default-features --features $CARGO_FEATURES
  7. # to check how they are built
  8. file target/$TARGET/release/wireguard-proxy* target/$TARGET/release/udp-test* || echo 'file failed'
  9. if [ ! -z $DISABLE_TESTS ]; then
  10. return
  11. fi
  12. # first make sure udp-test succeeds running against itself
  13. cross run --target $TARGET --release --no-default-features --features $CARGO_FEATURES --bin udp-test
  14. # now run udp-test through proxy/proxyd
  15. cross run --target $TARGET --release --no-default-features --features $CARGO_FEATURES --bin udp-test -- -is
  16. if [ $CARGO_FEATURES != "verbose" ]; then
  17. # run TLS tests then too
  18. cross run --target $TARGET --release --no-default-features --features $CARGO_FEATURES --bin udp-test -- -is --tls-key ci/cert.key --tls-cert ci/cert.pem
  19. # now pubkey tests
  20. # one that should fail (wrong pinnedpubkey lowercase e at end instead of uppercase E)
  21. cross run --target $TARGET --release --no-default-features --features $CARGO_FEATURES --bin udp-test -- -is --tls-key ci/cert.key --tls-cert ci/cert.pem --pinnedpubkey sha256//BEyQeSjwwUBLXXNuCILHRWyV1gLmY31CdMHNA4VH4de= && exit 1 || true
  22. # and one that should pass
  23. cross run --target $TARGET --release --no-default-features --features $CARGO_FEATURES --bin udp-test -- -is --tls-key ci/cert.key --tls-cert ci/cert.pem --pinnedpubkey sha256//BEyQeSjwwUBLXXNuCILHRWyV1gLmY31CdMHNA4VH4dE=
  24. fi
  25. }
  26. # we don't run the "test phase" when doing deploys
  27. if [ -z $TRAVIS_TAG ]; then
  28. main
  29. fi