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
49 set ExperimentalProtocol no
60 set ExperimentalProtocol no
65 echo [STEP] Exchange host config files
67 tinc foo export | tinc bar exchange | tinc foo import
69 create_script foo subnet-up
71 wait_script foo subnet-up
73 create_script bar subnet-up
75 wait_script bar subnet-up
77 echo [STEP] No splicing allowed, legacy protocol