2019-07-16 00:41:50 -04:00
|
|
|
# This script takes care of testing your crate
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
# TODO This is the "test phase", tweak it as you see fit
|
|
|
|
main() {
|
2019-12-16 14:23:12 -05:00
|
|
|
cross build --target $TARGET --release --features $CARGO_FEATURES
|
2019-07-16 00:41:50 -04:00
|
|
|
|
|
|
|
if [ ! -z $DISABLE_TESTS ]; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
# first make sure udp-test succeeds running against itself
|
2019-12-16 14:23:12 -05:00
|
|
|
cross run --target $TARGET --release --features $CARGO_FEATURES --bin udp-test
|
2019-07-16 00:41:50 -04:00
|
|
|
|
|
|
|
# now run udp-test through proxy/proxyd
|
2019-12-16 14:23:12 -05:00
|
|
|
cross run --target $TARGET --release --features $CARGO_FEATURES --bin udp-test -- -is
|
2019-12-16 21:44:07 -05:00
|
|
|
|
|
|
|
if [ $CARGO_FEATURES != "default" ]; then
|
|
|
|
# run TLS tests then too
|
|
|
|
cross run --target $TARGET --release --features $CARGO_FEATURES --bin udp-test -- -is --tls-key ci/cert.key --tls-cert ci/cert.pem
|
2019-12-17 01:11:19 -05:00
|
|
|
|
|
|
|
# now pubkey tests
|
|
|
|
|
|
|
|
# one that should fail (wrong pinnedpubkey lowercase e at end instead of uppercase E)
|
|
|
|
cross run --target $TARGET --release --features $CARGO_FEATURES --bin udp-test -- -is --tls-key ci/cert.key --tls-cert ci/cert.pem --pinnedpubkey sha256//BEyQeSjwwUBLXXNuCILHRWyV1gLmY31CdMHNA4VH4de= && exit 1 || true
|
|
|
|
|
|
|
|
# and one that should pass
|
|
|
|
cross run --target $TARGET --release --features $CARGO_FEATURES --bin udp-test -- -is --tls-key ci/cert.key --tls-cert ci/cert.pem --pinnedpubkey sha256//BEyQeSjwwUBLXXNuCILHRWyV1gLmY31CdMHNA4VH4dE=
|
2019-12-16 21:44:07 -05:00
|
|
|
fi
|
2019-07-16 00:41:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
# we don't run the "test phase" when doing deploys
|
|
|
|
if [ -z $TRAVIS_TAG ]; then
|
|
|
|
main
|
|
|
|
fi
|