gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] 03/08: Merge branch 'master' into dev/t3ss/tng


From: gnunet
Subject: [gnunet] 03/08: Merge branch 'master' into dev/t3ss/tng
Date: Tue, 09 Nov 2021 19:45:14 +0100

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

t3sserakt pushed a commit to branch master
in repository gnunet.

commit 513f23e74650db9408267e82ef8bcb8f770d1015
Merge: d190d2383 d64ac2698
Author: t3sserakt <t3ss@posteo.de>
AuthorDate: Fri Oct 15 21:02:03 2021 +0200

    Merge branch 'master' into dev/t3ss/tng

 Makefile.am                                        |   3 +-
 configure.ac                                       |  39 +-
 contrib/Makefile.am                                | 260 +++++--
 contrib/get_version.sh                             |  18 +
 contrib/gnunet.m4                                  |   2 +-
 contrib/scripts/Makefile.am                        |  63 +-
 contrib/scripts/testbed_cleanup.sh                 |  14 -
 .../30000_connections_90000_peers_30_poc.txt       |  37 -
 .../6000_connections_10000_peers_100_poc.txt       |  36 -
 .../6000_connections_10000_peers_20_poc.txt        |  36 -
 .../6000_connections_10000_peers_30_poc.txt        |  37 -
 .../6000_connections_20000_peers.txt               |  25 -
 .../6000_connections_40000_peers.txt               |  36 -
 .../6000_connections_60000_peers.txt               |  61 --
 .../6000_connections_60000_peers_5_poc.txt         |  36 -
 .../6000_connections_80000_peers_20_poc.txt        |  38 -
 .../6000_connections_80000_peers_5_poc.txt         |  22 -
 doc/handbook/chapters/developer.texi               |   3 -
 doc/handbook/chapters/keyconcepts.texi             |   8 +-
 po/POTFILES.in                                     |   4 +-
 src/Makefile.am                                    |   6 +-
 src/ats/Makefile.am                                |   2 -
 src/cadet/Makefile.am                              |   4 -
 src/consensus/Makefile.am                          |   2 -
 src/core/Makefile.am                               |   6 +-
 src/datacache/Makefile.am                          |   2 -
 src/datastore/Makefile.am                          |   6 -
 src/dht/Makefile.am                                |   6 -
 src/dht/gnunet-service-dht_neighbours.c            |   9 +-
 src/dhtu/Makefile.am                               |  34 +
 src/dhtu/plugin_dhtu_gnunet.c                      | 215 +++++-
 src/dhtu/test_dhtu_ip.c                            |  50 ++
 src/dhtu/testing_dhtu_cmd_send.c                   | 118 +++
 src/fs/Makefile.am                                 |   6 -
 src/identity/Makefile.am                           |   2 -
 src/include/gnunet_crypto_lib.h                    |   3 +-
 src/include/gnunet_messenger_service.h             |  47 +-
 src/include/gnunet_pq_lib.h                        | 102 ++-
 src/include/gnunet_testbed_service.h               |  18 -
 src/include/gnunet_testing_ng_lib.h                | 412 +++++------
 src/messenger/gnunet-messenger.c                   |  21 +-
 src/messenger/gnunet-service-messenger.c           |  51 +-
 src/messenger/gnunet-service-messenger_basement.c  |   8 +-
 src/messenger/gnunet-service-messenger_basement.h  |   8 +-
 src/messenger/gnunet-service-messenger_ego_store.c |  37 +-
 src/messenger/gnunet-service-messenger_ego_store.h |  21 +-
 src/messenger/gnunet-service-messenger_handle.c    |  79 +-
 src/messenger/gnunet-service-messenger_handle.h    |  40 +-
 .../gnunet-service-messenger_list_handles.c        |   9 +-
 .../gnunet-service-messenger_list_handles.h        |   9 +-
 .../gnunet-service-messenger_list_messages.c       |  15 +-
 .../gnunet-service-messenger_list_messages.h       |  15 +-
 src/messenger/gnunet-service-messenger_member.c    |  61 +-
 src/messenger/gnunet-service-messenger_member.h    |  28 +-
 .../gnunet-service-messenger_member_session.c      |  26 +-
 .../gnunet-service-messenger_member_session.h      |  12 +-
 .../gnunet-service-messenger_member_store.c        |  44 +-
 .../gnunet-service-messenger_member_store.h        |  21 +-
 .../gnunet-service-messenger_message_handle.c      |  51 +-
 .../gnunet-service-messenger_message_handle.h      |  48 +-
 .../gnunet-service-messenger_message_kind.c        |   6 +-
 .../gnunet-service-messenger_message_kind.h        |   6 +-
 .../gnunet-service-messenger_message_recv.c        |  32 +-
 .../gnunet-service-messenger_message_recv.h        |  18 +-
 .../gnunet-service-messenger_message_send.c        |  24 +-
 .../gnunet-service-messenger_message_send.h        |  24 +-
 .../gnunet-service-messenger_message_state.c       |  12 +-
 .../gnunet-service-messenger_message_state.h       |  12 +-
 .../gnunet-service-messenger_message_store.c       |  54 +-
 .../gnunet-service-messenger_message_store.h       |  21 +-
 src/messenger/gnunet-service-messenger_operation.c |   6 +-
 src/messenger/gnunet-service-messenger_operation.h |   6 +-
 .../gnunet-service-messenger_operation_store.c     |  20 +-
 .../gnunet-service-messenger_operation_store.h     |   3 +-
 src/messenger/gnunet-service-messenger_room.c      | 142 ++--
 src/messenger/gnunet-service-messenger_room.h      |  55 +-
 src/messenger/gnunet-service-messenger_service.c   |  37 +-
 src/messenger/gnunet-service-messenger_service.h   |  33 +-
 src/messenger/gnunet-service-messenger_tunnel.c    |  49 +-
 src/messenger/gnunet-service-messenger_tunnel.h    |  22 +-
 src/messenger/messenger_api.c                      |  90 ++-
 src/messenger/messenger_api_contact.c              |   6 +-
 src/messenger/messenger_api_contact.h              |   6 +-
 src/messenger/messenger_api_contact_store.c        |  22 +-
 src/messenger/messenger_api_contact_store.h        |  15 +-
 src/messenger/messenger_api_handle.c               |  29 +-
 src/messenger/messenger_api_handle.h               |  25 +-
 src/messenger/messenger_api_list_tunnels.c         |  22 +-
 src/messenger/messenger_api_list_tunnels.h         |  19 +-
 src/messenger/messenger_api_message.c              |  74 +-
 src/messenger/messenger_api_message.h              |  37 +-
 src/messenger/messenger_api_room.c                 |  75 +-
 src/messenger/messenger_api_room.h                 |  21 +-
 src/messenger/messenger_api_util.c                 |   6 +-
 src/messenger/messenger_api_util.h                 |   6 +-
 src/messenger/test_messenger.c                     |  10 +-
 src/messenger/test_messenger_adapt.c               |   3 +-
 src/messenger/test_messenger_anonymous.c           |  10 +-
 src/messenger/test_messenger_async_client.c        |   3 +-
 src/messenger/test_messenger_async_p2p.c           |   3 +-
 src/messenger/test_messenger_growth.c              |   3 +-
 src/messenger/test_messenger_ring.c                |   3 +-
 src/messenger/test_messenger_server.c              |   3 +-
 src/messenger/test_messenger_sync_client.c         |   3 +-
 src/messenger/test_messenger_sync_p2p.c            |   3 +-
 src/messenger/test_messenger_worst_client.c        |   3 +-
 src/messenger/test_messenger_worst_p2p.c           |   3 +-
 src/messenger/testing_messenger_barrier.c          |   6 +-
 src/messenger/testing_messenger_setup.c            |  41 +-
 src/messenger/testing_messenger_setup.h            |   3 +-
 src/namecache/Makefile.am                          |   8 -
 src/namestore/Makefile.am                          |   6 -
 src/nse/Makefile.am                                |   4 -
 src/nse/gnunet-service-nse.c                       |   2 +-
 src/peerinfo/Makefile.am                           |   2 -
 src/peerstore/Makefile.am                          |   2 -
 src/pq/pq.h                                        |   5 +
 src/pq/pq_connect.c                                | 158 ++--
 src/pq/pq_exec.c                                   |   2 +-
 src/pt/Makefile.am                                 |   4 -
 src/regex/Makefile.am                              |   2 -
 src/rps/Makefile.am                                |   4 -
 src/secretsharing/Makefile.am                      |   2 -
 src/set/Makefile.am                                |   4 -
 src/seti/Makefile.am                               |   4 -
 src/setu/Makefile.am                               |   4 -
 src/testbed/gnunet-testbed-profiler.c              |   4 -
 src/testbed/gnunet_testbed_mpi_spawn.c             | 327 ---------
 src/testbed/testbed_api_hosts.c                    |  35 -
 src/testbed/testbed_api_testbed.c                  |  11 -
 src/testing/Makefile.am                            |  19 +-
 src/testing/netjail_core.sh                        | 190 ++++-
 src/testing/netjail_core_v2.sh                     | 260 -------
 src/testing/netjail_exec.sh                        |   6 +-
 src/testing/netjail_exec_v2.sh                     |  14 -
 src/testing/netjail_start.sh                       |  70 +-
 src/testing/netjail_start_v2.sh                    |  74 --
 src/testing/netjail_stop.sh                        |  49 +-
 src/testing/netjail_stop_v2.sh                     |  59 --
 src/testing/test_testing_plugin_testcmd.c          |  19 +-
 src/testing/testing.c                              |  26 +
 src/testing/testing.h                              |  94 +--
 src/testing/testing_api_cmd_batch.c                |  86 +--
 ...testing_api_cmd_block_until_all_peers_started.c |  66 +-
 .../testing_api_cmd_block_until_external_trigger.c | 116 +--
 src/testing/testing_api_cmd_end.c                  |  39 +
 src/testing/testing_api_cmd_finish.c               | 198 +++++
 src/testing/testing_api_cmd_hello_world.c          |  65 +-
 src/testing/testing_api_cmd_hello_world_birth.c    |  10 +-
 src/testing/testing_api_cmd_local_test_finished.c  |  67 +-
 src/testing/testing_api_cmd_netjail_start.c        | 148 ++--
 .../testing_api_cmd_netjail_start_testsystem.c     | 319 +++++---
 .../testing_api_cmd_netjail_start_testsystem_v2.c  | 809 ---------------------
 src/testing/testing_api_cmd_netjail_start_v2.c     | 229 ------
 src/testing/testing_api_cmd_netjail_stop.c         | 116 +--
 .../testing_api_cmd_netjail_stop_testsystem.c      |  58 +-
 .../testing_api_cmd_netjail_stop_testsystem_v2.c   | 163 -----
 src/testing/testing_api_cmd_netjail_stop_v2.c      | 225 ------
 src/testing/testing_api_cmd_send_peer_ready.c      |  29 +-
 src/testing/testing_api_cmd_system_create.c        |   4 +-
 src/testing/testing_api_cmd_system_destroy.c       |  33 +-
 src/testing/testing_api_loop.c                     | 629 ++++++----------
 src/testing/testing_api_trait_cmd.c                |   2 +-
 src/testing/testing_api_traits.c                   |   2 +-
 src/testing/testing_cmds.h                         |   2 +
 src/topology/Makefile.am                           |   2 -
 src/transport/Makefile.am                          |  53 --
 .../test_transport_plugin_cmd_simple_send.c        | 195 +++--
 .../test_transport_plugin_cmd_simple_send_v2.c     | 237 ------
 .../test_transport_plugin_cmd_udp_backchannel.c    | 177 +++--
 src/transport/test_transport_port_forward.c        |  85 ---
 src/transport/test_transport_simple_send.c         |  86 ---
 src/transport/test_transport_simple_send.sh        |   2 +-
 src/transport/test_transport_simple_send_topo.conf |   4 +
 src/transport/test_transport_simple_send_v2.c      |  89 ---
 src/transport/test_transport_simple_send_v2.sh     |   2 -
 src/transport/test_transport_start_with_config.c   |  59 +-
 src/transport/transport-testing-cmds.h             | 253 ++-----
 src/transport/transport_api_cmd_connecting_peers.c | 515 ++++++++-----
 .../transport_api_cmd_connecting_peers_v2.c        | 242 ------
 .../transport_api_cmd_connecting_peers_v3.c        | 281 -------
 src/transport/transport_api_cmd_send_simple.c      |  48 +-
 src/transport/transport_api_cmd_send_simple_v2.c   | 156 ----
 src/transport/transport_api_cmd_start_peer.c       | 101 ++-
 src/transport/transport_api_cmd_start_peer_v2.c    | 607 ----------------
 src/transport/transport_api_cmd_start_peer_v3.c    | 619 ----------------
 src/transport/transport_api_cmd_stop_peer.c        |  27 +-
 src/util/Makefile.am                               |   6 +-
 src/util/child_management.c                        |  66 +-
 src/util/common_allocation.c                       |  40 -
 190 files changed, 4443 insertions(+), 7961 deletions(-)

