summaryrefslogtreecommitdiff
path: root/src/exchange-lib
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2018-08-19 00:49:16 +0200
committerFlorian Dold <florian.dold@gmail.com>2018-08-19 00:49:16 +0200
commit96e047b186245ab8f0883bb0e0fe9dfaff3ef407 (patch)
tree9f8523e0303ba3337f86e6ca516b9f52b523747c /src/exchange-lib
parent624a9ac6dcae8ad40709c184d3502bcfdcbb9de2 (diff)
downloadexchange-96e047b186245ab8f0883bb0e0fe9dfaff3ef407.tar.gz
exchange-96e047b186245ab8f0883bb0e0fe9dfaff3ef407.tar.bz2
exchange-96e047b186245ab8f0883bb0e0fe9dfaff3ef407.zip
add remote benchmarking
Diffstat (limited to 'src/exchange-lib')
-rw-r--r--src/exchange-lib/testing_api_helpers.c3
-rw-r--r--src/exchange-lib/testing_api_loop.c24
2 files changed, 19 insertions, 8 deletions
diff --git a/src/exchange-lib/testing_api_helpers.c b/src/exchange-lib/testing_api_helpers.c
index bcdb44305..2e2f10e68 100644
--- a/src/exchange-lib/testing_api_helpers.c
+++ b/src/exchange-lib/testing_api_helpers.c
@@ -477,7 +477,8 @@ TALER_TESTING_setup_with_exchange (TALER_TESTING_Main main_cb,
result = TALER_TESTING_setup (main_cb,
main_cb_cls,
config_filename,
- exchanged);
+ exchanged,
+ GNUNET_YES);
GNUNET_break (0 ==
GNUNET_OS_process_kill (exchanged,
SIGTERM));
diff --git a/src/exchange-lib/testing_api_loop.c b/src/exchange-lib/testing_api_loop.c
index 9d777dfa4..43d0ecc87 100644
--- a/src/exchange-lib/testing_api_loop.c
+++ b/src/exchange-lib/testing_api_loop.c
@@ -405,11 +405,18 @@ maint_child_death (void *cls)
if (GNUNET_OK == is->reload_keys)
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Triggering key state reload at exchange\n");
- GNUNET_break (0 == GNUNET_OS_process_kill
- (is->exchanged, SIGUSR1));
- sleep (5); /* make sure signal was received and processed */
+ if (NULL == is->exchanged)
+ {
+ GNUNET_break (0);
+ }
+ else
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Triggering key state reload at exchange\n");
+ GNUNET_break (0 == GNUNET_OS_process_kill
+ (is->exchanged, SIGUSR1));
+ sleep (5); /* make sure signal was received and processed */
+ }
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -669,6 +676,8 @@ main_wrapper_exchange_connect (void *cls)
* signal to it, for example to let it know to reload the
* key state.. if NULL, the interpreter will run without
* trying to connect to the exchange first.
+ * @param exchange_connect GNUNET_YES if the test should connect
+ * to the exchange, GNUNET_NO otherwise
* @return #GNUNET_OK if all is okay, != #GNUNET_OK otherwise.
* non-GNUNET_OK codes are #GNUNET_SYSERR most of the
* times.
@@ -677,7 +686,8 @@ int
TALER_TESTING_setup (TALER_TESTING_Main main_cb,
void *main_cb_cls,
const char *config_filename,
- struct GNUNET_OS_Process *exchanged)
+ struct GNUNET_OS_Process *exchanged,
+ int exchange_connect)
{
struct TALER_TESTING_Interpreter is;
struct MainContext main_ctx = {
@@ -709,7 +719,7 @@ TALER_TESTING_setup (TALER_TESTING_Main main_cb,
/* Blocking */
- if (NULL != exchanged)
+ if (GNUNET_YES == exchange_connect)
GNUNET_SCHEDULER_run (&main_wrapper_exchange_connect,
&main_ctx);
else