From 48cc7d6cbc9552794e846200deaf679714ffa4eb Mon Sep 17 00:00:00 2001 From: t3sserakt Date: Wed, 7 Jul 2021 10:40:07 +0200 Subject: - added rudimentary cmd helper (copied from testbed-helper), binary to start a testcase plugin, rudimentary testcase plugin --- src/testing/testing_api_loop.c | 47 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 9 deletions(-) (limited to 'src/testing') diff --git a/src/testing/testing_api_loop.c b/src/testing/testing_api_loop.c index 82f6d0cab..49ed48063 100644 --- a/src/testing/testing_api_loop.c +++ b/src/testing/testing_api_loop.c @@ -204,6 +204,8 @@ run_finish_task_next (void *cls) } else { + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Next task finished with an error.\n"); GNUNET_TESTING_interpreter_fail (); } @@ -246,6 +248,8 @@ run_finish_task_sync (void *cls) } else { + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Sync task finished with an error.\n"); GNUNET_TESTING_interpreter_fail (); } } @@ -325,16 +329,39 @@ GNUNET_TESTING_interpreter_fail () { struct GNUNET_TESTING_Command *cmd = &is->commands[is->ip]; - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Failed at command `%s'\n", - cmd->label); - while (GNUNET_TESTING_cmd_is_batch (cmd)) + if (GNUNET_SYSERR == is->result) + return; /* ignore, we already failed! */ + + if (NULL != cmd) + { + while (GNUNET_TESTING_cmd_is_batch (cmd)) + { + cmd = GNUNET_TESTING_cmd_batch_get_current (cmd); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Batch is at command `%s'\n", + cmd->label); + } + + } + else { - cmd = GNUNET_TESTING_cmd_batch_get_current (cmd); GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Batch is at command `%s'\n", + "cmd is NULL.\n"); + } + + if (NULL == cmd->label) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Failed at command `%s'\n", cmd->label); + } + else + { + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "cmd->label is NULL.\n"); + } + is->result = GNUNET_SYSERR; GNUNET_SCHEDULER_shutdown (); } @@ -386,7 +413,8 @@ interpreter_run (void *cls) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Running command END\n"); + "Running command END %p\n", + is); is->result = GNUNET_OK; GNUNET_SCHEDULER_shutdown (); return; @@ -394,8 +422,9 @@ interpreter_run (void *cls) else if (NULL != cmd) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Running command `%s'\n", - cmd->label); + "Running command `%s' %p\n", + cmd->label, + is); } cmd->start_time = cmd->last_req_time -- cgit v1.2.3