diff --cc src/include/gnunet_testing_ng_lib.h
index 6138f567b,adf5453e1..96e9af252
--- a/src/include/gnunet_testing_ng_lib.h
+++ b/src/include/gnunet_testing_ng_lib.h
@@@ -79,7 -81,9 +82,9 @@@ enum GNUNET_TESTING_NODE_TYP
    GNUNET_TESTING_GLOBAL_NODE
  };
  
+ 
+ // FIXME: this does not belong here!
 -struct GNUNET_TESTING_ADDRESS_PREFIX
 +struct GNUNET_TESTING_AddressPrefix
  {
    /**
     * Pointer to the previous prefix in the DLL.
@@@ -1251,31 -1149,9 +1199,31 @@@ struct GNUNET_TESTING_Comman
  GNUNET_TESTING_cmd_send_peer_ready (const char *label,
                                      TESTING_CMD_HELPER_write_cb 
write_message);
  
 +
 +/**
 + * Create command.
 + *
 + * @param label name for command.
 + * @param write_message Callback to write messages to the master loop.
 + * @return command.
 + */
  struct GNUNET_TESTING_Command
- GNUNET_TESTING_cmd_local_test_finished (const char *label,
-                                         TESTING_CMD_HELPER_write_cb
-                                         write_message);
+ GNUNET_TESTING_cmd_local_test_finished (
+   const char *label,
+   TESTING_CMD_HELPER_write_cb write_message);
  
 +/**
 + * Create command.
 + *
 + * @param label name for command.
 + * @param write_message Callback to write messages to the master loop.
 + * @param all_local_tests_prepared Flag which will be set from outside.
 + * @return command.
 + */
 +struct GNUNET_TESTING_Command
 +GNUNET_TESTING_cmd_local_test_prepared (const char *label,
 +                                        TESTING_CMD_HELPER_write_cb
 +                                        write_message,
 +                                        unsigned int *
 +                                        all_local_tests_prepared);
  #endif
diff --cc src/testing/Makefile.am
index 07caeb44e,39e85c4ac..3daa29e1e
--- a/src/testing/Makefile.am
+++ b/src/testing/Makefile.am
@@@ -42,9 -42,11 +42,12 @@@ libgnunet_test_testing_plugin_testcmd_l
  libgnunet_test_testing_plugin_testcmd_la_LDFLAGS = \
   $(GN_PLUGIN_LDFLAGS)
  
+ 
  libgnunettesting_la_SOURCES = \
+   testing_api_cmd_end.c \
+   testing_api_cmd_finish.c \
    testing_api_cmd_local_test_finished.c \
 +  testing_api_cmd_local_test_prepared.c \
    testing_api_cmd_send_peer_ready.c \
    testing_api_cmd_block_until_all_peers_started.c \
    testing_api_cmd_block_until_external_trigger.c \
diff --cc src/testing/testing.c
index d3acd4689,766c7b084..4d9b7c0cb
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@@ -2014,250 -2003,31 +2015,275 @@@ node_connections (char *line, struct GN
  }
  
  
 +static int
 +log_nodes (void *cls, const struct GNUNET_ShortHashCode *id, void *value)
 +{
 +  struct GNUNET_TESTING_NetjailNode *node = value;
 +  struct GNUNET_TESTING_NodeConnection *pos_connection;
 +  struct GNUNET_TESTING_AddressPrefix *pos_prefix;
 +
 +  LOG (GNUNET_ERROR_TYPE_ERROR,
 +       "plugin: %s space: %u node: %u global: %u\n",
 +       node->plugin,
 +       node->namespace_n,
 +       node->node_n,
 +       node->is_global);
 +
 +  for (pos_connection = node->node_connections_head; NULL != pos_connection;
 +       pos_connection = pos_connection->next)
 +  {
 +
 +    LOG (GNUNET_ERROR_TYPE_ERROR,
 +         "namespace_n: %u node_n: %u node_type: %u\n",
 +         pos_connection->namespace_n,
 +         pos_connection->node_n,
 +         pos_connection->node_type);
 +
 +    for (pos_prefix = pos_connection->address_prefixes_head; NULL != 
pos_prefix;
 +         pos_prefix =
 +           pos_prefix->next)
 +    {
 +      LOG (GNUNET_ERROR_TYPE_ERROR,
 +           "prefix: %s\n",
 +           pos_prefix->address_prefix);
 +    }
 +  }
 +  return GNUNET_YES;
 +}
 +
 +
 +static int
 +log_namespaces (void *cls, const struct GNUNET_ShortHashCode *id, void *value)
 +{
 +  struct GNUNET_TESTING_NetjailNamespace *namespace = value;
 +  struct GNUNET_TESTING_NetjailRouter *router = namespace->router;
 +
 +  LOG (GNUNET_ERROR_TYPE_ERROR,
 +       "router_tcp: %u router_udp: %u spaces: %u\n",
 +       router->tcp_port,
 +       router->udp_port,
 +       namespace->namespace_n);
 +  GNUNET_CONTAINER_multishortmap_iterate (namespace->nodes, &log_nodes, NULL);
 +  return GNUNET_YES;
 +}
 +
 +
 +static int
 +log_topo (struct GNUNET_TESTING_NetjailTopology *topology)
 +{
 +  LOG (GNUNET_ERROR_TYPE_ERROR,
 +       "plugin: %s spaces: %u nodes: %u known: %u\n",
 +       topology->plugin,
 +       topology->namespaces_n,
 +       topology->nodes_m,
 +       topology->nodes_x);
 +
 +  GNUNET_CONTAINER_multishortmap_iterate (topology->map_namespaces,
 +                                          log_namespaces, NULL);
 +  GNUNET_CONTAINER_multishortmap_iterate (topology->map_globals, &log_nodes,
 +                                          NULL);
 +  return GNUNET_YES;
 +}
 +
 +
 +/**
 + * Get the connections to other nodes for a specific node.
 + *
 + * @param num The specific node we want the connections for.
 + * @param topology The topology we get the connections from.
 + * @return The connections of the node.
 + */
 +struct GNUNET_TESTING_NodeConnection *
 +GNUNET_TESTING_get_connections (unsigned int num, struct
 +                                GNUNET_TESTING_NetjailTopology *topology)
 +{
 +  struct GNUNET_TESTING_NetjailNode *node;
 +  struct GNUNET_ShortHashCode *hkey;
 +  struct GNUNET_HashCode hc;
 +  struct GNUNET_TESTING_NetjailNamespace *namespace;
 +  unsigned int namespace_n, node_m;
 +
 +  log_topo (topology);
 +
 +  hkey = GNUNET_new (struct GNUNET_ShortHashCode);
 +  if (topology->nodes_x >= num)
 +  {
 +
 +    GNUNET_CRYPTO_hash (&num, sizeof(num), &hc);
 +    memcpy (hkey,
 +            &hc,
 +            sizeof (*hkey));
 +    node = GNUNET_CONTAINER_multishortmap_get (topology->map_globals,
 +                                               hkey);
 +  }
 +  else
 +  {
 +    namespace_n = (unsigned int) floor ((num - topology->nodes_x)
 +                                        / topology->nodes_m);
 +    LOG (GNUNET_ERROR_TYPE_ERROR,
 +         "num: %u nodes_x: %u nodes_m: %u namespace_n: %u\n",
 +         num,
 +         topology->nodes_x,
 +         topology->nodes_m,
 +         namespace_n);
 +    hkey = GNUNET_new (struct GNUNET_ShortHashCode);
 +    GNUNET_CRYPTO_hash (&namespace_n, sizeof(namespace_n), &hc);
 +    memcpy (hkey,
 +            &hc,
 +            sizeof (*hkey));
 +    namespace = GNUNET_CONTAINER_multishortmap_get (topology->map_namespaces,
 +                                                    hkey);
 +    node_m = num - topology->nodes_x - topology->nodes_m * (namespace_n - 1);
 +    hkey = GNUNET_new (struct GNUNET_ShortHashCode);
 +    GNUNET_CRYPTO_hash (&node_m, sizeof(node_m), &hc);
 +    memcpy (hkey,
 +            &hc,
 +            sizeof (*hkey));
 +    node = GNUNET_CONTAINER_multishortmap_get (namespace->nodes,
 +                                               hkey);
 +  }
 +
 +
 +  return node->node_connections_head;
 +}
 +
 +
 +/**
 + * Retrieve the public key from the test system with the unique node id.
 + *
 + * @param num The unique node id.
 + * @param tl_system The test system.
 + * @return The peer identity wrapping the public key.
 + */
 +struct GNUNET_PeerIdentity *
 +GNUNET_TESTING_get_pub_key (unsigned int num, struct
 +                            GNUNET_TESTING_System *tl_system)
 +{
 +  struct GNUNET_PeerIdentity *peer = GNUNET_new (struct GNUNET_PeerIdentity);
 +  struct GNUNET_CRYPTO_EddsaPublicKey *pub_key = GNUNET_new (struct
 +                                                             
GNUNET_CRYPTO_EddsaPublicKey);
 +  struct GNUNET_CRYPTO_EddsaPrivateKey *priv_key = GNUNET_new (struct
 +                                                               
GNUNET_CRYPTO_EddsaPrivateKey);
 +
 +  priv_key = GNUNET_TESTING_hostkey_get (tl_system,
 +                                         num,
 +                                         peer);
 +
 +  GNUNET_CRYPTO_eddsa_key_get_public (priv_key,
 +                                      pub_key);
 +  peer->public_key = *pub_key;
 +  return peer;
 +}
 +
 +
 +/**
 + * Calculate the unique id identifying a node from a given connction.
 + *
 + * @param node_connection The connection we calculate the id from.
 + * @param topology The topology we get all needed information from.
 + * @return The unique id of the node from the connection.
 + */
 +unsigned int
 +GNUNET_TESTING_calculate_num (struct
 +                              GNUNET_TESTING_NodeConnection *node_connection,
 +                              struct GNUNET_TESTING_NetjailTopology *topology)
 +{
 +  unsigned int n, m, num;
 +
 +  n = node_connection->namespace_n;
 +  m = node_connection->node_n;
 +
 +  if (0 == n)
 +    num = m;
 +  else
 +    num = (n - 1) * topology->nodes_m + m + topology->nodes_x;
 +
 +  return num;
 +}
 +
 +
 +/**
 + * Get the address for a specific communicator from a connection.
 + *
 + * @param connection The connection we like to have the address from.
 + * @param prefix The communicator protocol prefix.
 + * @return The address of the communicator.
 + */
 +char *
 +GNUNET_TESTING_get_address (struct GNUNET_TESTING_NodeConnection *connection,
 +                            char *prefix)
 +{
 +  struct GNUNET_TESTING_NetjailNode *node;
 +  char *addr;
 +  char *template;
 +
 +  LOG (GNUNET_ERROR_TYPE_ERROR,
 +       "node_n: %u\n",
 +       connection->node_n);
 +
 +  node = connection->node;
 +  if (connection->namespace_n == node->namespace_n)
 +  {
 +    template = CONNECT_ADDRESS_TEMPLATE;
 +  }
 +  else if (0 == connection->namespace_n)
 +  {
 +    template = KNOWN_CONNECT_ADDRESS_TEMPLATE;
 +  }
 +  else
 +  {
 +    template = ROUTER_CONNECT_ADDRESS_TEMPLATE;
 +  }
 +
 +  if (0 == strcmp (PREFIX_TCP, prefix))
 +  {
 +
 +    GNUNET_asprintf (&addr,
 +                     template,
 +                     prefix,
 +                     connection->node_n);
 +  }
 +  else if (0 == strcmp (PREFIX_UDP, prefix))
 +  {
 +    GNUNET_asprintf (&addr,
 +                     template,
 +                     prefix,
 +                     connection->node_n);
 +  }
 +  else
 +  {
 +    GNUNET_break (0);
 +  }
 +
 +  return addr;
 +}
 +
 +
+ /**
+  * Create a GNUNET_CMDS_LOCAL_FINISHED message.
+  *
+  * @param rv The result of the local test as GNUNET_GenericReturnValue.
+  * @return The GNUNET_CMDS_LOCAL_FINISHED message.
+ */
+ struct GNUNET_MessageHeader *
+ GNUNET_TESTING_send_local_test_finished_msg (enum GNUNET_GenericReturnValue 
rv)
+ {
+   struct GNUNET_CMDS_LOCAL_FINISHED *reply;
+   size_t msg_length;
+ 
+   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+               "Local test exits with status %d\n",
+               rv);
+   msg_length = sizeof(struct GNUNET_CMDS_LOCAL_FINISHED);
+   reply = GNUNET_new (struct GNUNET_CMDS_LOCAL_FINISHED);
+   reply->header.type = htons (GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_FINISHED);
+   reply->header.size = htons ((uint16_t) msg_length);
+   reply->result = htons (rv);
+ 
+   return (struct GNUNET_MessageHeader *) reply;
+ }
+ 
+ 
  /**
   * Getting the topology from file.
   *
diff --cc src/testing/testing_cmds.h
index 005402a73,09e4f2dcb..12db87d19
--- a/src/testing/testing_cmds.h
+++ b/src/testing/testing_cmds.h
@@@ -83,25 -83,10 +83,27 @@@ struct GNUNET_CMDS_LOCAL_FINISHE
     * Type is GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_FINISHED
     */
    struct GNUNET_MessageHeader header;
