#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_testing_lib.h"
#include "gnunet_testbed_lib.h"
#include "gnunet_testing_testbed_lib.h"
#include "gnunet_testing_arm_lib.h"
Go to the source code of this file.
Data Structures | |
struct | GNUNET_TESTING_StartPeerState |
Handle for a peer controlled via ARM. More... | |
Functions | |
static void | conn_status (void *cls, enum GNUNET_GenericReturnValue connected) |
Function called whenever we connect to or disconnect from ARM. More... | |
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. More... | |
static void | start_peer_cleanup (void *cls) |
The cleanup function of this cmd frees resources the cmd allocated. More... | |
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. More... | |
struct GNUNET_TESTING_Command | GNUNET_TESTING_ARM_cmd_start_peer (const char *label, const char *system_label, const char *cfgname) |
Create command. More... | |
|
static |
Function called whenever we connect to or disconnect from ARM.
cls | closure |
connected | GNUNET_YES if connected, GNUNET_NO if disconnected, GNUNET_SYSERR if there was an error. |
Definition at line 85 of file testing_arm_cmd_start_peer.c.
References GNUNET_TESTING_StartPeerState::ac, GNUNET_TESTING_AsyncContext::finished, GNUNET_break, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_NO, GNUNET_OK, GNUNET_TESTING_async_fail(), and GNUNET_TESTING_async_finish().
Referenced by start_peer_run().
|
static |
The run method of this cmd will start all services of a peer to test the transport service.
Definition at line 111 of file testing_arm_cmd_start_peer.c.
References _, GNUNET_TESTING_StartPeerState::ah, consensus-simulation::args, GNUNET_TESTING_StartPeerState::arm, GNUNET_TESTING_StartPeerState::cfg, GNUNET_TESTING_StartPeerState::cfgname, conn_status(), GNUNET_ARM_connect(), GNUNET_assert, GNUNET_CONFIGURATION_create(), GNUNET_CONFIGURATION_get_value_filename(), GNUNET_CONFIGURATION_get_value_string(), GNUNET_CONFIGURATION_load(), GNUNET_CONFIGURATION_write(), GNUNET_DISK_file_test(), GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_NO, GNUNET_OK, GNUNET_OS_get_libexec_binary_path(), GNUNET_OS_INHERIT_STD_OUT_AND_ERR, GNUNET_OS_project_data_gnunet(), GNUNET_OS_start_process_s(), GNUNET_strdup, GNUNET_SYSERR, GNUNET_TESTBED_configuration_create(), GNUNET_TESTING_FAIL, GNUNET_TESTING_interpreter_lookup_command(), GNUNET_TESTING_TESTBED_get_trait_test_system(), is, GNUNET_TESTING_StartPeerState::is, prefix, ret, GNUNET_TESTING_StartPeerState::system, and GNUNET_TESTING_StartPeerState::system_label.
Referenced by GNUNET_TESTING_ARM_cmd_start_peer().
|
static |
The cleanup function of this cmd frees resources the cmd allocated.
Definition at line 227 of file testing_arm_cmd_start_peer.c.
References GNUNET_TESTING_StartPeerState::ah, GNUNET_TESTING_StartPeerState::arm, GNUNET_TESTING_StartPeerState::cfg, GNUNET_ARM_disconnect(), GNUNET_break, GNUNET_CONFIGURATION_destroy(), GNUNET_free, GNUNET_OK, GNUNET_OS_process_destroy(), GNUNET_OS_process_kill(), and GNUNET_OS_process_wait().
Referenced by GNUNET_TESTING_ARM_cmd_start_peer().
|
static |
This function prepares an array with traits.
Definition at line 261 of file testing_arm_cmd_start_peer.c.
References GNUNET_TESTING_StartPeerState::ah, GNUNET_TESTING_StartPeerState::arm, GNUNET_TESTING_StartPeerState::cfg, GNUNET_TESTING_get_trait(), GNUNET_TESTING_make_trait_process(), GNUNET_TESTING_trait_end(), GNUNET_TESTING_Trait::index, ret, and traits().
Referenced by 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.
label | name for command. |
system_label | Label of the cmd to setup a test environment. |
cfgname | Configuration file name for this peer. |
Definition at line 285 of file testing_arm_cmd_start_peer.c.
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.