From c559b1c935a93c4cdec442beeac59264d483c824 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 23 Aug 2021 00:00:32 +0200 Subject: complete implementation of long-polling for reserve status; remove support for multi-threaded exchange httpd --- src/testing/test_taler_exchange_aggregator.c | 12 +++++++++--- src/testing/testing_api_cmd_insert_deposit.c | 16 ++++------------ src/testing/testing_api_cmd_status.c | 1 + src/testing/testing_api_helpers_exchange.c | 3 ++- 4 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src/testing') diff --git a/src/testing/test_taler_exchange_aggregator.c b/src/testing/test_taler_exchange_aggregator.c index 2b3d642ef..684fe9697 100644 --- a/src/testing/test_taler_exchange_aggregator.c +++ b/src/testing/test_taler_exchange_aggregator.c @@ -41,7 +41,7 @@ static struct TALER_TESTING_ExchangeConfiguration ec; static struct TALER_TESTING_BankConfiguration bc; /** - * Contains plugin and session. + * Contains plugin. */ static struct TALER_TESTING_DatabaseConnection dbc; @@ -499,8 +499,14 @@ prepare_database (void *cls, TALER_TESTING_interpreter_fail (is); return; } - dbc.session = dbc.plugin->get_session (dbc.plugin->cls); - GNUNET_assert (NULL != dbc.session); + if (GNUNET_OK != + dbc.plugin->preflight (dbc.plugin->cls)) + { + GNUNET_break (0); + result = 77; + TALER_TESTING_interpreter_fail (is); + return; + } GNUNET_SCHEDULER_add_shutdown (&unload_db, NULL); run (NULL, diff --git a/src/testing/testing_api_cmd_insert_deposit.c b/src/testing/testing_api_cmd_insert_deposit.c index b614702a3..0d57ab6c4 100644 --- a/src/testing/testing_api_cmd_insert_deposit.c +++ b/src/testing/testing_api_cmd_insert_deposit.c @@ -149,16 +149,13 @@ insert_deposit_run (void *cls, if ( (GNUNET_OK != ids->dbc->plugin->start (ids->dbc->plugin->cls, - ids->dbc->session, "talertestinglib: denomination insertion")) || (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != ids->dbc->plugin->insert_denomination_info (ids->dbc->plugin->cls, - ids->dbc->session, &dpk, &issue)) || (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != - ids->dbc->plugin->commit (ids->dbc->plugin->cls, - ids->dbc->session)) ) + ids->dbc->plugin->commit (ids->dbc->plugin->cls)) ) { TALER_TESTING_interpreter_fail (is); return; @@ -228,24 +225,19 @@ insert_deposit_run (void *cls, /* finally, actually perform the DB operation */ if ( (GNUNET_OK != ids->dbc->plugin->start (ids->dbc->plugin->cls, - ids->dbc->session, "libtalertesting: insert deposit")) || (0 > ids->dbc->plugin->ensure_coin_known (ids->dbc->plugin->cls, - ids->dbc->session, &deposit.coin)) || (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != ids->dbc->plugin->insert_deposit (ids->dbc->plugin->cls, - ids->dbc->session, ids->exchange_timestamp, &deposit)) || (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != - ids->dbc->plugin->commit (ids->dbc->plugin->cls, - ids->dbc->session)) ) + ids->dbc->plugin->commit (ids->dbc->plugin->cls)) ) { GNUNET_break (0); - ids->dbc->plugin->rollback (ids->dbc->plugin->cls, - ids->dbc->session); + ids->dbc->plugin->rollback (ids->dbc->plugin->cls); TALER_TESTING_interpreter_fail (is); } @@ -302,7 +294,7 @@ insert_deposit_traits (void *cls, * Make the "insert-deposit" CMD. * * @param label command label. - * @param dbc collects database plugin and session handles. + * @param dbc collects database plugin * @param merchant_name Human-readable name of the merchant. * @param merchant_account merchant's account name (NOT a payto:// URI) * @param exchange_timestamp when did the exchange receive the deposit diff --git a/src/testing/testing_api_cmd_status.c b/src/testing/testing_api_cmd_status.c index f395af28a..6acfcc75b 100644 --- a/src/testing/testing_api_cmd_status.c +++ b/src/testing/testing_api_cmd_status.c @@ -356,6 +356,7 @@ status_run (void *cls, } ss->rsh = TALER_EXCHANGE_reserves_get (is->exchange, ss->reserve_pubp, + GNUNET_TIME_UNIT_ZERO, &reserve_status_cb, ss); } diff --git a/src/testing/testing_api_helpers_exchange.c b/src/testing/testing_api_helpers_exchange.c index 8a4d71c58..a6307ca4c 100644 --- a/src/testing/testing_api_helpers_exchange.c +++ b/src/testing/testing_api_helpers_exchange.c @@ -559,7 +559,8 @@ TALER_TESTING_wait_auditor_ready (const char *base_url) base_url); // make sure ends with '/' /* give child time to start and bind against the socket */ fprintf (stderr, - "Waiting for `taler-auditor-httpd' to be ready\n"); + "Waiting for `taler-auditor-httpd' to be ready at %s\n", + base_url); iter = 0; do { -- cgit v1.2.3