diff options
Diffstat (limited to 'src/testing/test_bank_api.c')
-rw-r--r-- | src/testing/test_bank_api.c | 54 |
1 files changed, 42 insertions, 12 deletions
diff --git a/src/testing/test_bank_api.c b/src/testing/test_bank_api.c index 2a709fb1..3a3fd353 100644 --- a/src/testing/test_bank_api.c +++ b/src/testing/test_bank_api.c @@ -53,6 +53,15 @@ static struct GNUNET_OS_Process *bankd; */ static int with_fakebank; +/** + * Handles to the libeufin services. + */ +static struct TALER_TESTING_LibeufinServices libeufin_services; + +/** + * Needed to shutdown differently. + */ +static int with_libeufin; /** * Main function that will tell the interpreter what commands to @@ -78,6 +87,8 @@ run (void *cls, "KUDOS:5.01", &bc.exchange_auth, bc.user42_payto), + TALER_TESTING_cmd_sleep ("Waiting 4s for 'credit-1' to settle", + 4), TALER_TESTING_cmd_bank_credits ("history-1c", &bc.exchange_auth, NULL, @@ -97,6 +108,9 @@ run (void *cls, bc.user42_payto, &wtid, "http://exchange.example.com/"), + + TALER_TESTING_cmd_sleep ("Waiting 5s for 'debit-1' to settle", + 5), TALER_TESTING_cmd_bank_debits ("history-2b", &bc.exchange_auth, NULL, @@ -192,8 +206,9 @@ main (int argc, } else if (GNUNET_YES == TALER_TESTING_has_in_name (argv[0], "_with_nexus")) { - TALER_LOG_DEBUG ("Running against Nexus.\n"); - cfgfile = CONFIG_FILE_FAKEBANK; + TALER_LOG_DEBUG ("Running with Nexus.\n"); + with_libeufin = GNUNET_YES; + cfgfile = CONFIG_FILE_NEXUS; if (GNUNET_OK != TALER_TESTING_prepare_nexus (CONFIG_FILE_NEXUS, GNUNET_YES, "exchange-account-2", @@ -202,19 +217,16 @@ main (int argc, GNUNET_break (0); return 77; } - if (NULL == (bankd = TALER_TESTING_run_nexus (&bc))) + libeufin_services = TALER_TESTING_run_libeufin (&bc); + if ( (NULL == libeufin_services.nexus) || (NULL == libeufin_services.sandbox) ) { GNUNET_break (0); return 77; } - GNUNET_OS_process_kill (bankd, - SIGKILL); - GNUNET_OS_process_wait (bankd); - GNUNET_OS_process_destroy (bankd); - return 0; } else { + /* no bank service was ever invoked. */ GNUNET_break (0); return 77; } @@ -226,14 +238,32 @@ main (int argc, rv = 1; else rv = 0; + if (GNUNET_NO == with_fakebank) { + // -> pybank + if (GNUNET_NO == with_libeufin) + { + + GNUNET_OS_process_kill (bankd, + SIGKILL); + GNUNET_OS_process_wait (bankd); + GNUNET_OS_process_destroy (bankd); + } + else // -> libeufin + { + GNUNET_OS_process_kill (libeufin_services.nexus, + SIGKILL); + GNUNET_OS_process_wait (libeufin_services.nexus); + GNUNET_OS_process_destroy (libeufin_services.nexus); - GNUNET_OS_process_kill (bankd, - SIGKILL); - GNUNET_OS_process_wait (bankd); - GNUNET_OS_process_destroy (bankd); + GNUNET_OS_process_kill (libeufin_services.sandbox, + SIGKILL); + GNUNET_OS_process_wait (libeufin_services.sandbox); + GNUNET_OS_process_destroy (libeufin_services.sandbox); + } } + return rv; } |