3 # shellcheck disable=SC1090
6 echo [STEP] Skip this test if tools are missing
8 command -v nc >/dev/null || exit "$EXIT_SKIP_TEST"
9 command -v timeout >/dev/null || exit "$EXIT_SKIP_TEST"
14 # usage: splice protocol_version
16 "$SPLICE_PATH" foo localhost $foo_port bar localhost $bar_port "$1" &
20 # usage: send_with_timeout "data to send" "data expected to receive"
29 ) | timeout 10 nc localhost $foo_port
32 test $? = "$EXIT_TIMEOUT"
34 if [ -z "$expected" ]; then
37 echo "$result" | grep -q "^$expected"
41 echo [STEP] Initialize two nodes
63 echo [STEP] Exchange host config files
65 tinc foo export | tinc bar exchange | tinc foo import
67 create_script foo subnet-up
69 wait_script foo subnet-up
71 create_script bar subnet-up
73 wait_script bar subnet-up
75 echo [STEP] No splicing allowed, SPTPS