We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 67d3a6b commit 31789b4Copy full SHA for 31789b4
2 files changed
run-tests.sh
@@ -15,5 +15,6 @@ function runTest() {
15
}
16
17
runTest "simple reply" "test/simple-reply.sh"
18
+runTest "simple answer" "test/simple-answer.sh"
19
20
exit $RESULT
test/simple-answer.sh
@@ -0,0 +1,23 @@
1
+#!/bin/bash
2
+
3
+nc -w 5 -l -p 8811 | md5sum > /tmp/reply-hash &
4
5
+"$1" -hosting "localhost:8800" -forward "localhost:8811" &
6
+proxy=$!
7
8
+sleep 1
9
+dd if=/dev/urandom of=/tmp/answer bs=1M count=1 2>/dev/null
10
+cat /tmp/answer | nc localhost 8800
11
12
+SUM="$(cat /tmp/reply-hash)"
13
+echo -e "Gotten: \t $SUM"
14
+EXPECTED_SUM=$(cat /tmp/answer | md5sum )
+echo -e "Expected: \t $EXPECTED_SUM"
+kill $proxy || true
+if [ "$SUM" = "$EXPECTED_SUM" ]; then
+ exit 0
21
+else
22
+ exit 1
23
+fi
0 commit comments