X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=test%2Fsecurity.test;h=fb783b06fb0949e554e706b6e009b11cf81d4688;hb=df716df33af8e9a5b93d573a023ecd7fc24d9a03;hp=815825ea3a2afcfd29bfc7e1d761ac372c21fdca;hpb=4fbaf80d56a418ebd23eeace9053fa8f20097f77;p=tinc diff --git a/test/security.test b/test/security.test index 815825ea..fb783b06 100755 --- a/test/security.test +++ b/test/security.test @@ -1,19 +1,19 @@ #!/bin/sh -# shellcheck source=testlib.sh -. ./testlib.sh +# shellcheck disable=SC1090 +. "$TESTLIB_PATH" echo [STEP] Skip this test if tools are missing -which nc >/dev/null || exit $EXIT_SKIP_TEST -which timeout >/dev/null || exit $EXIT_SKIP_TEST +command -v nc >/dev/null || exit "$EXIT_SKIP_TEST" +command -v timeout >/dev/null || exit "$EXIT_SKIP_TEST" foo_port=30050 bar_port=30051 # usage: splice protocol_version splice() { - ./splice foo localhost $foo_port bar localhost $bar_port "$1" & + "$SPLICE_PATH" foo localhost $foo_port bar localhost $bar_port "$1" & sleep 10 } @@ -29,7 +29,7 @@ send_with_timeout() { ) | timeout 10 nc localhost $foo_port ) && exit 1 - test $? = $EXIT_TIMEOUT + test $? = "$EXIT_TIMEOUT" if [ -z "$expected" ]; then test -z "$result"