twister

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

commit 8b54aae6840736c37e0bde592c0db30ac2589fa5
parent 3b28f5888b7144c15e7a8f595329760fcef38386
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date:   Thu, 13 Sep 2018 09:33:20 +0200

Explaining Libtalertwister.

Make the slide NOT depend on the Taler interpreter for tests.

Diffstat:
Mpresentation/twister.tex | 49+++++++++++++++++++++++--------------------------
1 file changed, 23 insertions(+), 26 deletions(-)

diff --git a/presentation/twister.tex b/presentation/twister.tex @@ -143,38 +143,35 @@ \end{textblock*} \begin{Verbatim}[fontsize=\tiny] - #include <taler/taler_testing_lib.h> - #include <taler/taler_twister_testing_lib.h> #include <taler/taler_twister_service.h> + #define CONFIG "twister.conf" - const char *proxied_url; struct GNUNET_OS_Process *twisterd; - - void - run (void *cls, - struct TALER_TESTING_Interpreter *is) + struct TALER_TWISTER_Handle *handle; + static void + callback (void *cls) { - struct TALER_TESTING_Command commands[] = { - TALER_TESTING_cmd_flip_upload ("cmd-name", - "test.conf", - "child.one"), - /* Will test the flipped field. */ - TALER_TESTING_cmd_x ("name-x", - ..), - TALER_TESTING_cmd_end () - }; + fprintf (stderr, "Command received\n"); } - int - main () - { - /* Checks ports are available, extract proxied URL. */ - proxied_url = TALER_TESTING_prepare_twister ("twister.conf"); - twisterd = TALER_TESTING_run_twister ("twister.conf"); - - return TALER_TESTING_setup (&run, - "test.conf"); - } + /* Start the Twister and connect to it */ + TALER_TESTING_prepare_twister (CONFIG); + twisterd = TALER_TESTING_run_twister (CONFIG); + handle = TALER_TWISTER_connect (CONFIG); + + /* Issue char-flipping command */ + TALER_TWISTER_flip_upload (handle, + "child.one", + callback, + NULL); + /* Next HTTP POST will get its "child.one" string + * field randomly flipped in one random char. */ + sleep (10); + + TALER_TWISTER_disconnect (handle); + GNUNET_OS_kill (twisterd, SIGINT); + GNUNET_OS_wait (twisterd); + GNUNET_OS_destroy (twisterd); \end{Verbatim} \end{frame}