2013-08-31 22:39:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
. ./testlib.sh
|
|
|
|
|
2017-04-17 11:54:02 +00:00
|
|
|
# Skip this test if we did not compile sptps_test
|
|
|
|
|
|
|
|
test -e $sptps_test || exit 77
|
|
|
|
|
2013-08-31 22:39:14 +00:00
|
|
|
# Generate keys
|
|
|
|
|
|
|
|
mkdir -p $d1
|
|
|
|
|
2014-04-06 20:47:26 +00:00
|
|
|
$sptps_keypair $d1/server.priv $d1/server.pub
|
|
|
|
$sptps_keypair $d1/client.priv $d1/client.pub
|
2013-08-31 22:39:14 +00:00
|
|
|
|
|
|
|
# Test transfer of a simple file.
|
|
|
|
|
2013-09-01 14:02:49 +00:00
|
|
|
(sleep 1; $sptps_test -q $d1/client.priv $d1/server.pub localhost 32750 <../README) &
|
|
|
|
$sptps_test $d1/server.priv $d1/client.pub 32750 >$d1/out1
|
|
|
|
cmp $d1/out1 ../README
|
|
|
|
|
|
|
|
$sptps_test -q $d1/server.priv $d1/client.pub 32750 <../NEWS &
|
|
|
|
sleep 1
|
|
|
|
$sptps_test $d1/client.priv $d1/server.pub localhost 32750 > $d1/out2
|
|
|
|
cmp $d1/out2 ../NEWS
|
|
|
|
|
|
|
|
# Datagram mode
|
|
|
|
|
|
|
|
$sptps_test -dq $d1/server.priv $d1/client.pub 32750 <../COPYING &
|
2013-08-31 22:39:14 +00:00
|
|
|
sleep 1
|
2013-09-01 14:02:49 +00:00
|
|
|
sleep 1 | $sptps_test -dq $d1/client.priv $d1/server.pub localhost 32750 >$d1/out3
|
|
|
|
cmp $d1/out3 ../COPYING
|