X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=test%2Fsecurity.test;h=fb783b06fb0949e554e706b6e009b11cf81d4688;hb=df716df33af8e9a5b93d573a023ecd7fc24d9a03;hp=6c15bdab30126908b75de83e89086cf0ca0ad7a2;hpb=9ca716d6270335cf44455fc1667a1647c19410ef;p=tinc diff --git a/test/security.test b/test/security.test index 6c15bdab..fb783b06 100755 --- a/test/security.test +++ b/test/security.test @@ -1,103 +1,129 @@ #!/bin/sh -. "${0%/*}/testlib.sh" +# shellcheck disable=SC1090 +. "$TESTLIB_PATH" -# Skip this test if tools are missing +echo [STEP] Skip this test if tools are missing -which nc >/dev/null || exit 77 +command -v nc >/dev/null || exit "$EXIT_SKIP_TEST" +command -v timeout >/dev/null || exit "$EXIT_SKIP_TEST" -if [ "$(uname)" = "Darwin" ]; then - alias timeout=gtimeout -fi +foo_port=30050 +bar_port=30051 -which timeout >/dev/null || exit 77 +# usage: splice protocol_version +splice() { + "$SPLICE_PATH" foo localhost $foo_port bar localhost $bar_port "$1" & + sleep 10 +} -# Initialize two nodes +# usage: send_with_timeout "data to send" "data expected to receive" +send_with_timeout() { + data=$1 + expected=$3 -$tinc $c1 <