X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=test%2Fsecurity.test;h=fb783b06fb0949e554e706b6e009b11cf81d4688;hb=df716df33af8e9a5b93d573a023ecd7fc24d9a03;hp=91a5da522e88d8a5620abe08137591a06bc0348a;hpb=046a10d692d1ac22de4daf783ee4fe025c4eb6ec;p=tinc diff --git a/test/security.test b/test/security.test index 91a5da52..fb783b06 100755 --- a/test/security.test +++ b/test/security.test @@ -1,19 +1,19 @@ #!/bin/sh -# shellcheck source=testlib.sh -. "${0%/*}/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"