summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2019-06-03 20:01:37 +0200
committerMarcello Stanisci <stanisci.m@gmail.com>2019-06-03 20:01:37 +0200
commitcecc7bb3c76c909988e098dde86b822112196b21 (patch)
tree11df284d0b4f82c6083824deee5f863670e6680e
parentf2f71e19a9b45b0d32d9233110b6b0d00a1cfb7a (diff)
downloadtwister-cecc7bb3c76c909988e098dde86b822112196b21.tar.gz
twister-cecc7bb3c76c909988e098dde86b822112196b21.tar.bz2
twister-cecc7bb3c76c909988e098dde86b822112196b21.zip
Tests for 5724.
Adding a PUT and POST test case with a fair big JSON.
-rwxr-xr-xsrc/test/test_twister.sh34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/test/test_twister.sh b/src/test/test_twister.sh
index 14b15ca..55962fd 100755
--- a/src/test/test_twister.sh
+++ b/src/test/test_twister.sh
@@ -144,7 +144,7 @@ if ! test '{"hello":"world"}' = $cum_mods; then
exit 1
fi
-# check if Twister does compression.
+# check if Twister decompresses.
status_code=$(curl \
-s "${TWISTER_URL}deflate-test" \
-o /dev/null \
@@ -161,6 +161,38 @@ if ! test 200 = $status_code; then
exit 1
fi
+
+# Just upload a big blob; first with PUT then with POST.
+printf "{\"things\": \"%s\"}" \
+ $(for i in $(seq 1 100000); do
+ echo -n z; done) > BIGBLOB.json
+
+status_code=$(curl \
+ -s "${TWISTER_URL}BIGPUT" \
+ -o /dev/null \
+ -X PUT \
+ -H "Content-Type: application/json" \
+ -d@BIGBLOB.json \
+ -w "%{http_code}")
+
+status_code=$(curl \
+ -s "${TWISTER_URL}BIGPOST" \
+ -o /dev/null \
+ -X POST \
+ -H "Content-Type: application/json" \
+ -d@BIGBLOB.json \
+ -w "%{http_code}")
+
+rm BIGBLOB.json
+
+## check status code is okay.
+if ! test 200 = $status_code; then
+ echo "PUTting big blob failed (status == ${status_code})."
+ kill $web_server_pid
+ kill $twister_service_pid
+ exit 1
+fi
+
# shutdown twister and webserver
kill $web_server_pid
kill $twister_service_pid