[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 01/02: Testing: Make testing_api_cmd_netjail_start_cmds_helper.
From: |
gnunet |
Subject: |
[gnunet] 01/02: Testing: Make testing_api_cmd_netjail_start_cmds_helper.c compile. |
Date: |
Sun, 19 May 2024 14:18:17 +0200 |
This is an automated email from the git hooks/post-receive script.
t3sserakt pushed a commit to branch master
in repository gnunet.
commit 4f53b18171ddb7cec30be31ca5dbffb5ca35c8a7
Author: t3sserakt <t3ss@posteo.de>
AuthorDate: Sun May 19 14:11:33 2024 +0200
Testing: Make testing_api_cmd_netjail_start_cmds_helper.c compile.
---
.../testing_api_cmd_netjail_start_cmds_helper.c | 78 +++-------------------
1 file changed, 9 insertions(+), 69 deletions(-)
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 b8eaed044..4236f0da2 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
@@ -29,6 +29,7 @@
#include "netjail.h"
#include "testing_api_loop.h"
#include "testing_cmds.h"
+#include "netjail.h"
/**
@@ -90,6 +91,8 @@ struct NetJailState
*/
struct TestingSystemCount *tbc_tail;
+ char *topology_data;
+
/**
* Size of the array @e helpers.
*/
@@ -321,10 +324,14 @@ send_start_messages (struct NetJailState *ns,
struct TestingSystemCount *tbc;
struct GNUNET_ShortHashCode *bar;
unsigned int num_barriers = 0;
- size_t topo_length = strlen (ns->topology_data) + 1;
+ size_t topo_length;
size_t msg_len;
-
+ topo_cmd = GNUNET_TESTING_interpreter_lookup_command (is,
+ ns->topology_cmd_label);
+ GNUNET_TESTING_get_trait_get_topology_string (topo_cmd,
+ &ns->topology_data);
+ topo_length = strlen (ns->topology_data) + 1;
msg_len = sizeof (*msg) + topo_length
+ num_barriers * sizeof (struct GNUNET_ShortHashCode);
// FIXME: check for integer arithmetic overflow in the above code;
theoretically.
@@ -546,70 +553,3 @@ GNUNET_TESTING_cmd_netjail_start_helpers (
&netjail_exec_traits,
&ns->ac);
}
-
-
-#if MOVEME
-/**
- * Create command.
- *
- * @param label Name for the command.
- * @param topology_data_file topology data file name
- * @param timeout Before this timeout is reached this cmd MUST finish.
- * @return command.
- */
-struct GNUNET_TESTING_Command
-GNUNET_TESTING_cmd_netjail_start_helpers2 (
- const char *label,
- const char *topology_data_file,
- struct GNUNET_TIME_Relative timeout)
-{
- uint64_t fs;
- char *data;
- struct GNUNET_TESTING_NetjailTopology *topo;
-
- if (GNUNET_YES !=
- GNUNET_DISK_file_test (topology_data_file))
- {
- LOG (GNUNET_ERROR_TYPE_ERROR,
- "Topology file %s not found\n",
- topology_data_file);
- GNUNET_assert (0);
- }
- if (GNUNET_OK !=
- GNUNET_DISK_file_size (topology_data_file,
- &fs,
- GNUNET_YES,
- GNUNET_YES))
- {
- LOG (GNUNET_ERROR_TYPE_ERROR,
- "Could not determine size of topology file %s\n",
- topology_data_file);
- GNUNET_assert (0);
- }
- data = GNUNET_malloc_large (fs + 1);
- GNUNET_assert (NULL != data);
- if (fs !=
- GNUNET_DISK_fn_read (topology_data_file,
- data,
- fs))
- {
- LOG (GNUNET_ERROR_TYPE_ERROR,
- "Topology file %s cannot be read\n",
- topology_data_file);
- GNUNET_free (data);
- return NULL;
- }
-
- {
- struct GNUNET_TESTING_Command cmd;
-
- cmd = GNUNET_TESTING_cmd_netjail_start_helpers (label,
- data,
- timeout);
- GNUNET_free (data);
- return cmd;
- }
-}
-
-
-#endif
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.