GNUnet 0.22.2
gnunet-testing-netjail-launcher.c File Reference

Generic program to start testcases in an configurable topology. More...

#include "platform.h"
#include "gnunet_testing_lib.h"
#include "gnunet_util_lib.h"
Include dependency graph for gnunet-testing-netjail-launcher.c:

Go to the source code of this file.

Macros

#define TIMEOUT   GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 600)
 

Functions

int main (int argc, char *const *argv)
 

Detailed Description

Generic program to start testcases in an configurable topology.

Author
t3sserakt

Definition in file gnunet-testing-netjail-launcher.c.

Macro Definition Documentation

◆ TIMEOUT

Definition at line 30 of file gnunet-testing-netjail-launcher.c.

Function Documentation

◆ main()

int main ( int  argc,
char *const *  argv 
)

Definition at line 33 of file gnunet-testing-netjail-launcher.c.

35{
36 char *filename = NULL;
37 char *topology_data = NULL;
38
39 GNUNET_log_setup ("test-netjail",
40 "INFO",
41 NULL);
42 if (NULL == argv[1])
43 {
44 GNUNET_break (0);
45 return EXIT_FAILURE;
46 }
47 if (0 == strcmp ("-s", argv[1]))
48 {
49 topology_data = argv[2];
50 if (NULL == topology_data)
51 {
52 GNUNET_break (0);
53 return EXIT_FAILURE;
54 }
55 }
56 else
57 {
58 filename = argv[1];
59 }
60 {
62 NULL == filename
64 "load-topology",
65 topology_data)
67 "load-topology",
68 filename),
69#if FUTURE
70 GNUNET_TESTING_cmd_barrier_create ("peers-started-barrier",
71 NUM_PEERS),
72#endif
75 "netjail-start",
77 "load-topology")),
78 GNUNET_TESTING_cmd_finish ("wait-netjail-start",
79 "netjail-start",
82 "netjail-start-testbed",
83 "load-topology",
84 TIMEOUT),
86 };
87
89 TIMEOUT);
90 }
91}
static struct VoipCommand commands[]
List of supported commands.
static char * filename
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_netjail_start_helpers(const char *label, const char *topology_cmd_label, struct GNUNET_TIME_Relative timeout)
Create command.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_barrier_create(const char *label, unsigned int number_to_be_reached)
Command to create a barrier.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_netjail_setup(const char *label, const char *script, const char *topology_cmd_label)
This command executes a shell script to setup the netjail environment.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_load_topology_from_string(const char *label, const char *topology_data)
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_load_topology_from_file(const char *label, const char *filename)
#define GNUNET_TESTING_NETJAIL_START_SCRIPT
const struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_finish(const char *finish_label, const char *cmd_ref, struct GNUNET_TIME_Relative timeout)
Create (synchronous) command that waits for another command to finish.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_make_unblocking(struct GNUNET_TESTING_Command cmd)
Turn asynchronous command into non-blocking command by setting asynchronous_finish to true.
int GNUNET_TESTING_main(const struct GNUNET_TESTING_Command *commands, struct GNUNET_TIME_Relative timeout)
Start a GNUnet scheduler event loop and run the testsuite.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_end(void)
Create command array terminator.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
enum GNUNET_GenericReturnValue GNUNET_log_setup(const char *comp, const char *loglevel, const char *logfile)
Setup logging.
#define GNUNET_TIME_UNIT_SECONDS
One second.
A command to be run by the interpreter.
#define NUM_PEERS
Definition: testbed_test.c:8

References commands, filename, GNUNET_break, GNUNET_log_setup(), GNUNET_TESTING_cmd_barrier_create(), GNUNET_TESTING_cmd_end(), GNUNET_TESTING_cmd_finish(), GNUNET_TESTING_cmd_load_topology_from_file(), GNUNET_TESTING_cmd_load_topology_from_string(), GNUNET_TESTING_cmd_make_unblocking(), GNUNET_TESTING_cmd_netjail_setup(), GNUNET_TESTING_cmd_netjail_start_helpers(), GNUNET_TESTING_main(), GNUNET_TESTING_NETJAIL_START_SCRIPT, GNUNET_TIME_UNIT_SECONDS, NUM_PEERS, and TIMEOUT.

Here is the call graph for this function: