twister

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

commit 541a089170ab9b314d2f9f5fe5702256bb1226cb
parent 8b54aae6840736c37e0bde592c0db30ac2589fa5
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri, 14 Sep 2018 14:46:09 +0200

focus code more on the API

Diffstat:
Mpresentation/twister.tex | 48++++++++++++++++--------------------------------
1 file changed, 16 insertions(+), 32 deletions(-)

diff --git a/presentation/twister.tex b/presentation/twister.tex @@ -4,7 +4,7 @@ \usepackage{calc} \usepackage[utf8]{inputenc} % set your input encoding differently, if you want \usepackage[english]{babel} - +\usepackage{listings} \usepackage{wrapfig} \usepackage{fancyvrb} \usepackage{enumitem} @@ -142,37 +142,21 @@ \includegraphics[scale=0.09]{Whole-NoClientServer.png} \end{textblock*} - \begin{Verbatim}[fontsize=\tiny] - #include <taler/taler_twister_service.h> - #define CONFIG "twister.conf" - - struct GNUNET_OS_Process *twisterd; - struct TALER_TWISTER_Handle *handle; - static void - callback (void *cls) - { - fprintf (stderr, "Command received\n"); - } - - /* 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} +{\tiny +\begin{lstlisting}[language=C,basicstyle=\footnotesize,keywordstyle=\color{blue}] +#include <taler/taler_twister_service.h> + +handle = TALER_TWISTER_connect (CONFIG); + +/* Issue char-flipping command */ +TALER_TWISTER_flip_upload (handle, + "child.one", + &callback, + NULL); +// ... +TALER_TWISTER_disconnect (handle); +\end{lstlisting} +} \end{frame} \end{document}