From: Guus Sliepen Date: Sun, 1 Sep 2013 19:06:25 +0000 (+0200) Subject: Small fixes for tests. X-Git-Tag: release-1.1pre9~17 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2cd8e2b8e8d60fdeb633afe54eaf38e18afb04dc;p=oweals%2Ftinc.git Small fixes for tests. --- diff --git a/test/Makefile.am b/test/Makefile.am index 69042ac..e2462df 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,7 +1,7 @@ TESTS = \ - executables.test \ basic.test \ - sptps_basic.test + executables.test \ + sptps-basic.test EXTRA_DIST = testlib.sh diff --git a/test/basic.test b/test/basic.test index 1277fb0..b181e75 100755 --- a/test/basic.test +++ b/test/basic.test @@ -4,8 +4,6 @@ # Initialize and test one node -rm -rf config1 - $tinc $c1 init foo $tinc $c1 set DeviceType dummy $tinc $c1 set Port 0 diff --git a/test/sptps-basic.test b/test/sptps-basic.test new file mode 100755 index 0000000..2abb99c --- /dev/null +++ b/test/sptps-basic.test @@ -0,0 +1,32 @@ +#!/bin/sh + +. ./testlib.sh + +# Generate keys + +mkdir -p $d1 + +openssl ecparam -genkey -name secp521r1 -noout -out $d1/server.priv +openssl ecparam -genkey -name secp521r1 -noout -out $d1/client.priv +yes '' | openssl req -new -pubkey -key $d1/server.priv -noout -out $d1/server.pub +echo +yes '' | openssl req -new -pubkey -key $d1/client.priv -noout -out $d1/client.pub +echo + +# Test transfer of a simple file. + +(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 & +sleep 1 +sleep 1 | $sptps_test -dq $d1/client.priv $d1/server.pub localhost 32750 >$d1/out3 +cmp $d1/out3 ../COPYING diff --git a/test/sptps_basic.test b/test/sptps_basic.test deleted file mode 100755 index 2abb99c..0000000 --- a/test/sptps_basic.test +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -. ./testlib.sh - -# Generate keys - -mkdir -p $d1 - -openssl ecparam -genkey -name secp521r1 -noout -out $d1/server.priv -openssl ecparam -genkey -name secp521r1 -noout -out $d1/client.priv -yes '' | openssl req -new -pubkey -key $d1/server.priv -noout -out $d1/server.pub -echo -yes '' | openssl req -new -pubkey -key $d1/client.priv -noout -out $d1/client.pub -echo - -# Test transfer of a simple file. - -(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 & -sleep 1 -sleep 1 | $sptps_test -dq $d1/client.priv $d1/server.pub localhost 32750 >$d1/out3 -cmp $d1/out3 ../COPYING