GNUnet 0.22.1
gnunet_testing_arm_lib.h File Reference
Include dependency graph for gnunet_testing_arm_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_ARM_SIMPLE_TRAITS(op, prefix)
 Call op on all simple traits. More...
 

Functions

struct GNUNET_TESTING_Command GNUNET_TESTING_ARM_cmd_start_peer (const char *label, const char *system_label, const char *cfgname)
 Create command. More...
 
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_stop_peer (const char *label, const char *start_label)
 Create command. More...
 
 GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT (GNUNET_TESTING_ARM, arm_handle, struct GNUNET_ARM_Handle) GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT(GNUNET_TESTING_ARM
 

Variables

 config
 

Macro Definition Documentation

◆ GNUNET_TESTING_ARM_SIMPLE_TRAITS

#define GNUNET_TESTING_ARM_SIMPLE_TRAITS (   op,
  prefix 
)
Value:
op (prefix, \
arm_handle, \
op (prefix, \
config, \
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:143
static int prefix
If printing the value of PREFIX has been requested.
Definition: gnunet-config.c:66
Handle for interacting with ARM.
Definition: arm_api.c:103

Call op on all simple traits.

Definition at line 37 of file gnunet_testing_arm_lib.h.

Function Documentation

◆ GNUNET_TESTING_ARM_cmd_start_peer()

struct GNUNET_TESTING_Command GNUNET_TESTING_ARM_cmd_start_peer ( const char *  label,
const char *  system_label,
const char *  cfgname 
)

Create command.

Parameters
labelname for command.
system_labelLabel of the cmd to setup a test environment.
cfgnameConfiguration file name for this peer.
Returns
command.

Definition at line 284 of file testing_arm_cmd_start_peer.c.

288{
290
293 sps->cfgname = cfgname;
295 label,
299 &sps->ac);
300}
struct GNUNET_TESTING_Command GNUNET_TESTING_command_new_ac(void *cls, const char *label, GNUNET_TESTING_CommandRunRoutine run, GNUNET_TESTING_CommandCleanupRoutine cleanup, GNUNET_TESTING_CommandGetTraits traits, struct GNUNET_TESTING_AsyncContext *ac)
Create a new command that may be asynchronous.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
Handle for a peer controlled via ARM.
struct GNUNET_TESTING_AsyncContext ac
Context for our asynchronous completion.
char * system_label
The label of the command which was started by calling GNUNET_TESTING_cmd_system_create.
char * cfgname
GNUnet configuration file used to start a peer.
static void start_peer_cleanup(void *cls)
The cleanup function of this cmd frees resources the cmd allocated.
static enum GNUNET_GenericReturnValue start_peer_traits(void *cls, const void **ret, const char *trait, unsigned int index)
This function prepares an array with traits.
static void start_peer_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
The run method of this cmd will start all services of a peer to test the transport service.

References GNUNET_TESTING_StartPeerState::ac, GNUNET_TESTING_StartPeerState::cfgname, GNUNET_new, GNUNET_strdup, GNUNET_TESTING_command_new_ac(), start_peer_cleanup(), start_peer_run(), start_peer_traits(), and GNUNET_TESTING_StartPeerState::system_label.

Here is the call graph for this function:

◆ GNUNET_TESTING_cmd_stop_peer()

struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_stop_peer ( const char *  label,
const char *  start_label 
)

Create command.

Parameters
labelname for command.
start_labelLabel of the cmd to start the peer.
Returns
command.

Definition at line 159 of file testing_arm_cmd_stop_peer.c.

161{
162 struct StopPeerState *sps;
163
164 sps = GNUNET_new (struct StopPeerState);
166 sps->label = label;
168 sps,
169 label,
173 &sps->ac);
174}
Struct to hold information for callbacks.
const char * start_label
Label of the cmd to start the peer.
const char * label
Label of the cmd.
struct GNUNET_TESTING_AsyncContext ac
static int stop_peer_traits(void *cls, const void **ret, const char *trait, unsigned int index)
Trait function of this cmd does nothing.
static void stop_peer_cleanup(void *cls)
The cleanup function of this cmd frees resources the cmd allocated.
static void stop_peer_run(void *cls, struct GNUNET_TESTING_Interpreter *is)
The run method of this cmd will stop all services of a peer which were used to test the transport ser...

References StopPeerState::ac, GNUNET_new, GNUNET_TESTING_command_new_ac(), StopPeerState::label, StopPeerState::start_label, stop_peer_cleanup(), stop_peer_run(), and stop_peer_traits().

Here is the call graph for this function:

◆ GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT()

GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT ( GNUNET_TESTING_ARM  ,
arm_handle  ,
struct GNUNET_ARM_Handle   
)

Variable Documentation

◆ config

config

Definition at line 47 of file gnunet_testing_arm_lib.h.