X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=test%2Fsecurity.test;h=ee7bd46dd30af7b2e79da393be738ea5c05369a6;hb=bf7abd5a059d27dc544b435b67f7f1d5419d318b;hp=6c15bdab30126908b75de83e89086cf0ca0ad7a2;hpb=9ca716d6270335cf44455fc1667a1647c19410ef;p=tinc diff --git a/test/security.test b/test/security.test index 6c15bdab..ee7bd46d 100755 --- a/test/security.test +++ b/test/security.test @@ -1,103 +1,128 @@ #!/bin/sh -. "${0%/*}/testlib.sh" +. ./testlib.sh -# 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 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 <