35 #define LOG(kind, ...) \ 36 GNUNET_log (kind, __VA_ARGS__) 109 if (NULL != abort_task)
145 static int printed_already;
151 printf (
"%u links failed due to timeouts\n",
failed_links);
176 printf (
"\nAborting due to very high failure rate\n");
189 printf (
"Establishing links. Please wait\n");
217 unsigned int links_succeeded,
218 unsigned int links_failed)
221 fprintf (stdout,
"\n");
230 #if (! ENABLE_SUPERMUC) 231 fprintf (stdout,
"Testbed running, waiting for keystroke to shut down\n");
235 fprintf (stdout,
"Shutting down. Please wait\n");
250 run (
void *cls,
char *
const *
args,
const char *cfgfile,
278 main (
int argc,
char *
const *argv)
290 "tolerate COUNT number of continious timeout failures"),
295 "run profiler in non-interactive mode where upon " 296 "testbed setup the profiler does not wait for a " 297 "keystroke but continues to run until a termination " 298 "signal is received"),
300 #if ! ENABLE_SUPERMUC 305 "name of the file with the login information for the testbed"),
310 const char *binaryHelp =
"gnunet-testbed-profiler [OPTIONS]";
313 unsetenv (
"XDG_DATA_HOME");
314 unsetenv (
"XDG_CONFIG_HOME");
320 options, &
run, NULL);
#define LOG(kind,...)
Generic loggins shorthand.
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_run(int argc, char *const *argv, const char *binaryName, const char *binaryHelp, const struct GNUNET_GETOPT_CommandLineOption *options, GNUNET_PROGRAM_Main task, void *task_cls)
Run a standard GNUnet command startup sequence (initialize loggers and configuration, parse options).
static void controller_event_cb(void *cls, const struct GNUNET_TESTBED_EventInformation *event)
Controller event callback.
static unsigned int failed_links
Links which are not successfully established.
static void run(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *config)
Main function that will be run by the scheduler.
static int noninteractive
Are we running non interactively.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received, or when GNUNET_SCHEDULER_shutdown() is being invoked.
int GNUNET_STRINGS_get_utf8_args(int argc, char *const *argv, int *u8argc, char *const **u8argv)
Returns utf-8 encoded arguments.
static struct GNUNET_SCHEDULER_Task * abort_task
Abort task identifier.
static int ret
Return value of the commandline.
Definition of a command line option.
struct GNUNET_TESTBED_Operation * topology_op
Peer linking - topology operation.
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
static void print_overlay_links_summary()
Function to print summary about how many overlay links we have made and how many failed.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_OPTION_END
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Opaque handle to an abstract operation to be executed by the testing framework.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_string(char shortName, const char *name, const char *argumentHelp, const char *description, char **str)
Allow user to specify a string.
static unsigned int established_links
Links which are successfully established.
static int result
Global testing status.
A requested testbed operation has been completed.
void GNUNET_CONFIGURATION_destroy(struct GNUNET_CONFIGURATION_Handle *cfg)
Destroy configuration object.
static const struct GNUNET_CONFIGURATION_Handle * config
static unsigned int num_peers
Number of peers to be started by the profiler.
static void do_abort(void *cls)
abort task to run on test timed out
void GNUNET_TESTBED_run(const char *host_filename, const struct GNUNET_CONFIGURATION_Handle *cfg, unsigned int num_peers, uint64_t event_mask, GNUNET_TESTBED_ControllerCallback cc, void *cc_cls, GNUNET_TESTBED_TestMaster test_master, void *test_master_cls)
Convenience method for running a testbed with a single call.
#define GNUNET_free_nz(ptr)
Wrapper around free.
static unsigned int cont_fails
Continuous failures during overlay connect operations.
uint64_t event_mask
Global event mask for all testbed events.
int main(int argc, char *const *argv)
Main function.
A connection between two peers was established.
struct GNUNET_CONFIGURATION_Handle * GNUNET_CONFIGURATION_dup(const struct GNUNET_CONFIGURATION_Handle *cfg)
Duplicate an existing configuration object.
struct GNUNET_CONFIGURATION_Handle * cfg
Handle to global configuration.
static struct CadetPeer * peers
Operation to get peer ids.
static void test_run(void *cls, struct GNUNET_TESTBED_RunHandle *h, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, unsigned int links_succeeded, unsigned int links_failed)
Signature of a main function for a testcase.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_flag(char shortName, const char *name, const char *description, int *val)
Allow user to specify a flag (which internally means setting an integer to 1/GNUNET_YES/GNUNET_OK.
static char * hosts_file
Name of the file with the hosts to run the test over (configuration option).
Entry in list of pending tasks.
static unsigned int num_cont_fails
Number of timeout failures to tolerate.
internal API to access the 'hosts' subsystem
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_uint(char shortName, const char *name, const char *argumentHelp, const char *description, unsigned int *val)
Allow user to specify an unsigned int.
static void do_shutdown(void *cls)
Shutdown nicely.
A peer controlled by the testing framework.
#define gettext_noop(String)
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.