summaryrefslogtreecommitdiff
path: root/src/hub/test-client
diff options
context:
space:
mode:
Diffstat (limited to 'src/hub/test-client')
-rwxr-xr-xsrc/hub/test-client53
1 files changed, 29 insertions, 24 deletions
diff --git a/src/hub/test-client b/src/hub/test-client
index 612e576..5858969 100755
--- a/src/hub/test-client
+++ b/src/hub/test-client
@@ -2,29 +2,34 @@
TEST_D="./test"
-echo "pipe: import sample.json"
-echo "------------------------"
-socat file:../../dat/sample.json,rdonly "unix-client:$TEST_D/pipe"
-echo ""
-
-echo "pipe-gram: import sample-gram.json"
-echo "----------------------------------"
-while read x; do echo "$x" | socat stdio "unix-sendto:$TEST_D/pipegram"; done < ../../dat/sample-gram.json
-echo ""
+case $1 in
+ pipe)
+ echo "pipe: send sample-pipe.json"
+ echo "---------------------------"
+ time socat file:../../dat/sample-pipe.json,rdonly "unix-client:$TEST_D/pipe"
+ echo ""
+ ;;
+ pipegram)
+ echo "pipe-gram: send sample-pipegram.json"
+ echo "------------------------------------"
+ time $(while read x; do echo "$x" | socat stdio "unix-sendto:$TEST_D/pipegram"; done < ../../dat/sample-pipegram.json)
+ echo ""
+ ;;
+ web)
+ echo "web: post sample-web.json"
+ echo "-------------------------"
+ time curl 'http://localhost:8000/updates' -d @../../dat/sample-web.json
+ echo ""
+ ;;
+ web-bulk)
+ echo "web: post sample-web-bulk.json"
+ echo "------------------------------"
+ time curl 'http://localhost:8000/updates?bulk=1' -d @../../dat/sample-web-bulk.json
+ echo ""
+ ;;
+esac
-echo "post update"
-echo "-----------"
-curl -i --data @../../dat/sample-post.json 'http://localhost:8000/updates'
-echo -e "\n"
-
-echo "post update (bulk)"
-echo "------------------"
-curl -i --data @../../dat/sample-post-bulk.json 'http://localhost:8000/updates?bulk=1'
-echo -e "\n"
-
-echo "show query result"
-echo "-----------------"
-curl -i 'http://localhost:8000/updates'
+echo "store contents:"
+echo "---------------"
+curl 'http://localhost:8000/updates' | jq .
echo ""
-
-echo '\n\ndone'