+ 
+   enum GNUNET_GenericReturnValue result;
  };
  
 +struct GNUNET_CMDS_LOCAL_TEST_PREPARED
 +{
 +  /**
 +   * Type is GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_TEST_PREPARED
 +   */
 +  struct GNUNET_MessageHeader header;
 +};
 +
 +struct GNUNET_CMDS_ALL_LOCAL_TESTS_PREPARED
 +{
 +  /**
 +   * Type is GNUNET_MESSAGE_TYPE_CMDS_HELPER_ALL_LOCAL_TESTS_PREPARED
 +   */
 +  struct GNUNET_MessageHeader header;
 +};
 +
  GNUNET_NETWORK_STRUCT_END
 +
  #endif
  /* end of testing_cmds.h */
diff --cc src/transport/Makefile.am
index 73544a8d5,0df422976..d281c4ffb
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@@ -161,16 -159,9 +159,10 @@@ libgnunettransporttesting_la_LDFLAGS = 
  
  libgnunettransporttesting2_la_SOURCES = \
    transport_api_cmd_connecting_peers.c \
-   transport_api_cmd_connecting_peers_v2.c \
-   transport_api_cmd_connecting_peers_v3.c \
 +  transport_api_cmd_backchannel_check.c \
    transport_api_cmd_start_peer.c \
