gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-merchant] branch master updated: fix taler-merchant-benchmark FTB


From: gnunet
Subject: [taler-merchant] branch master updated: fix taler-merchant-benchmark FTBFS
Date: Sun, 16 Jul 2023 14:03:19 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new f27bd7cc fix taler-merchant-benchmark FTBFS
f27bd7cc is described below

commit f27bd7ccf260e90fb86461fbfa07a09f555756c9
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Jul 16 14:03:16 2023 +0200

    fix taler-merchant-benchmark FTBFS
---
 src/merchant-tools/Makefile.am                |   5 +-
 src/merchant-tools/taler-merchant-benchmark.c | 560 ++++++++++++++------------
 2 files changed, 302 insertions(+), 263 deletions(-)

diff --git a/src/merchant-tools/Makefile.am b/src/merchant-tools/Makefile.am
index 66cd8763..ea448bb4 100644
--- a/src/merchant-tools/Makefile.am
+++ b/src/merchant-tools/Makefile.am
@@ -8,9 +8,8 @@ endif
 
 bin_PROGRAMS = \
   taler-merchant-dbinit \
-  taler-merchant-setup-reserve
-
-#  taler-merchant-benchmark
+  taler-merchant-setup-reserve \
+  taler-merchant-benchmark
 
 taler_merchant_benchmark_SOURCES = \
   taler-merchant-benchmark.c
diff --git a/src/merchant-tools/taler-merchant-benchmark.c 
b/src/merchant-tools/taler-merchant-benchmark.c
index b1b907ab..17764eb1 100644
--- a/src/merchant-tools/taler-merchant-benchmark.c
+++ b/src/merchant-tools/taler-merchant-benchmark.c
@@ -1,6 +1,6 @@
 /*
   This file is part of TALER
-  (C) 2014--2020 Taler Systems SA
+  (C) 2014--2023 Taler Systems SA
 
   TALER is free software; you can redistribute it and/or modify it
   under the terms of the GNU Affero General Public License as
@@ -16,7 +16,6 @@
   along with TALER; see the file COPYING.  If not,
   see <http://www.gnu.org/licenses/>
 */
-
 /**
  * @file taler-merchant-benchmark.c
  * @brief benchmark the backend to evaluate performance
@@ -36,7 +35,6 @@
 #include <taler/taler_error_codes.h>
 #include "taler_merchant_testing_lib.h"
 
-#define PAYTO_I1 "payto://x-taler-bank/localhost/42"
 
 /**
  * Maximum length of an amount (value plus currency string) needed by the test.
@@ -51,22 +49,6 @@
 #define MAX_ORDER_LEN (MAX_AMOUNT_LEN * 4 + 2048)
 
 
-/* Error codes. */
-enum PaymentGeneratorError
-{
-  PG_SUCCESS = 0,
-  PG_NO_SUBCOMMAND,
-  PG_BAD_OPTIONS,
-  PG_BAD_CONFIG_FILE,
-  PG_FAILED_CFG_CURRENCY,
-  PG_FAILED_TO_PREPARE_MERCHANT,
-  PG_FAILED_TO_PREPARE_BANK,
-  PG_FAILED_TO_LAUNCH_MERCHANT,
-  PG_FAILED_TO_LAUNCH_BANK,
-  PG_RUNTIME_FAILURE
-};
-
-
 /**
  * ID to use for the 'alternative' instance.
  */
@@ -117,11 +99,6 @@ static unsigned int tracks_number = 1;
  */
 static char *cfg_filename;
 
-/**
- * Bank configuration.
- */
-static struct TALER_TESTING_BankConfiguration bc;
-
 /**
  * Merchant base URL.
  */
@@ -132,6 +109,22 @@ static char *merchant_url;
  */
 static char *currency;
 
