aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing_api_helpers_exchange.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-03-19 17:56:23 +0100
committerChristian Grothoff <christian@grothoff.org>2020-03-19 17:56:23 +0100
commit15489275ba72905a6f0d84238480569390475c00 (patch)
tree650da93c443fb1d22151a4f7be0bbaab25d704d2 /src/testing/testing_api_helpers_exchange.c
parentfd29d1866f2ec72b9e334da430e1b789f4677066 (diff)
downloadexchange-15489275ba72905a6f0d84238480569390475c00.tar.xz
make DB reset optional in API, use it in tests, but not in the benchmark
Diffstat (limited to 'src/testing/testing_api_helpers_exchange.c')
-rw-r--r--src/testing/testing_api_helpers_exchange.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/testing/testing_api_helpers_exchange.c b/src/testing/testing_api_helpers_exchange.c
index 9f5716849..bed6bc8d5 100644
--- a/src/testing/testing_api_helpers_exchange.c
+++ b/src/testing/testing_api_helpers_exchange.c
@@ -490,12 +490,14 @@ fail:
* launch the exchange process itself.
*
* @param config_filename configuration file to use
+ * @param reset_db should we reset the database?
* @param[out] ec will be set to the exchange configuration data
* @return #GNUNET_OK on success, #GNUNET_NO if test should be
* skipped, #GNUNET_SYSERR on test failure
*/
int
TALER_TESTING_prepare_exchange (const char *config_filename,
+ int reset_db,
struct TALER_TESTING_ExchangeConfiguration *ec)
{
struct SignInfo si = {
@@ -508,12 +510,15 @@ TALER_TESTING_prepare_exchange (const char *config_filename,
TALER_TESTING_run_keyup (config_filename,
si.auditor_sign_input_filename))
return GNUNET_NO;
- if (GNUNET_OK !=
- TALER_TESTING_exchange_db_reset (config_filename))
- return GNUNET_NO;
- if (GNUNET_OK !=
- TALER_TESTING_auditor_db_reset (config_filename))
- return GNUNET_NO;
+ if (GNUNET_YES == reset_db)
+ {
+ if (GNUNET_OK !=
+ TALER_TESTING_exchange_db_reset (config_filename))
+ return GNUNET_NO;
+ if (GNUNET_OK !=
+ TALER_TESTING_auditor_db_reset (config_filename))
+ return GNUNET_NO;
+ }
if (GNUNET_OK !=
GNUNET_CONFIGURATION_parse_and_run (config_filename,
&sign_keys_for_exchange,