twister

HTTP fault injector for testing
Log | Files | Refs | README | LICENSE

commit d174a733b719570fd7853066a3140222ee303c25
parent c60febea54c06fa9c867fdd602c8f16ce488d155
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date:   Sat, 20 Jan 2018 18:47:52 +0100

test whether status code has been hacked

Diffstat:
Msrc/test/test_twister.sh | 23++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/src/test/test_twister.sh b/src/test/test_twister.sh @@ -2,28 +2,29 @@ # Steps: -# 1) Launch the Web server. +# Launch the Web server. ./test_twister_webserver & web_server_pid=$! -# 2) Launch the Twister. - +# Launch the Twister. taler-twister-service -c ./test_twister.conf & twister_service_pid=$! -# 3) Use the Twister-APIs via the C-L tool. +# Use the Twister-APIs to hack the response code. +taler-twister -c ./test_twister.conf --responsecode 202 # 4) Use curl to GET /something status_code=$(curl -s http://localhost:8888/ -o /dev/null \ -w "%{http_code}") - -echo $status_code - -# 5) Check the HTTP status code is the hacked! - - # shutdown twister and webserver - kill $web_server_pid kill $twister_service_pid + +# check status code has been hacked +if ! test 202 = $status_code; then + echo "Response code has not been hacked." + exit 1 +fi + +exit 0