+/**
+ * Set to 1 if `-f` command line option given.
+ */
+static int use_fakebank;
+
+/**
+ * Configuration section with details about the exchange
+ * bank account to use.
+ */
+static char *exchange_bank_section;
+
+/**
+ * Credentials to use for the benchmark.
+ */
+static struct TALER_TESTING_Credentials cred;
+
 
 /**
  * Actual commands collection.
@@ -186,106 +179,116 @@ run (void *cls,
                    sizeof (CURRENCY_0_01),
                    "%s:0.01",
                    currency);
-
-  if (NULL != apikey)
-  {
-    char *hdr;
-
-    GNUNET_asprintf (&hdr,
-                     "%s: %s",
-                     MHD_HTTP_HEADER_AUTHORIZATION,
-                     apikey);
-    GNUNET_assert (GNUNET_OK ==
-                   GNUNET_CURL_append_header (is->ctx,
-                                              hdr));
-    GNUNET_free (hdr);
-  }
-
   if (ordinary)
   {
     struct TALER_TESTING_Command ordinary_commands[] = {
-      TALER_TESTING_cmd_merchant_post_instances ("instance-create-default",
-                                                 merchant_url,
-                                                 "default",
-                                                 PAYTO_I1,
-                                                 currency,
-                                                 MHD_HTTP_NO_CONTENT),
-      TALER_TESTING_cmd_admin_add_incoming ("create-reserve-1",
-                                            CURRENCY_10_02,
-                                            &bc.exchange_auth,
-                                            bc.user43_payto),
-      TALER_TESTING_cmd_exec_wirewatch ("wirewatch-1",
-                                        cfg_filename),
-      TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-1",
-                                         "create-reserve-1",
-                                         CURRENCY_5,
-                                         0,
-                                         MHD_HTTP_OK),
-      TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-2",
-                                         "create-reserve-1",
-                                         CURRENCY_5,
-                                         0,
-                                         MHD_HTTP_OK),
-      TALER_TESTING_cmd_merchant_post_orders ("create-proposal-1",
-                                              merchant_url,
-                                              MHD_HTTP_OK,
-                                              NULL, /* random order ID please 
*/
-                                              GNUNET_TIME_UNIT_ZERO_TS,
-                                              GNUNET_TIME_UNIT_FOREVER_TS,
-                                              CURRENCY_5),
-      TALER_TESTING_cmd_merchant_pay_order ("deposit-simple",
-                                            merchant_url,
-                                            MHD_HTTP_OK,
-                                            "create-proposal-1",
-                                            "withdraw-coin-1",
-                                            CURRENCY_5,
-                                            CURRENCY_4_99,
-                                            NULL),
-      TALER_TESTING_cmd_rewind_ip ("rewind-payments",
-                                   "create-reserve-1",
-                                   payments_number),
+      TALER_TESTING_cmd_get_exchange (
+        "get-exchange",
+        cred.cfg,
+        NULL,
+        true,
+        true),
+      TALER_TESTING_cmd_set_authorization (
+        "set-auth-valid",
+        apikey),
+      TALER_TESTING_cmd_merchant_post_instances (
+        "instance-create-default",
+        merchant_url,
+        "default",
+        cred.user42_payto,
+        currency,
+        MHD_HTTP_NO_CONTENT),
+      TALER_TESTING_cmd_admin_add_incoming (
+        "create-reserve-1",
+        CURRENCY_10_02,
+        &cred.ba,
+        cred.user43_payto),
+      TALER_TESTING_cmd_exec_wirewatch (
+        "wirewatch-1",
+        cfg_filename),
+      TALER_TESTING_cmd_withdraw_amount (
+        "withdraw-coin-1",
+        "create-reserve-1",
+        CURRENCY_5,
+        0,
+        MHD_HTTP_OK),
+      TALER_TESTING_cmd_withdraw_amount (
+        "withdraw-coin-2",
+        "create-reserve-1",
+        CURRENCY_5,
+        0,
+        MHD_HTTP_OK),
+      TALER_TESTING_cmd_merchant_post_orders (
+        "create-proposal-1",
+        cred.cfg,
+        merchant_url,
+        MHD_HTTP_OK,
+        NULL,  /* random order ID please */
+        GNUNET_TIME_UNIT_ZERO_TS,
+        GNUNET_TIME_UNIT_FOREVER_TS,
+        CURRENCY_5),
+      TALER_TESTING_cmd_merchant_pay_order (
+        "deposit-simple",
+        merchant_url,
+        MHD_HTTP_OK,
+        "create-proposal-1",
+        "withdraw-coin-1",
+        CURRENCY_5,
+        CURRENCY_4_99,
+        NULL),
+      TALER_TESTING_cmd_rewind_ip (
+        "rewind-payments",
+        "create-reserve-1",
+        payments_number),
       /* Next proposal-pay cycle will be used by /track CMDs
        * and so it will not have to be looped over, only /track
        * CMDs will have to.  */