-   transport_api_cmd_start_peer_v2.c \
-   transport_api_cmd_start_peer_v3.c \
    transport_api_cmd_stop_peer.c \
    transport_api_cmd_send_simple.c \
-   transport_api_cmd_send_simple_v2.c \
-   transport_api_cmd_send_simple_v3.c \
    transport-testing2.c transport-testing2.h \
    transport-testing-cmds.h \
    transport-testing-filenames2.c \
diff --cc src/transport/test_transport_plugin_cmd_simple_send.c
index b578219ca,5384bf24d..8889f9d06
--- a/src/transport/test_transport_plugin_cmd_simple_send.c
+++ b/src/transport/test_transport_plugin_cmd_simple_send.c
@@@ -37,28 -37,34 +37,33 @@@
  
  #define BASE_DIR "testdir"
  
- /**
-  * The name for a specific test environment directory.
-  *
-  */
- char *testdir;
 -#define TOPOLOGY_CONFIG "test_transport_simple_send_topo.conf"
  
- /**
-  * The name for the configuration file of the specific node.
-  *
-  */
- char *cfgname;
+ struct TestState
+ {
+   /**
+    * Callback to write messages to the master loop.
+    *
+    */
+   TESTING_CMD_HELPER_write_cb write_message;
  
- /**
-  * Flag indicating if all peers have been started.
-  *
-  */
- unsigned int are_all_peers_started;
+   /**
+    * The name for a specific test environment directory.
+    *
+    */
+   char *testdir;
  
- /**
-  * Flag indicating a received message.
-  */
- unsigned int message_received;
+   /**
+    * The name for the configuration file of the specific node.
+    *
+    */
+   char *cfgname;
+ };
+ 
+ static struct GNUNET_TESTING_Command block_send;
+ 
+ static struct GNUNET_TESTING_Command block_receive;
+ 
+ static struct GNUNET_TESTING_Command connect_peers;
  
  
  /**
diff --cc src/transport/test_transport_plugin_cmd_udp_backchannel.c
index e2e0b258b,108e1ac09..b0ca37447
--- a/src/transport/test_transport_plugin_cmd_udp_backchannel.c
+++ b/src/transport/test_transport_plugin_cmd_udp_backchannel.c
@@@ -111,16 -118,54 +118,62 @@@ all_peers_started (
  }
  
  
+ /**
+ * Function called with the final result of the test.
+ *
+ * @param cls the `struct MainParams`
+ * @param rv #GNUNET_OK if the test passed
+ */
+ static void
+ handle_result (void *cls,
+                enum GNUNET_GenericReturnValue rv)
+ {
+   struct TestState *ts = cls;
+   struct GNUNET_MessageHeader *reply;
+ 
+   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+               "Local test exits with status %d\n",
+               rv);
+   reply = GNUNET_TESTING_send_local_test_finished_msg (rv);
+ 
+   ts->write_message (reply,
+                      ntohs (reply->size));
+   GNUNET_free (ts->testdir);
+   GNUNET_free (ts->cfgname);
+   GNUNET_free (ts);
+ }
+ 
+ 
+ /**
+  * Callback from start peer cmd for signaling a peer got connected.
+  *
+  */
+ static void *
+ notify_connect (void *cls,
+                 const struct GNUNET_PeerIdentity *peer,
+                 struct GNUNET_MQ_Handle *mq)
+ {
+   struct ConnectPeersState *cps;
+ 
+   GNUNET_TESTING_get_trait_connect_peer_state (&connect_peers,
+                                                &cps);
+   void *ret = NULL;
+ 
+   cps->notify_connect (cps,
+                        peer,
+                        mq);
+   return ret;
+ }
+ 
 +/**
 + * Callback to set the flag indicating all peers are prepared to finish. Will 
be called via the plugin api.
 + */
 +static void
 +all_local_tests_prepared ()
 +{
 +  are_all_local_tests_prepared = GNUNET_YES;
 +}
  
