sptps-basic.test 717 B

12345678910111213141516171819202122232425262728
  1. #!/bin/sh
  2. . ./testlib.sh
  3. # Generate keys
  4. mkdir -p $d1
  5. $sptps_keypair $d1/server.priv $d1/server.pub
  6. $sptps_keypair $d1/client.priv $d1/client.pub
  7. # Test transfer of a simple file.
  8. (sleep 1; $sptps_test -q $d1/client.priv $d1/server.pub localhost 32750 <../README) &
  9. $sptps_test $d1/server.priv $d1/client.pub 32750 >$d1/out1
  10. cmp $d1/out1 ../README
  11. $sptps_test -q $d1/server.priv $d1/client.pub 32750 <../NEWS &
  12. sleep 1
  13. $sptps_test $d1/client.priv $d1/server.pub localhost 32750 > $d1/out2
  14. cmp $d1/out2 ../NEWS
  15. # Datagram mode
  16. $sptps_test -dq $d1/server.priv $d1/client.pub 32750 <../COPYING &
  17. sleep 1
  18. sleep 1 | $sptps_test -dq $d1/client.priv $d1/server.pub localhost 32750 >$d1/out3
  19. cmp $d1/out3 ../COPYING