-      TALER_TESTING_cmd_merchant_post_orders ("create-proposal-2",
-                                              merchant_url,
-                                              MHD_HTTP_OK,
-                                              NULL, /* random order ID */
-                                              GNUNET_TIME_UNIT_ZERO_TS,
-                                              GNUNET_TIME_UNIT_FOREVER_TS,
-                                              CURRENCY_5),
-      TALER_TESTING_cmd_merchant_pay_order ("deposit-simple-2",
-                                            merchant_url,
-                                            MHD_HTTP_OK,
-                                            "create-proposal-2",
-                                            "withdraw-coin-2",
-                                            CURRENCY_5,
-                                            CURRENCY_4_99,
-                                            NULL),
+      TALER_TESTING_cmd_merchant_post_orders (
+        "create-proposal-2",
+        cred.cfg,
+        merchant_url,
+        MHD_HTTP_OK,
+        NULL,   /* random order ID */
+        GNUNET_TIME_UNIT_ZERO_TS,
+        GNUNET_TIME_UNIT_FOREVER_TS,
+        CURRENCY_5),
+      TALER_TESTING_cmd_merchant_pay_order (
+        "deposit-simple-2",
+        merchant_url,
+        MHD_HTTP_OK,
+        "create-proposal-2",
+        "withdraw-coin-2",
+        CURRENCY_5,
+        CURRENCY_4_99,
+        NULL),
       /* /track/transaction over deposit-simple-2 */
 
-      TALER_TESTING_cmd_exec_aggregator ("aggregate-1",
-                                         cfg_filename),
-      TALER_TESTING_cmd_exec_transfer ("transfer-1",
-                                       cfg_filename),
+      TALER_TESTING_cmd_exec_aggregator (
+        "aggregate-1",
+        cfg_filename),
+      TALER_TESTING_cmd_exec_transfer (
+        "transfer-1",
+        cfg_filename),
       TALER_TESTING_cmd_merchant_post_transfer (
         "post-transfer-1",
-        &bc.exchange_auth,
-        bc.exchange_auth.wire_gateway_url,
+        &cred.ba,
+        cred.user42_payto,
         merchant_url,
         CURRENCY_4_98,
         MHD_HTTP_OK,
         "deposit-simple-2",
         NULL),
-      TALER_TESTING_cmd_merchant_get_transfers ("track-transfer-1",
-                                                merchant_url,
-                                                bc.user42_payto,
-                                                MHD_HTTP_OK,
-                                                "post-transfer-1",
-                                                NULL),
-      TALER_TESTING_cmd_rewind_ip ("rewind-tracks",
-                                   "track-transfer-1",
-                                   tracks_number),
+      TALER_TESTING_cmd_merchant_get_transfers (
+        "track-transfer-1",
+        merchant_url,
+        cred.user42_payto,
+        MHD_HTTP_OK,
+        "post-transfer-1",
+        NULL),
+      TALER_TESTING_cmd_rewind_ip (
+        "rewind-tracks",
+        "track-transfer-1",
+        tracks_number),
       TALER_TESTING_cmd_end ()
     };
 
