summaryrefslogtreecommitdiff
path: root/src/hub/test-client
blob: 612e576031c31744d1a18bb49c12ba26eebf2795 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash

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 ""

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 ""

echo '\n\ndone'