gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated: -fixes on FTBFS


From: gnunet
Subject: [gnunet] branch master updated: -fixes on FTBFS
Date: Sun, 19 May 2024 13:24:43 +0200

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

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 708fa478b -fixes on FTBFS
708fa478b is described below

commit 708fa478bdefb715c6ccd91df595a118e0a4c84c
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun May 19 13:24:40 2024 +0200

    -fixes on FTBFS
---
 src/include/gnunet_testing_lib.h                   | 10 ++++----
 src/lib/testing/barrier.h                          |  2 +-
 src/lib/testing/testing_api_cmd_barrier.c          |  2 +-
 src/lib/testing/testing_api_cmd_exec.c             |  4 +--
 src/lib/testing/testing_api_cmd_finish.c           |  7 ++----
 src/lib/testing/testing_api_cmd_netjail_start.c    | 27 ++++++++++++--------
 .../testing_api_cmd_netjail_start_cmds_helper.c    | 10 +++++---
 src/lib/testing/testing_api_loop.h                 |  6 +++++
 src/lib/testing/testing_cmds.h                     | 29 ----------------------
 9 files changed, 39 insertions(+), 58 deletions(-)

diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h
index c1799219c..74e734032 100644
--- a/src/include/gnunet_testing_lib.h
+++ b/src/include/gnunet_testing_lib.h
@@ -450,13 +450,13 @@ GNUNET_TESTING_cmd_sleep (const char *label,
  * Command to execute a command.
  *
  * @param label Label of the command.
- * @param script The name of the program to run.
- * @param script_argv The arguments of the script.
 */
 const struct GNUNET_TESTING_Command
-GNUNET_TESTING_cmd_exec (const char *label,
-                         const char *script,
-                         char *const script_argv[]);
+GNUNET_TESTING_cmd_exec (
+  const char *label,
+  enum GNUNET_OS_ProcessStatusType expected_type,
+  unsigned long int expected_exit_code,
+  char *const script_argv[]);
 
 
 /**
diff --git a/src/lib/testing/barrier.h b/src/lib/testing/barrier.h
index e174caa91..bf777d9cf 100644
--- a/src/lib/testing/barrier.h
+++ b/src/lib/testing/barrier.h
@@ -40,7 +40,7 @@ struct GNUNET_TESTING_Barrier
    * currently blocked on this barrier, or NULL if
    * no command is currently blocked on this barrier.
    */
-  struct GNUNET_TESTING_AsyncContext *ac;
+  struct GNUNET_TESTING_AsyncContext *cmd_ac;
 
   /**
    * Number of total commands expected to be reached by the barrier.
diff --git a/src/lib/testing/testing_api_cmd_barrier.c 
b/src/lib/testing/testing_api_cmd_barrier.c
index edeeb0089..582df792d 100644
--- a/src/lib/testing/testing_api_cmd_barrier.c
+++ b/src/lib/testing/testing_api_cmd_barrier.c
@@ -97,7 +97,7 @@ GNUNET_TESTING_cmd_barrier_create (
   barrier = GNUNET_new (struct GNUNET_TESTING_Barrier);
   GNUNET_TESTING_barrier_name_hash_ (label,
                                      &barrier->barrier_id);
-  barrier->number_to_be_reached = number_to_be_reached;
+  barrier->expected_reaches = number_to_be_reached;
   return GNUNET_TESTING_command_new (barrier,
                                      label,
                                      &barrier_run,
diff --git a/src/lib/testing/testing_api_cmd_exec.c 
b/src/lib/testing/testing_api_cmd_exec.c
index 9416cf228..e452ce4b3 100644
--- a/src/lib/testing/testing_api_cmd_exec.c
+++ b/src/lib/testing/testing_api_cmd_exec.c
@@ -25,7 +25,7 @@
  */
 #include "platform.h"
 #include "gnunet_util_lib.h"
-#include "gnunet_testing_ng_lib.h"
+#include "gnunet_testing_lib.h"
 
 #define LOG(kind, ...) GNUNET_log (kind, __VA_ARGS__)
 
@@ -141,8 +141,6 @@ exec_bash_script_run (void *cls,
 {
   struct BashScriptState *bss = cls;
 
-  bss->cmd
-    = GNUNET_TESTING_interpreter_get_current_command (is);
   bss->start_proc
     = GNUNET_OS_start_process_vap (
         GNUNET_OS_INHERIT_STD_ERR,
diff --git a/src/lib/testing/testing_api_cmd_finish.c 
b/src/lib/testing/testing_api_cmd_finish.c
index 41cc6bd50..7abcb5bb9 100644
--- a/src/lib/testing/testing_api_cmd_finish.c
+++ b/src/lib/testing/testing_api_cmd_finish.c
@@ -24,10 +24,7 @@
  */
 #include "platform.h"
 #include "gnunet_util_lib.h"
-#include "gnunet_testing_ng_lib.h"
-#include "gnunet_testing_plugin.h"
-#include "gnunet_testing_barrier.h"
-#include "gnunet_testing_netjail_lib.h"
+#include "gnunet_testing_lib.h"
 
 
 /**
@@ -50,7 +47,7 @@ struct FinishState
   /**
    * Function to call when async operation is done.
    */
-  GNUNET_SCHEDULER_Task old_notify;
+  GNUNET_SCHEDULER_TaskCallback old_notify;
 
   /**
    * Closure for @e notify_finished.
diff --git a/src/lib/testing/testing_api_cmd_netjail_start.c 
b/src/lib/testing/testing_api_cmd_netjail_start.c
index 51223f239..e81622133 100644
--- a/src/lib/testing/testing_api_cmd_netjail_start.c
+++ b/src/lib/testing/testing_api_cmd_netjail_start.c
@@ -25,10 +25,7 @@
  */
 #include "platform.h"
 #include "gnunet_util_lib.h"
-#include "gnunet_testing_ng_lib.h"
-#include "gnunet_testing_plugin.h"
-#include "gnunet_testing_barrier.h"
-#include "gnunet_testing_netjail_lib.h"
+#include "gnunet_testing_lib.h"
 
 
 #define LOG(kind, ...) GNUNET_log (kind, __VA_ARGS__)
@@ -54,17 +51,13 @@ struct NetJailState
   /**
    * Configuration file for the test topology.
    */
-  const char *topology_config;
+  const char *topology_cmd_label;
 
   /**
    * Start or stop?
    */
   const char *script;
 
-  /**
-   * Shall we read the topology from file, or from a string.
-   */
-  bool read_file;
 };
 
 
@@ -135,11 +128,23 @@ netjail_start_run (void *cls,
                    struct GNUNET_TESTING_Interpreter *is)
 {
   struct NetJailState *ns = cls;
+  const struct GNUNET_TESTING_Command *topo_cmd;
   char pid[15];
   enum GNUNET_GenericReturnValue helper_check;
   char *data_dir;
   char *script_name;
+  const char *topology_data;
 
+  topo_cmd = GNUNET_TESTING_interpreter_lookup_command (
+    is,
+    ns->topology_cmd_label);
+  if (NULL == topo_cmd)
+  {
+    GNUNET_break (0);
+    GNUNET_TESTING_interpreter_fail (is);
+    return;
+  }
+  // FIXME: get topology_data from topo_cmd trait!
   data_dir = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR);
   GNUNET_asprintf (&script_name,
                    "%s%s",
@@ -173,9 +178,9 @@ netjail_start_run (void *cls,
   {
     char *const script_argv[] = {
       script_name,
-      ns->topology_config,
+      (char *) topology_data,
       pid, // FIXME: use $PPID!
-      ns->read_file ? "1" : "0",
+      "0",
       NULL
     };
 
diff --git a/src/lib/testing/testing_api_cmd_netjail_start_cmds_helper.c 
b/src/lib/testing/testing_api_cmd_netjail_start_cmds_helper.c
index 494661bef..a813cbf27 100644
--- a/src/lib/testing/testing_api_cmd_netjail_start_cmds_helper.c
+++ b/src/lib/testing/testing_api_cmd_netjail_start_cmds_helper.c
@@ -23,8 +23,11 @@
  * @author t3sserakt
  */
 #include "platform.h"
+#include "gnunet_util_lib.h"
 #include "gnunet_testing_lib.h"
 #include "barrier.h"
+#include "testing_api_loop.h"
+#include "testing_cmds.h"
 
 
 /**
@@ -64,7 +67,7 @@ struct NetJailState
   /**
    * Array with handles of helper processes.
    */
-  const struct GNUNET_HELPER_Handle **helpers;
+  struct GNUNET_HELPER_Handle **helpers;
 
   /**
    * Time after this cmd has to finish.
@@ -129,6 +132,7 @@ struct TestingSystemCount
    */
   struct NetJailState *ns;
 
+
 };
 
 
@@ -253,7 +257,7 @@ helper_mst (void *cls,
             const struct GNUNET_MessageHeader *message)
 {
   struct NetJailState *ns = cls;
-  struct GNUNET_MQ_MessageHandlers handlers[] = {
+  struct GNUNET_MQ_MessageHandler handlers[] = {
     GNUNET_MQ_hd_fixed_size (
       helper_barrier_reached,
       GNUNET_MESSAGE_TYPE_CMDS_HELPER_BARRIER_REACHED,
@@ -364,7 +368,7 @@ send_start_messages (struct NetJailState *ns,
  * Function which start a single helper process.
  * @return true on success
  */
-static void
+static bool
 start_helper (struct NetJailState *ns,
               unsigned int script_num)
 {
diff --git a/src/lib/testing/testing_api_loop.h 
b/src/lib/testing/testing_api_loop.h
index a6999673b..fee526ec1 100644
--- a/src/lib/testing/testing_api_loop.h
+++ b/src/lib/testing/testing_api_loop.h
@@ -50,6 +50,12 @@ GNUNET_TESTING_loop_notify_children_ (struct 
GNUNET_TESTING_Interpreter *is,
                                       const struct GNUNET_MessageHeader *hdr);
 
 
+/**
+ * Adding a helper handle to the interpreter.
+ *
+ * @param is The interpreter.
+ * @param helper The helper handle.
+ */
 void
 GNUNET_TESTING_add_netjail_helper_ (struct GNUNET_TESTING_Interpreter *is,
                                     struct GNUNET_HELPER_Handle *helper);
diff --git a/src/lib/testing/testing_cmds.h b/src/lib/testing/testing_cmds.h
index 3476e6d05..3493dbbf9 100644
--- a/src/lib/testing/testing_cmds.h
+++ b/src/lib/testing/testing_cmds.h
@@ -102,34 +102,5 @@ struct GNUNET_TESTING_CommandBarrierSatisfied
 
 GNUNET_NETWORK_STRUCT_END
 
-/**
- * Global state of the interpreter, used by a command
- * to access information about other commands.
- */
-struct GNUNET_TESTING_Interpreter;
-
-
-/**
- * Returns the actual running command.
- *
- * @param is Global state of the interpreter, used by a command
- *        to access information about other commands.
- * @return The actual running command.
- */
-struct GNUNET_TESTING_Command *
-GNUNET_TESTING_interpreter_get_current_command (
-  struct GNUNET_TESTING_Interpreter *is);
-
-
-/**
- * Adding a helper handle to the interpreter.
- *
- * @param is The interpreter.
- * @param helper The helper handle.
- */
-void
-GNUNET_TESTING_add_netjail_helper_ (struct GNUNET_TESTING_Interpreter *is,
-                                    const struct GNUNET_HELPER_Handle *helper);
-
 #endif
 /* end of testing_cmds.h */

-- 
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]