@@ -297,85 +300,113 @@ run (void *cls,
   if (corner) /* should never be 'false' here */
   {
     struct TALER_TESTING_Command corner_commands[] = {
-      TALER_TESTING_cmd_merchant_post_instances ("instance-create-default",
-                                                 merchant_url,
-                                                 "default",
-                                                 PAYTO_I1,
-                                                 currency,
-                                                 MHD_HTTP_NO_CONTENT),
-      TALER_TESTING_cmd_merchant_post_instances ("instance-create-alt",
-                                                 merchant_url,
-                                                 alt_instance_id,
-                                                 PAYTO_I1,
-                                                 currency,
-                                                 MHD_HTTP_NO_CONTENT),
-      TALER_TESTING_cmd_admin_add_incoming ("create-reserve-1",
-                                            CURRENCY_5_01,
-                                            &bc.exchange_auth,
-                                            bc.user43_payto),
-      TALER_TESTING_cmd_exec_wirewatch ("wirewatch-1",
-                                        cfg_filename),
-      TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-1",
-                                         "create-reserve-1",
-                                         CURRENCY_5,
-                                         0,
-                                         MHD_HTTP_OK),
-      TALER_TESTING_cmd_merchant_post_orders ("create-unaggregated-proposal",
-                                              alt_instance_url,
-                                              MHD_HTTP_OK,
-                                              NULL, /* use random order ID */
-                                              GNUNET_TIME_UNIT_ZERO_TS,
-                                              GNUNET_TIME_UNIT_FOREVER_TS,
-                                              CURRENCY_5),
-      TALER_TESTING_cmd_merchant_pay_order ("deposit-unaggregated",
-                                            alt_instance_url,
-                                            MHD_HTTP_OK,
-                                            "create-unaggregated-proposal",
-                                            "withdraw-coin-1",
-                                            CURRENCY_5,
-                                            CURRENCY_4_99,
-                                            NULL),
-      TALER_TESTING_cmd_rewind_ip ("rewind-unaggregated",
-                                   "create-reserve-1",
-                                   unaggregated_number),
-      TALER_TESTING_cmd_admin_add_incoming ("create-reserve-2",
-                                            CURRENCY_10_02,
-                                            &bc.exchange_auth,
-                                            bc.user43_payto),
-      TALER_TESTING_cmd_exec_wirewatch ("wirewatch-2",
-                                        cfg_filename),
-      TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-2",
-                                         "create-reserve-2",
-                                         CURRENCY_5,
-                                         0,
-                                         MHD_HTTP_OK),
-      TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-3",
-                                         "create-reserve-2",
-                                         CURRENCY_5,
-                                         0,
-                                         MHD_HTTP_OK),
-      TALER_TESTING_cmd_merchant_post_orders ("create-twocoins-proposal",
-                                              merchant_url,
-                                              MHD_HTTP_OK,
-                                              NULL, /* use random order ID */
-                                              GNUNET_TIME_UNIT_ZERO_TS,
-                                              GNUNET_TIME_UNIT_FOREVER_TS,
-                                              CURRENCY_10),
-      TALER_TESTING_cmd_merchant_pay_order ("deposit-twocoins",
-                                            merchant_url,
-                                            MHD_HTTP_OK,
-                                            "create-twocoins-proposal",
-                                            "withdraw-coin-2;withdraw-coin-3",
-                                            CURRENCY_10,
-                                            CURRENCY_9_98,
-                                            NULL),
-      TALER_TESTING_cmd_exec_aggregator ("aggregate-twocoins",
-                                         cfg_filename),
-      TALER_TESTING_cmd_exec_transfer ("transfer-twocoins",
-                                       cfg_filename),
-      TALER_TESTING_cmd_rewind_ip ("rewind-twocoins",
-                                   "create-reserve-2",
-                                   twocoins_number),
+      TALER_TESTING_cmd_get_exchange (
+        "get-exchange",
+        cred.cfg,
+        NULL,
+        true,
+        true),
+      TALER_TESTING_cmd_set_authorization (
+        "set-auth-valid",
+        apikey),
+      TALER_TESTING_cmd_merchant_post_instances (
+        "instance-create-default",
+        merchant_url,
+        "default",
+        cred.user42_payto,
+        currency,
+        MHD_HTTP_NO_CONTENT),
+      TALER_TESTING_cmd_merchant_post_instances (
+        "instance-create-alt",
+        merchant_url,
+        alt_instance_id,
+        cred.user42_payto,
+        currency,
+        MHD_HTTP_NO_CONTENT),
+      TALER_TESTING_cmd_admin_add_incoming (
+        "create-reserve-1",
+        CURRENCY_5_01,
+        &cred.ba,
+        cred.user43_payto),
+      TALER_TESTING_cmd_exec_wirewatch (
+        "wirewatch-1",
+        cfg_filename),
+      TALER_TESTING_cmd_withdraw_amount (
+        "withdraw-coin-1",
+        "create-reserve-1",
+        CURRENCY_5,
+        0,
+        MHD_HTTP_OK),
+      TALER_TESTING_cmd_merchant_post_orders (
+        "create-unaggregated-proposal",
+        cred.cfg,
+        alt_instance_url,
+        MHD_HTTP_OK,
+        NULL,  /* use random order ID */
+        GNUNET_TIME_UNIT_ZERO_TS,
+        GNUNET_TIME_UNIT_FOREVER_TS,
+        CURRENCY_5),
+      TALER_TESTING_cmd_merchant_pay_order (
+        "deposit-unaggregated",
+        alt_instance_url,
+        MHD_HTTP_OK,
+        "create-unaggregated-proposal",
+        "withdraw-coin-1",
+        CURRENCY_5,
+        CURRENCY_4_99,
+        NULL),
+      TALER_TESTING_cmd_rewind_ip (
+        "rewind-unaggregated",
+        "create-reserve-1",
+        unaggregated_number),
+      TALER_TESTING_cmd_admin_add_incoming (
+        "create-reserve-2",
+        CURRENCY_10_02,
+        &cred.ba,
+        cred.user43_payto),
+      TALER_TESTING_cmd_exec_wirewatch (
+        "wirewatch-2",
+        cfg_filename),
+      TALER_TESTING_cmd_withdraw_amount (
+        "withdraw-coin-2",
+        "create-reserve-2",
+        CURRENCY_5,
+        0,
+        MHD_HTTP_OK),
+      TALER_TESTING_cmd_withdraw_amount (
+        "withdraw-coin-3",
+        "create-reserve-2",
+        CURRENCY_5,
+        0,
+        MHD_HTTP_OK),
+      TALER_TESTING_cmd_merchant_post_orders (
+        "create-twocoins-proposal",
+        cred.cfg,
+        merchant_url,
+        MHD_HTTP_OK,
+        NULL, /* use random order ID */
+        GNUNET_TIME_UNIT_ZERO_TS,
+        GNUNET_TIME_UNIT_FOREVER_TS,
+        CURRENCY_10),
+      TALER_TESTING_cmd_merchant_pay_order (
+        "deposit-twocoins",
+        merchant_url,
+        MHD_HTTP_OK,
+        "create-twocoins-proposal",
+        "withdraw-coin-2;withdraw-coin-3",
+        CURRENCY_10,
+        CURRENCY_9_98,
+        NULL),
+      TALER_TESTING_cmd_exec_aggregator (
+        "aggregate-twocoins",
+        cfg_filename),
+      TALER_TESTING_cmd_exec_transfer (
+        "transfer-twocoins",
+        cfg_filename),
+      TALER_TESTING_cmd_rewind_ip (
+        "rewind-twocoins",
+        "create-reserve-2",
+        twocoins_number),
       TALER_TESTING_cmd_end ()
     };
 
