diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2018-09-13 09:33:20 +0200 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2018-09-13 09:33:20 +0200 |
commit | 8b54aae6840736c37e0bde592c0db30ac2589fa5 (patch) | |
tree | 701b3c95ca41013c20f3bb14e9b25c7484448fbd /presentation | |
parent | 3b28f5888b7144c15e7a8f595329760fcef38386 (diff) | |
download | twister-8b54aae6840736c37e0bde592c0db30ac2589fa5.tar.gz twister-8b54aae6840736c37e0bde592c0db30ac2589fa5.tar.bz2 twister-8b54aae6840736c37e0bde592c0db30ac2589fa5.zip |
Explaining Libtalertwister.
Make the slide NOT depend on the Taler interpreter for tests.
Diffstat (limited to 'presentation')
-rw-r--r-- | presentation/twister.tex | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/presentation/twister.tex b/presentation/twister.tex index 7b973d8..9fc0f8b 100644 --- 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} |