- 
  /**
   * Function to start a local test case.
   *
@@@ -181,32 -239,22 +247,29 @@@ start_testcase (TESTING_CMD_HELPER_writ
  
    struct GNUNET_TESTING_Command commands[] = {
      GNUNET_TESTING_cmd_system_create ("system-create",
-                                       testdir),
-     GNUNET_TRANSPORT_cmd_start_peer_v3 ("start-peer",
-                                         "system-create",
-                                         num,
-                                         node_ip,
-                                         handlers,
-                                         cfgname),
+                                       ts->testdir),
+     GNUNET_TRANSPORT_cmd_start_peer ("start-peer",
+                                      "system-create",
+                                      num,
+                                      node_ip,
+                                      handlers,
+                                      ts->cfgname,
+                                      notify_connect),
      GNUNET_TESTING_cmd_send_peer_ready ("send-peer-ready",
                                          write_message),
-     GNUNET_TESTING_cmd_block_until_all_peers_started ("block",
-                                                       &are_all_peers_started),
-     GNUNET_TRANSPORT_cmd_connect_peers_v3 ("connect-peers",
-                                            "start-peer",
-                                            "system-create",
-                                            num,
-                                            topology),
+     block_send,
+     connect_peers,
 -    GNUNET_TRANSPORT_cmd_send_simple ("send-simple",
 -                                      "start-peer",
 -                                      num),
 +    GNUNET_TRANSPORT_cmd_backchannel_check ("backchannel-check",
 +                                            "start-peer",
 +                                            "system-create",
 +                                            num,
 +                                            m_int,
 +                                            n_int,
 +                                            topology),
 +    GNUNET_TESTING_cmd_local_test_prepared ("local-test-prepared",
 +                                            write_message,
 +                                            &are_all_local_tests_prepared),
+     block_receive,
      GNUNET_TRANSPORT_cmd_stop_peer ("stop-peer",
                                      "start-peer"),
      GNUNET_TESTING_cmd_system_destroy ("system-destroy",
diff --cc src/transport/test_transport_simple_send_topo.conf
index 000000000,000000000..f878f9719
new file mode 100644
--- /dev/null
+++ b/src/transport/test_transport_simple_send_topo.conf
@@@ -1,0 -1,0 +1,4 @@@
++M:2
++N:1
++X:0
++T:libgnunet_test_transport_plugin_cmd_simple_send

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