gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: Aggregator tests execute first C


From: gnunet
Subject: [taler-exchange] branch master updated: Aggregator tests execute first CMD.
Date: Thu, 16 Jan 2020 14:41:09 +0100

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

marcello pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 1fc8fd22 Aggregator tests execute first CMD.
1fc8fd22 is described below

commit 1fc8fd22dc417f151e28a63dfc6fd58cf4b10b2e
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu Jan 16 14:40:28 2020 +0100

    Aggregator tests execute first CMD.
---
 .../test-taler-exchange-aggregator-postgres.conf   | 10 ++++--
 src/lib/test_taler_exchange_aggregator.c           | 38 +++++++++++++++-------
 2 files changed, 34 insertions(+), 14 deletions(-)

diff --git a/src/lib/test-taler-exchange-aggregator-postgres.conf 
b/src/lib/test-taler-exchange-aggregator-postgres.conf
index b6c18fd5..9ee6c6b0 100644
--- a/src/lib/test-taler-exchange-aggregator-postgres.conf
+++ b/src/lib/test-taler-exchange-aggregator-postgres.conf
@@ -20,6 +20,12 @@ MASTER_PUBLIC_KEY = 
98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
 # the tracking API.
 BASE_URL = "https://exchange.taler.net/";
 
+[auditor]
+BASE_URL = "http://auditor.example.com/";
+
+[auditordb-postgres]
+CONFIG = "postgres:///talercheck"
+
 [exchangedb]
 # After how long do we close idle reserves?  The exchange
 # and the auditor must agree on this value.  We currently
@@ -34,7 +40,6 @@ IDLE_RESERVE_EXPIRATION_TIME = 4 weeks
 #The connection string the plugin has to use for connecting to the database
 CONFIG = postgres:///talercheck
 
-
 [exchangedb]
 
 # After how long do we close idle reserves?  The exchange
@@ -53,9 +58,8 @@ LEGAL_RESERVE_EXPIRATION_TIME = 7 years
 
 # What is the account URL?
 URL = "payto://x-taler-bank/localhost:8082/3"
-
+method = "x-taler-bank"
 WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json
-PLUGIN = "taler_bank"
 ENABLE_DEBIT = YES
 ENABLE_CREDIT = YES
 TALER_BANK_AUTH_METHOD = NONE
diff --git a/src/lib/test_taler_exchange_aggregator.c 
b/src/lib/test_taler_exchange_aggregator.c
index 3ad14d34..075effc2 100644
--- a/src/lib/test_taler_exchange_aggregator.c
+++ b/src/lib/test_taler_exchange_aggregator.c
@@ -116,6 +116,7 @@ fake_coin (struct TALER_CoinPublicInfo *coin)
 }
 
 
+#if 0
 /**
  * Helper function to fake a deposit operation.
  *
@@ -208,6 +209,7 @@ do_deposit (struct Command *cmd)
   json_decref (deposit.receiver_wire_account);
   return ret;
 }
+#endif
 
 /**
  * Interprets the commands from the test program.
@@ -867,7 +869,8 @@ run_test ()
  * otherwise GNUNET_OK
  */
 static int
-prepare_database (const struct GNUNET_CONFIGURATION_Handle *cfg)
+prepare_database (void *cls,
+                 const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
 
   // connect to the database.
@@ -896,13 +899,20 @@ prepare_database (const struct 
GNUNET_CONFIGURATION_Handle *cfg)
 }
 
 
+/**
+ * Collects all the tests.
+ */
 static void
 run (void *cls,
      struct TALER_TESTING_Interpreter *is)
 {
-  if (GNUNET_OK != prepare_database (is->cfg))
-    return;
-
+  struct TALER_TESTING_Command all[] = {
+    TALER_TESTING_cmd_end ()  
+  };
+  
+  TALER_TESTING_run_with_fakebank (is,
+                                  all,
+                                  bc.bank_url);
 }
 
 int
@@ -915,11 +925,6 @@ main (int argc,
   struct GNUNET_CONFIGURATION_Handle *cfg;
   struct GNUNET_SIGNAL_Context *shc_chld;
 
-
-  /* these might get in the way */
-  unsetenv ("XDG_DATA_HOME");
-  unsetenv ("XDG_CONFIG_HOME");
-
   if (NULL == (plugin_name = strrchr (argv[0], (int) '-')))
   {
     GNUNET_break (0);
@@ -937,13 +942,17 @@ main (int argc,
                     "DEBUG",
                     NULL);
 
-
+  /* these might get in the way */
+  unsetenv ("XDG_DATA_HOME");
+  unsetenv ("XDG_CONFIG_HOME");
 
   TALER_TESTING_cleanup_files (config_filename);
+
+  // BUG: FAILS NOW.
   if (GNUNET_OK != TALER_TESTING_prepare_exchange (config_filename,
                                                   &ec))
   {
-    TALER_LOG_WARNING ("Could not prepare the exchange (keyup, ..)\n");
+    TALER_LOG_WARNING ("Could not prepare the exchange.\n");
     return 77;
   }
 
@@ -958,6 +967,13 @@ main (int argc,
   coin_pk = GNUNET_CRYPTO_rsa_private_key_create (1024);
   coin_pub = GNUNET_CRYPTO_rsa_private_key_get_public (coin_pk);
 
+  if (GNUNET_OK != GNUNET_CONFIGURATION_parse_and_run (config_filename,
+                                                      &prepare_database,
+                                                       NULL))
+  {
+    TALER_LOG_WARNING ("Could not prepare database for tests.\n");
+    return result;
+  }
 
   result = TALER_TESTING_setup (&run,
                                NULL,

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



reply via email to

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