diff options
Diffstat (limited to 'src/testing/testing_api_cmd_exec_wirewatch.c')
-rw-r--r-- | src/testing/testing_api_cmd_exec_wirewatch.c | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/src/testing/testing_api_cmd_exec_wirewatch.c b/src/testing/testing_api_cmd_exec_wirewatch.c index 2c50b4f4a..b6ed4f0f1 100644 --- a/src/testing/testing_api_cmd_exec_wirewatch.c +++ b/src/testing/testing_api_cmd_exec_wirewatch.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2018 Taler Systems SA + Copyright (C) 2018, 2023 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -34,7 +34,6 @@ */ struct WirewatchState { - /** * Process for the wirewatcher. */ @@ -44,8 +43,14 @@ struct WirewatchState * Configuration file used by the wirewatcher. */ const char *config_filename; + + /** + * Account section to be used by the wirewatcher. + */ + const char *account_section; }; + /** * Run the command; use the `taler-exchange-wirewatch' program. * @@ -60,6 +65,7 @@ wirewatch_run (void *cls, { struct WirewatchState *ws = cls; + (void) cmd; ws->wirewatch_proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ALL, NULL, NULL, NULL, @@ -69,6 +75,10 @@ wirewatch_run (void *cls, "-S", "1", "-w", "0", "-t", /* exit when done */ + (NULL == ws->account_section) + ? NULL + : "-a", + ws->account_section, NULL); if (NULL == ws->wirewatch_proc) { @@ -93,6 +103,7 @@ wirewatch_cleanup (void *cls, { struct WirewatchState *ws = cls; + (void) cmd; if (NULL != ws->wirewatch_proc) { GNUNET_break (0 == @@ -115,7 +126,7 @@ wirewatch_cleanup (void *cls, * @param index index number of the object to offer. * @return #GNUNET_OK on success. */ -static int +static enum GNUNET_GenericReturnValue wirewatch_traits (void *cls, const void **ret, const char *trait, @@ -123,8 +134,7 @@ wirewatch_traits (void *cls, { struct WirewatchState *ws = cls; struct TALER_TESTING_Trait traits[] = { - TALER_TESTING_make_trait_process (0, - &ws->wirewatch_proc), + TALER_TESTING_make_trait_process (&ws->wirewatch_proc), TALER_TESTING_trait_end () }; @@ -135,22 +145,16 @@ wirewatch_traits (void *cls, } -/** - * Make a "wirewatch" CMD. - * - * @param label command label. - * @param config_filename configuration filename. - * @return the command. - */ struct TALER_TESTING_Command -TALER_TESTING_cmd_exec_wirewatch (const char *label, - const char *config_filename) +TALER_TESTING_cmd_exec_wirewatch2 (const char *label, + const char *config_filename, + const char *account_section) { struct WirewatchState *ws; ws = GNUNET_new (struct WirewatchState); ws->config_filename = config_filename; - + ws->account_section = account_section; { struct TALER_TESTING_Command cmd = { .cls = ws, @@ -165,4 +169,14 @@ TALER_TESTING_cmd_exec_wirewatch (const char *label, } +struct TALER_TESTING_Command +TALER_TESTING_cmd_exec_wirewatch (const char *label, + const char *config_filename) +{ + return TALER_TESTING_cmd_exec_wirewatch2 (label, + config_filename, + NULL); +} + + /* end of testing_api_cmd_exec_wirewatch.c */ |