aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2021-12-06 14:20:25 +0100
committert3sserakt <t3ss@posteo.de>2021-12-06 14:20:25 +0100
commit1816cee6455627543262711524837164bbf48385 (patch)
tree931909154494dd49d8c9008ba3d3cca0c117b7e8 /src/transport
parent7a7f3d5e0f7b76c07a395e6e0b4af4f39c4a2895 (diff)
downloadgnunet-1816cee6455627543262711524837164bbf48385.tar.gz
gnunet-1816cee6455627543262711524837164bbf48385.zip
fixed timeout for netjail tests, removed duplicated function declaration from header, using GNUNET_TESTING_get_trait_batch_cmds in loop, fixed tng service shutdown logic, added missing GNUNET_SERVICE_client_continue, changed default log level for udp backchannel test to debug
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/gnunet-service-tng.c15
-rw-r--r--src/transport/test_transport_start_with_config.c5
-rwxr-xr-xsrc/transport/test_transport_udp_backchannel.sh5
3 files changed, 19 insertions, 6 deletions
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c
index f67bc0db5..e7c320eb1 100644
--- a/src/transport/gnunet-service-tng.c
+++ b/src/transport/gnunet-service-tng.c
@@ -3259,7 +3259,10 @@ client_connect_cb (void *cls,
3259 tc->client = client; 3259 tc->client = client;
3260 tc->mq = mq; 3260 tc->mq = mq;
3261 GNUNET_CONTAINER_DLL_insert (clients_head, clients_tail, tc); 3261 GNUNET_CONTAINER_DLL_insert (clients_head, clients_tail, tc);
3262 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Client %p connected\n", tc); 3262 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3263 "Client %p of type %u connected\n",
3264 tc,
3265 tc->type);
3263 return tc; 3266 return tc;
3264} 3267}
3265 3268
@@ -5071,6 +5074,7 @@ handle_client_send (void *cls, const struct OutboundMessage *obm)
5071 vl->pending_msg_tail, 5074 vl->pending_msg_tail,
5072 pm); 5075 pm);
5073 check_vl_transmission (vl); 5076 check_vl_transmission (vl);
5077 GNUNET_SERVICE_client_continue (tc->client);
5074} 5078}
5075 5079
5076 5080
@@ -10370,6 +10374,8 @@ do_shutdown (void *cls)
10370{ 10374{
10371 struct LearnLaunchEntry *lle; 10375 struct LearnLaunchEntry *lle;
10372 10376
10377 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
10378 "shutdown logic\n");
10373 (void) cls; 10379 (void) cls;
10374 GNUNET_CONTAINER_multipeermap_iterate (neighbours, 10380 GNUNET_CONTAINER_multipeermap_iterate (neighbours,
10375 &free_neighbour_cb, NULL); 10381 &free_neighbour_cb, NULL);
@@ -10450,7 +10456,9 @@ shutdown_task (void *cls)
10450{ 10456{
10451 in_shutdown = GNUNET_YES; 10457 in_shutdown = GNUNET_YES;
10452 10458
10453 if (NULL == clients_head) 10459 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
10460 "Shutdown task executed\n");
10461 if (NULL != clients_head)
10454 { 10462 {
10455 for (struct TransportClient *tc = clients_head; NULL != tc; tc = tc->next) 10463 for (struct TransportClient *tc = clients_head; NULL != tc; tc = tc->next)
10456 { 10464 {
@@ -10459,7 +10467,8 @@ shutdown_task (void *cls)
10459 tc->type); 10467 tc->type);
10460 } 10468 }
10461 } 10469 }
10462 do_shutdown (cls); 10470 else
10471 do_shutdown (cls);
10463 10472
10464} 10473}
10465 10474
diff --git a/src/transport/test_transport_start_with_config.c b/src/transport/test_transport_start_with_config.c
index c3411becc..4705eb9b2 100644
--- a/src/transport/test_transport_start_with_config.c
+++ b/src/transport/test_transport_start_with_config.c
@@ -29,7 +29,7 @@
29#include "transport-testing-cmds.h" 29#include "transport-testing-cmds.h"
30#include "gnunet_util_lib.h" 30#include "gnunet_util_lib.h"
31 31
32#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 120) 32#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 300)
33 33
34 34
35int 35int
@@ -97,7 +97,8 @@ main (int argc,
97 GNUNET_TESTING_cmd_netjail_start_testing_system ("netjail-start-testbed", 97 GNUNET_TESTING_cmd_netjail_start_testing_system ("netjail-start-testbed",
98 topology, 98 topology,
99 &read_file, 99 &read_file,
100 topology_data_script), 100 topology_data_script,
101 TIMEOUT),
101 GNUNET_TESTING_cmd_stop_testing_system ("stop-testbed", 102 GNUNET_TESTING_cmd_stop_testing_system ("stop-testbed",
102 "netjail-start-testbed", 103 "netjail-start-testbed",
103 topology), 104 topology),
diff --git a/src/transport/test_transport_udp_backchannel.sh b/src/transport/test_transport_udp_backchannel.sh
index 1b0e283b5..c52734a55 100755
--- a/src/transport/test_transport_udp_backchannel.sh
+++ b/src/transport/test_transport_udp_backchannel.sh
@@ -1,10 +1,13 @@
1#!/bin/bash 1#!/bin/bash
2if [ -f "test.out" ]; then
3 rm test.out
4fi
2if ! [ -d "/run/netns" ]; then 5if ! [ -d "/run/netns" ]; then
3 echo You have to create the directory /run/netns. 6 echo You have to create the directory /run/netns.
4fi 7fi
5if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" == 1 ]; then 8if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" == 1 ]; then
6#exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; valgrind --leak-check=full --track-origins=yes --trace-children=yes --trace-children-skip=/usr/bin/awk,/usr/bin/cut,/usr/bin/seq,/sbin/ip ./test_transport_start_with_config test_transport_udp_backchannel_topo.conf" 9#exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; valgrind --leak-check=full --track-origins=yes --trace-children=yes --trace-children-skip=/usr/bin/awk,/usr/bin/cut,/usr/bin/seq,/sbin/ip ./test_transport_start_with_config test_transport_udp_backchannel_topo.conf"
7exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; GNUNET_FORCE_LOG='transport;;;;DEBUG' GNUNET_FORCE_LOGFILE='test.out' ./test_transport_start_with_config test_transport_udp_backchannel_topo.conf" 10exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; GNUNET_FORCE_LOG=';;;;DEBUG' GNUNET_FORCE_LOGFILE='test.out' ./test_transport_start_with_config test_transport_udp_backchannel_topo.conf"
8# exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; valgrind --leak-check=full --track-origins=yes ./test_transport_start_with_config test_transport_udp_backchannel_topo.conf" 11# exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; valgrind --leak-check=full --track-origins=yes ./test_transport_start_with_config test_transport_udp_backchannel_topo.conf"
9else 12else
10 echo -e "Error during test setup: The kernel parameter kernel.unprivileged_userns_clone has to be set to 1! One has to execute\n\n sysctl kernel.unprivileged_userns_clone=1\n" 13 echo -e "Error during test setup: The kernel parameter kernel.unprivileged_userns_clone has to be set to 1! One has to execute\n\n sysctl kernel.unprivileged_userns_clone=1\n"