@@ -386,21 +417,6 @@ run (void *cls,
 }
 
 
-/**
- * Send SIGTERM and wait for process termination.
- *
- * @param process process to terminate.
- */
-static void
-terminate_process (struct GNUNET_OS_Process *process)
-{
-  GNUNET_OS_process_kill (process,
-                          SIGTERM);
-  GNUNET_OS_process_wait (process);
-  GNUNET_OS_process_destroy (process);
-}
-
-
 /**
  * The main function of the serve tool
  *
@@ -415,11 +431,20 @@ main (int argc,
   char *loglev = NULL;
   char *logfile = NULL;
   char *exchange_account = NULL;
-  struct GNUNET_OS_Process *bankd;
-  struct GNUNET_OS_Process *merchantd;
   struct GNUNET_GETOPT_CommandLineOption *options;
   struct GNUNET_GETOPT_CommandLineOption root_options[] = {
     GNUNET_GETOPT_option_cfgfile (&cfg_filename),
+    GNUNET_GETOPT_option_string (
+      'u',
+      "exchange-account-section",
+      "SECTION",
+      "use exchange bank account configuration from the given SECTION",
+      &exchange_bank_section),
+    GNUNET_GETOPT_option_flag (
+      'f',
+      "fakebank",
+      "use fakebank for the banking system",
+      &use_fakebank),
     GNUNET_GETOPT_option_version (PACKAGE_VERSION " " VCS_VERSION),
     GNUNET_GETOPT_option_help ("Runs benchmark logic against merchant backend. 
"
                                "Must be used with either 'ordinary' or 
'corner' sub-commands."),
@@ -450,12 +475,17 @@ main (int argc,
                                "TC",
                                "will perform TC 2-coins payments, defaults to 
1",
                                &twocoins_number),
-    GNUNET_GETOPT_option_mandatory (
-      GNUNET_GETOPT_option_string ('e',
-                                   "exchange-account",
-                                   "SECTION",
-                                   "configuration section specifying the 
exchange account to use, mandatory",
-                                   &exchange_account)),
+    GNUNET_GETOPT_option_string (
+      'u',
+      "exchange-account-section",
+      "SECTION",
+      "use exchange bank account configuration from the given SECTION",
+      &exchange_bank_section),
+    GNUNET_GETOPT_option_flag (
+      'f',
+      "fakebank",
+      "use fakebank for the banking system",
+      &use_fakebank),
     GNUNET_GETOPT_option_string ('a',
                                  "apikey",
                                  "APIKEY",
@@ -517,19 +547,26 @@ main (int argc,
   }
 
   {
-    int result;
+    enum GNUNET_GenericReturnValue result;
 
     result = GNUNET_GETOPT_run ("taler-merchant-benchmark",
                                 options,
                                 argc,
                                 argv);
-    if (GNUNET_SYSERR == result)
+    switch (result)
     {
-      return PG_BAD_OPTIONS;
+    case GNUNET_SYSERR:
+      return EXIT_INVALIDARGUMENT;
+    case GNUNET_NO:
+      return EXIT_SUCCESS;
+    case GNUNET_OK:
+      break;
     }
-    if (0 == result)
-      return PG_SUCCESS;
   }
+  if (NULL == exchange_bank_section)
+    exchange_bank_section = "exchange-account-1";
+  if (NULL == loglev)
+    loglev = "INFO";
   GNUNET_log_setup ("taler-merchant-benchmark",
                     loglev,
                     logfile);
@@ -537,7 +574,7 @@ main (int argc,
        (! corner) )
   {
     TALER_LOG_ERROR ("Please use 'ordinary' or 'corner' subcommands.\n");
-    return PG_NO_SUBCOMMAND;
+    return EXIT_INVALIDARGUMENT;
   }
   if (NULL == cfg_filename)
     cfg_filename = (char *) default_config_file;
@@ -551,7 +588,7 @@ main (int argc,
                                    cfg_filename))
     {
       TALER_LOG_ERROR ("Could not parse configuration\n");
-      return PG_BAD_CONFIG_FILE;
+      return EXIT_NOTCONFIGURED;
     }
     if (GNUNET_OK !=
         TALER_config_get_currency (cfg,
@@ -559,56 +596,59 @@ main (int argc,
     {
       TALER_LOG_ERROR ("Failed to read currency from configuration\n");
       GNUNET_CONFIGURATION_destroy (cfg);
-      return PG_FAILED_CFG_CURRENCY;
+      return EXIT_NOTCONFIGURED;
     }
+    if (GNUNET_OK !=
+        GNUNET_CONFIGURATION_get_value_string (cfg,
+                                               "merchant-benchmark",
+                                               "MERCHANT_URL",
+                                               &merchant_url))
+    {
+      GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+                                 "merchant-benchmark",
+                                 "MERCHANT_URL");
+      GNUNET_CONFIGURATION_destroy (cfg);
+      return EXIT_NOTCONFIGURED;
+    }
+    if ( (0 == strlen (merchant_url)) ||
+         (merchant_url[strlen (merchant_url) - 1] != '/') )
+    {
+      GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
+                                 "merchant-benchmark",
+                                 "MERCHANT_URL",
+                                 "Not a valid URL");
+      GNUNET_CONFIGURATION_destroy (cfg);
+      return EXIT_NOTCONFIGURED;
+    }
+
+    if (GNUNET_OK !=
+        TALER_TESTING_get_credentials (
+          cfg_filename,
+          exchange_bank_section,
+          use_fakebank
+          ? TALER_TESTING_BS_FAKEBANK
+          : TALER_TESTING_BS_IBAN,
+          &cred))
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                  "Required bank credentials not given in configuration\n");
+      GNUNET_free (cfg_filename);
+      return EXIT_NOTCONFIGURED;
+    }
+
     GNUNET_CONFIGURATION_destroy (cfg);
   }
-  /* prepare merchant and bank */
-  merchant_url = TALER_TESTING_prepare_merchant (cfg_filename);
-  if (NULL == merchant_url)
-  {
-    TALER_LOG_ERROR ("Failed to prepare for the merchant\n");
-    return PG_FAILED_TO_PREPARE_MERCHANT;
-  }
-  GNUNET_assert (0 < strlen (merchant_url));
-  GNUNET_assert (merchant_url[strlen (merchant_url) - 1] == '/');
   GNUNET_assert (0 < GNUNET_asprintf (&alt_instance_url,
                                       "%sinstances/%s/",
                                       merchant_url,
                                       alt_instance_id));
