GNUnet 0.22.2
gnunet_testing_testbed_lib.h File Reference
Include dependency graph for gnunet_testing_testbed_lib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GNUNET_TESTING_TESTBED_SIMPLE_TRAITS(op, prefix)    op (prefix, test_system, struct GNUNET_TESTBED_System)
 Call op on all simple traits. More...
 

Functions

struct GNUNET_TESTING_Command GNUNET_TESTBED_cmd_system_destroy (const char *label, const char *create_label)
 This command destroys the resources allocated for the test system setup. More...
 
struct GNUNET_TESTING_Command GNUNET_TESTBED_cmd_system_create (const char *label, const char *my_node_id)
 This command is setting up a test environment for a peer to start. More...
 
enum GNUNET_GenericReturnValue GNUNET_TESTING_TESTBED_get_trait_test_system (const struct GNUNET_TESTING_Command *cmd, struct GNUNET_TESTBED_System **ret)
 
struct GNUNET_TESTING_Trait GNUNET_TESTING_TESTBED_make_trait_test_system (struct GNUNET_TESTBED_System *value)
 

Macro Definition Documentation

◆ GNUNET_TESTING_TESTBED_SIMPLE_TRAITS

#define GNUNET_TESTING_TESTBED_SIMPLE_TRAITS (   op,
  prefix 
)     op (prefix, test_system, struct GNUNET_TESTBED_System)

Call op on all simple traits.

Definition at line 35 of file gnunet_testing_testbed_lib.h.

Function Documentation

◆ GNUNET_TESTBED_cmd_system_destroy()

struct GNUNET_TESTING_Command GNUNET_TESTBED_cmd_system_destroy ( const char *  label,
const char *  create_label 
)

This command destroys the resources allocated for the test system setup.

Parameters
labelName for command.
create_labelLabel of the cmd which started the test system.
write_messageCallback to write messages to the master loop.
Returns
command.

◆ GNUNET_TESTBED_cmd_system_create()

struct GNUNET_TESTING_Command GNUNET_TESTBED_cmd_system_create ( const char *  label,
const char *  my_node_id 
)

This command is setting up a test environment for a peer to start.

Parameters
labelName for command.
my_node_idThe specific id of the node this command is running on. A sub string of the id is the process id of the master process. This id is used to build the name of the temporary directory of the peer to start.

Definition at line 111 of file testbed_api_cmd_system_create.c.

113{
114 struct TestSystemState *tss;
115
116 tss = GNUNET_new (struct TestSystemState);
118 "%s%s",
119 BASE_DIR,
120 my_node_id);
121
122 return GNUNET_TESTING_command_new (tss,
123 label,
127}
static const char * my_node_id
#define GNUNET_TESTING_command_new(cls, label, run, cleanup, traits)
Create a new command.
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
Struct to hold information for callbacks.
static void system_create_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
The run method of this cmd will setup a test environment for a node.
#define BASE_DIR
static int system_create_traits(void *cls, const void **ret, const char *trait, unsigned int index)
This function prepares an array with traits.
static void system_create_cleanup(void *cls)
The cleanup function of this cmd frees resources the cmd allocated.

References BASE_DIR, GNUNET_asprintf(), GNUNET_new, GNUNET_TESTING_command_new, my_node_id, system_create_cleanup(), system_create_run(), system_create_traits(), and TestSystemState::testdir.

Here is the call graph for this function:

◆ GNUNET_TESTING_TESTBED_get_trait_test_system()

enum GNUNET_GenericReturnValue GNUNET_TESTING_TESTBED_get_trait_test_system ( const struct GNUNET_TESTING_Command cmd,
struct GNUNET_TESTBED_System **  ret 
)

Referenced by start_peer_run().

Here is the caller graph for this function:

◆ GNUNET_TESTING_TESTBED_make_trait_test_system()

struct GNUNET_TESTING_Trait GNUNET_TESTING_TESTBED_make_trait_test_system ( struct GNUNET_TESTBED_System value)

Referenced by system_create_traits().

Here is the caller graph for this function: