5 echo [STEP] Skip this test if we did not compile sptps_test
7 test -e "$SPTPS_TEST" -a -e "$SPTPS_KEYPAIR" || exit $EXIT_SKIP_TEST
11 server_priv="$DIR_FOO/server.priv"
12 client_priv="$DIR_FOO/client.priv"
13 server_pub="$DIR_FOO/server.pub"
14 client_pub="$DIR_FOO/client.pub"
16 echo [STEP] Generate keys
19 $SPTPS_KEYPAIR "$server_priv" "$server_pub"
20 $SPTPS_KEYPAIR "$client_priv" "$client_pub"
22 echo [STEP] Test transfer of a simple file
28 $SPTPS_TEST -4 -q "$client_priv" "$server_pub" localhost $port <"$reference"
31 $SPTPS_TEST -4 "$server_priv" "$client_pub" $port >"$DIR_FOO/out1"
32 diff -w "$DIR_FOO/out1" "$reference"
34 $SPTPS_TEST -4 -q "$server_priv" "$client_pub" $port <"$reference" &
36 $SPTPS_TEST -4 "$client_priv" "$server_pub" localhost $port >"$DIR_FOO/out2"
37 diff -w "$DIR_FOO/out2" "$reference"
39 echo [STEP] Datagram mode
41 $SPTPS_TEST -4 -dq "$server_priv" "$client_pub" $port <"$reference" &
43 sleep 3 | $SPTPS_TEST -4 -dq "$client_priv" "$server_pub" localhost $port >"$DIR_FOO/out3"
44 diff -w "$DIR_FOO/out3" "$reference"