twister

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

commit ffc03728ebfcd0235332c52872ef40fe0b81acfc
parent 70b4d26fad5be9137e9938998c5e2ef450021aed
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date:   Sat, 20 Jan 2018 17:58:20 +0100

test script draft

Diffstat:
Msrc/test/Makefile.am | 2+-
Msrc/test/test_twister | 19++++++++++++++++++-
Msrc/test/test_twister_webserver.c | 2+-
3 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/src/test/Makefile.am b/src/test/Makefile.am @@ -1,4 +1,4 @@ -bin_PROGRAMS = \ +check_PROGRAMS = \ test_twister_webserver test_twister_webserver_SOURCES = \ diff --git a/src/test/test_twister b/src/test/test_twister @@ -1,3 +1,20 @@ #!/bin/bash -echo "Test undong!" +# Steps: + +# 1) Launch the Web server. + +./test_twister_webserver & + +# 2) Launch the Twister. +# 3) Use the Twister-APIs via the C-L tool. + +# 4) Use curl to GET /something + +status_code=$(curl -s http://localhost:8080/ -o /dev/null \ + -w "%{http_code}") + + +echo $status_code + +# 5) Check the HTTP status code is the hacked! diff --git a/src/test/test_twister_webserver.c b/src/test/test_twister_webserver.c @@ -34,7 +34,7 @@ #include <microhttpd.h> #include <stdio.h> -#define PORT 8888 +#define PORT 8080 static int answer_to_connection (void *cls, struct MHD_Connection *connection,