diff options
Diffstat (limited to 'doc/codelab/wiki/test.sh')
| -rwxr-xr-x | doc/codelab/wiki/test.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/codelab/wiki/test.sh b/doc/codelab/wiki/test.sh new file mode 100755 index 000000000..5b752fe3c --- /dev/null +++ b/doc/codelab/wiki/test.sh @@ -0,0 +1,24 @@ +#1/bin/bash + +./final.bin & +wiki_pid=$! + +cleanup() { + kill $wiki_pid + rm -f test_*.out Test.txt + exit ${1:-1} +} +trap cleanup INT + +sleep 1 + +curl -s -o test_edit.out http://localhost:8080/edit/Test +cmp test_edit.out test_edit.good || cleanup 1 +curl -s -o /dev/null -d body=some%20content http://localhost:8080/save/Test +cmp Test.txt test_Test.txt.good || cleanup 1 +curl -s -o test_view.out http://localhost:8080/view/Test +cmp test_view.out test_view.good || cleanup 1 + +echo "Passed" +cleanup 0 + |
