summaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-08-23 00:00:32 +0200
committerChristian Grothoff <christian@grothoff.org>2021-08-23 00:00:32 +0200
commitc559b1c935a93c4cdec442beeac59264d483c824 (patch)
tree625cf48e047e6534606b5b6b9cd0c15f4c3672dc /src/testing
parent37f049b3bc98c72f68687e67f102ee5b06f9263d (diff)
downloadexchange-c559b1c935a93c4cdec442beeac59264d483c824.tar.gz
exchange-c559b1c935a93c4cdec442beeac59264d483c824.tar.bz2
exchange-c559b1c935a93c4cdec442beeac59264d483c824.zip
complete implementation of long-polling for reserve status; remove support for multi-threaded exchange httpd
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/test_taler_exchange_aggregator.c12
-rw-r--r--src/testing/testing_api_cmd_insert_deposit.c16
-rw-r--r--src/testing/testing_api_cmd_status.c1
-rw-r--r--src/testing/testing_api_helpers_exchange.c3
4 files changed, 16 insertions, 16 deletions
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
{