-  if (GNUNET_OK !=
-      TALER_TESTING_prepare_bank (cfg_filename,
-                                  GNUNET_NO,
-                                  exchange_account,
-                                  &bc))
-  {
-    TALER_LOG_ERROR ("Failed to prepare for the bank\n");
-    return PG_FAILED_TO_PREPARE_BANK;
-  }
-  /* launch merchant and bank */
-  if (NULL == (merchantd = TALER_TESTING_run_merchant (cfg_filename,
-                                                       merchant_url)))
-  {
-    TALER_LOG_ERROR ("Failed to launch the merchant\n");
-    return PG_FAILED_TO_LAUNCH_MERCHANT;
-  }
-  if (NULL == (bankd = TALER_TESTING_run_bank (cfg_filename,
-                                               
bc.exchange_auth.wire_gateway_url)))
   {
-    TALER_LOG_ERROR ("Failed to run the bank\n");
-    terminate_process (merchantd);
-    return PG_FAILED_TO_LAUNCH_BANK;
-  }
+    enum GNUNET_GenericReturnValue result;
 
-  /* launch exchange and run benchmark */
-  {
-    int result;
-
-    result = TALER_TESTING_xxx (&run,
-                                NULL,
-                                cfg_filename);
-    terminate_process (merchantd);
-    terminate_process (bankd);
-    return (GNUNET_OK == result) ? 0 : PG_RUNTIME_FAILURE;
+    result = TALER_TESTING_loop (&run,
+                                 NULL);
+    return (GNUNET_OK == result)
+      ? 0
+      : EXIT_FAILURE;
   }
 }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]