tinc/test/sptps-basic.test
2019-08-26 13:44:52 +02:00

32 lines
818 B
Bash
Executable file

#!/bin/sh
. ./testlib.sh
# Skip this test if we did not compile sptps_test
test -e $sptps_test || exit 77
# Generate keys
mkdir -p $d1
$sptps_keypair $d1/server.priv $d1/server.pub
$sptps_keypair $d1/client.priv $d1/client.pub
# Test transfer of a simple file.
(sleep 1; $sptps_test -4 -q $d1/client.priv $d1/server.pub localhost 32750 <../README) &
$sptps_test -4 $d1/server.priv $d1/client.pub 32750 >$d1/out1
cmp $d1/out1 ../README
$sptps_test -4 -q $d1/server.priv $d1/client.pub 32750 <../NEWS &
sleep 1
$sptps_test -4 $d1/client.priv $d1/server.pub localhost 32750 > $d1/out2
cmp $d1/out2 ../NEWS
# Datagram mode
$sptps_test -4 -dq $d1/server.priv $d1/client.pub 32750 <../COPYING &
sleep 1
sleep 1 | $sptps_test -4 -dq $d1/client.priv $d1/server.pub localhost 32750 >$d1/out3
cmp $d1/out3 ../COPYING