gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] 02/02: reset auditor tables upon running t


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] 02/02: reset auditor tables upon running tests, + upgrade "twisted" config file.
Date: Mon, 23 Apr 2018 17:25:23 +0200

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

marcello pushed a commit to branch master
in repository exchange.

commit a9ff9a0bbe39be3b0bc23ddebc13c0047d414554
Author: Marcello Stanisci <address@hidden>
AuthorDate: Mon Apr 23 17:20:14 2018 +0200

    reset auditor tables upon running tests, + upgrade "twisted" config file.
---
 src/exchange-lib/test_exchange_api_twisted.conf | 34 ++++++++++++++++++
 src/exchange-lib/testing_api_helpers.c          | 48 ++++++++++++++++++++++++-
 2 files changed, 81 insertions(+), 1 deletion(-)

diff --git a/src/exchange-lib/test_exchange_api_twisted.conf 
b/src/exchange-lib/test_exchange_api_twisted.conf
index b04d9f4..2b52eb4 100644
--- a/src/exchange-lib/test_exchange_api_twisted.conf
+++ b/src/exchange-lib/test_exchange_api_twisted.conf
@@ -130,6 +130,40 @@ BANK_URL = "http://localhost:8082/";
 # From which account at the 'bank' should outgoing wire transfers be made?
 BANK_ACCOUNT_NUMBER = 2
 
+[account-2]
+URL = payto://x-taler-bank/localhost:8082/2
+PLUGIN = taler_bank
+WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-2.json
+TALER_BANK_AUTH_METHOD = "basic"
+USERNAME = user
+PASSWORD = pass
+ENABLE_DEBIT = YES
+ENABLE_CREDIT = YES
+
+[fees-x-taler-bank]
+# Fees for the forseeable future...
+# If you see this after 2017, update to match the next 10 years...
+WIRE-FEE-2018 = EUR:0.01
+WIRE-FEE-2019 = EUR:0.01
+WIRE-FEE-2020 = EUR:0.01
+WIRE-FEE-2021 = EUR:0.01
+WIRE-FEE-2022 = EUR:0.01
+WIRE-FEE-2023 = EUR:0.01
+WIRE-FEE-2024 = EUR:0.01
+WIRE-FEE-2025 = EUR:0.01
+WIRE-FEE-2026 = EUR:0.01
+WIRE-FEE-2027 = EUR:0.01
+
+CLOSING-FEE-2018 = EUR:0.01
+CLOSING-FEE-2019 = EUR:0.01
+CLOSING-FEE-2020 = EUR:0.01
+CLOSING-FEE-2021 = EUR:0.01
+CLOSING-FEE-2022 = EUR:0.01
+CLOSING-FEE-2023 = EUR:0.01
+CLOSING-FEE-2024 = EUR:0.01
+CLOSING-FEE-2025 = EUR:0.01
+CLOSING-FEE-2026 = EUR:0.01
+CLOSING-FEE-2027 = EUR:0.01
 
 [coin_eur_ct_1]
 value = EUR:0.01
diff --git a/src/exchange-lib/testing_api_helpers.c 
b/src/exchange-lib/testing_api_helpers.c
index 8bf66ef..31f28d0 100644
--- a/src/exchange-lib/testing_api_helpers.c
+++ b/src/exchange-lib/testing_api_helpers.c
@@ -185,6 +185,7 @@ TALER_TESTING_prepare_exchange (const char *config_filename,
   GNUNET_OS_process_wait (proc);
   GNUNET_OS_process_destroy (proc);
 
+  /* Reset exchange database.  */
   proc = GNUNET_OS_start_process (GNUNET_NO,
                                   GNUNET_OS_INHERIT_STD_ALL,
                                   NULL, NULL, NULL,
@@ -215,7 +216,7 @@ TALER_TESTING_prepare_exchange (const char *config_filename,
        (0 != code) )
   {
     fprintf (stderr,
-             "Failed to setup database\n");
+             "Failed to setup (exchange) database\n");
     return GNUNET_NO;
   }
   if ( (type != GNUNET_OS_PROCESS_EXITED) ||
@@ -227,6 +228,51 @@ TALER_TESTING_prepare_exchange (const char 
*config_filename,
     return GNUNET_SYSERR;
   }
 
+
+  /* Reset auditor database.  */
+
+  proc = GNUNET_OS_start_process (GNUNET_NO,
+                                  GNUNET_OS_INHERIT_STD_ALL,
+                                  NULL, NULL, NULL,
+                                  "taler-auditor-dbinit",
+                                  "taler-auditor-dbinit",
+                                  "-c", config_filename,
+                                  "-r",
+                                  NULL);
+  if (NULL == proc)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+               "Failed to run `taler-auditor-dbinit`,"
+                " is your PATH correct?\n");
+
+    return GNUNET_NO;
+  }
+  if (GNUNET_SYSERR ==
+      GNUNET_OS_process_wait_status (proc,
+                                     &type,
+                                     &code))
+  {
+    GNUNET_break (0);
+    GNUNET_OS_process_destroy (proc);
+    return GNUNET_SYSERR;
+  }
+  GNUNET_OS_process_destroy (proc);
+  if ( (type == GNUNET_OS_PROCESS_EXITED) &&
+       (0 != code) )
+  {
+    fprintf (stderr,
+             "Failed to setup (auditor) database\n");
+    return GNUNET_NO;
+  }
+  if ( (type != GNUNET_OS_PROCESS_EXITED) ||
+       (0 != code) )
+  {
+    fprintf (stderr,
+             "Unexpected error running"
+             " `taler-auditor-dbinit'!\n");
+    return GNUNET_SYSERR;
+  }
+
   return GNUNET_OK;
 }
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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