Command to start the netjail script. More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_testing_lib.h"
#include "testing_api_topology.h"
Go to the source code of this file.
Data Structures | |
struct | NetJailState |
Struct to hold information for callbacks. More... | |
Macros | |
#define | LOG(kind, ...) GNUNET_log (kind, __VA_ARGS__) |
Functions | |
static void | netjail_start_cleanup (void *cls) |
The cleanup function of this cmd frees resources the cmd allocated. More... | |
static void | child_completed_callback (void *cls, enum GNUNET_OS_ProcessStatusType type, unsigned long int exit_code) |
Callback which will be called if the setup script finished. More... | |
static void | netjail_start_run (void *cls, struct GNUNET_TESTING_Interpreter *is) |
The run method starts the script which setup the network namespaces. More... | |
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. More... | |
Command to start the netjail script.
Definition in file testing_api_cmd_netjail_start.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log (kind, __VA_ARGS__) |
Definition at line 31 of file testing_api_cmd_netjail_start.c.
|
static |
The cleanup function of this cmd frees resources the cmd allocated.
Definition at line 69 of file testing_api_cmd_netjail_start.c.
References GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_OK, GNUNET_OS_process_destroy(), GNUNET_OS_process_kill(), GNUNET_OS_process_wait(), GNUNET_wait_child_cancel(), and ns.
Referenced by GNUNET_TESTING_cmd_netjail_setup().
|
static |
Callback which will be called if the setup script finished.
Definition at line 98 of file testing_api_cmd_netjail_start.c.
References exit_code, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_OS_process_destroy(), GNUNET_OS_PROCESS_EXITED, GNUNET_TESTING_async_fail(), GNUNET_TESTING_async_finish(), ns, and type.
Referenced by netjail_start_run().
|
static |
The run method starts the script which setup the network namespaces.
cls | closure. |
is | interpreter state. |
Definition at line 127 of file testing_api_cmd_netjail_start.c.
References child_completed_callback(), GNUNET_asprintf(), GNUNET_break, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_NO, GNUNET_OK, GNUNET_OS_check_helper_binary(), GNUNET_OS_INHERIT_STD_ERR, GNUNET_OS_installation_get_path(), GNUNET_OS_IPK_DATADIR, GNUNET_OS_project_data_gnunet(), GNUNET_OS_start_process_vap(), GNUNET_snprintf(), GNUNET_SYSERR, GNUNET_TESTING_FAIL, GNUNET_TESTING_interpreter_lookup_command(), GNUNET_TESTING_interpreter_skip(), GNUNET_wait_child(), is, ns, and pid.
Referenced by GNUNET_TESTING_cmd_netjail_setup().
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.
label | name for command. |
script | which script to run, e.g. GNUNET_TESTING_NETJAIL_START_SCRIPT |
topology_config | Configuration file for the test topology. |
read_file | Flag indicating if the the name of the topology file is send to the helper, or a string with the topology data. |
Definition at line 207 of file testing_api_cmd_netjail_start.c.
References GNUNET_new, GNUNET_TESTING_command_new_ac(), netjail_start_cleanup(), netjail_start_run(), ns, NetJailState::script, and NetJailState::topology_cmd_label.
Referenced by main().