]> git.meshlink.io Git - utcp/commitdiff
Add scripts testing filetransfer.
authorGuus Sliepen <guus@meshlink.io>
Sun, 11 Oct 2015 15:11:13 +0000 (17:11 +0200)
committerGuus Sliepen <guus@sliepen.org>
Sun, 2 Jul 2017 09:55:52 +0000 (11:55 +0200)
- txttest transfers a file into one direction.
- bidirtest transfers a file both ways simultaneously.

bidirtest [new file with mode: 0755]
txtest [new file with mode: 0755]

diff --git a/bidirtest b/bidirtest
new file mode 100755 (executable)
index 0000000..09c0d94
--- /dev/null
+++ b/bidirtest
@@ -0,0 +1,8 @@
+#!/bin/sh
+[ -f bidirtest-data ] || head -c 10000 /dev/urandom >bidirtest-data
+rm -f bidirtest-copy-client bidirtest-copy-server
+./test 9999 <bidirtest-data >bidirtest-copy-server 2>bidirtest-server.log &
+./test localhost 9999 <bidirtest-data >bidirtest-copy-client 2>bidirtest-client.log
+wait
+cmp bidirtest-data bidirtest-copy-server
+cmp bidirtest-data bidirtest-copy-client
diff --git a/txtest b/txtest
new file mode 100755 (executable)
index 0000000..150945e
--- /dev/null
+++ b/txtest
@@ -0,0 +1,7 @@
+#!/bin/sh
+[ -f txtest-data ] || head -c 100000 /dev/urandom >txtest-data
+rm -f txtest-copy
+./test 9999 >txtest-copy 2>txtest-server.log &
+./test localhost 9999 2>txtest-client.log <txtest-data
+wait
+cmp txtest-data txtest-copy