diff options
author | Christian Pointner <equinox@spreadspace.org> | 2017-05-06 17:47:04 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2017-05-06 17:47:04 +0200 |
commit | 30fd02cc084d08fdc56acff85b00392d194e78c4 (patch) | |
tree | 3c00aebc4566c9563de32e5f69f3096d810b501b /src | |
parent | remove get sources/:id web api point (diff) |
revamp test client handling
Diffstat (limited to 'src')
-rwxr-xr-x | src/hub/test-client | 53 |
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' |