gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] branch master updated: add wirewatch comma


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated: add wirewatch command to testcase (not yet active), for #5077
Date: Sun, 10 Dec 2017 14:25:17 +0100

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

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new d36de3b  add wirewatch command to testcase (not yet active), for #5077
d36de3b is described below

commit d36de3bdd6b4e5d88b8c44e525c4eeab43b26837
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Dec 10 14:25:15 2017 +0100

    add wirewatch command to testcase (not yet active), for #5077
---
 src/exchange-lib/test_exchange_api.c | 60 ++++++++++++++++++++++++++++++++++--
 1 file changed, 58 insertions(+), 2 deletions(-)

diff --git a/src/exchange-lib/test_exchange_api.c 
b/src/exchange-lib/test_exchange_api.c
index 16d7e05..7811ffa 100644
--- a/src/exchange-lib/test_exchange_api.c
+++ b/src/exchange-lib/test_exchange_api.c
@@ -142,6 +142,11 @@ enum OpCode
   OC_RUN_AGGREGATOR,
 
   /**
+   * Run the wirewatcher to check for incoming transactions.
+   */
+  OC_RUN_WIREWATCH,
+
+  /**
    * Check that the fakebank has received a certain transaction.
    */
   OC_CHECK_BANK_TRANSFER,
@@ -611,6 +616,20 @@ struct Command
     struct {
 
       /**
+       * Process for the wirewatcher.
+       */
+      struct GNUNET_OS_Process *wirewatch_proc;
+
+      /**
+       * ID of task called whenever we get a SIGCHILD.
+       */
+      struct GNUNET_SCHEDULER_Task *child_death_task;
+
+    } run_wirewatch;
+
+    struct {
+
+      /**
        * Which amount do we expect to see transferred?
        */
       const char *amount;
@@ -677,7 +696,7 @@ struct Command
       const char *ref;
 
       /**
-       * Process for the aggregator.
+       * Process for the revocation process.
        */
       struct GNUNET_OS_Process *revoke_proc;
 
@@ -1406,6 +1425,14 @@ maint_child_death (void *cls)
     GNUNET_OS_process_destroy (cmd->details.run_aggregator.aggregator_proc);
     cmd->details.run_aggregator.aggregator_proc = NULL;
     break;
+  case OC_RUN_WIREWATCH:
+    cmd->details.run_wirewatch.child_death_task = NULL;
+    pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ);
+    GNUNET_break (0 < GNUNET_DISK_file_read (pr, &c, sizeof (c)));
+    GNUNET_OS_process_wait (cmd->details.run_wirewatch.wirewatch_proc);
+    GNUNET_OS_process_destroy (cmd->details.run_wirewatch.wirewatch_proc);
+    cmd->details.run_wirewatch.wirewatch_proc = NULL;
+    break;
   case OC_REVOKE:
     cmd->details.revoke.child_death_task = NULL;
     pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ);
@@ -2574,13 +2601,42 @@ interpreter_run (void *cls)
         fail (is);
         return;
       }
-      pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ);
+      pr = GNUNET_DISK_pipe_handle (sigpipe,
+                                    GNUNET_DISK_PIPE_END_READ);
       cmd->details.run_aggregator.child_death_task
         = GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
                                           pr,
                                           &maint_child_death, is);
       return;
     }
+  case OC_RUN_WIREWATCH:
+    {
+      const struct GNUNET_DISK_FileHandle *pr;
+
+      cmd->details.run_wirewatch.wirewatch_proc
+        = GNUNET_OS_start_process (GNUNET_NO,
+                                   GNUNET_OS_INHERIT_STD_ALL,
+                                   NULL, NULL, NULL,
+                                   "taler-exchange-wirewatch",
+                                   "taler-exchange-wirewatch",
+                                   "-c", "test_exchange_api.conf",
+                                   "-t", "test", /* use Taler's bank/fakebank 
*/
+                                   "-T", /* exit when done */
+                                   NULL);
+      if (NULL == cmd->details.run_wirewatch.wirewatch_proc)
+      {
+        GNUNET_break (0);
+        fail (is);
+        return;
+      }
+      pr = GNUNET_DISK_pipe_handle (sigpipe,
+                                    GNUNET_DISK_PIPE_END_READ);
+      cmd->details.run_wirewatch.child_death_task
+        = GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
+                                          pr,
+                                          &maint_child_death, is);
+      return;
+    }
   case OC_CHECK_BANK_TRANSFER:
     {
       if (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]