From 27e4f78f34c79ed18645cb15fc2c5f731c137076 Mon Sep 17 00:00:00 2001 From: t3sserakt Date: Thu, 2 Dec 2021 10:49:23 +0100 Subject: - fixed warning, raised log level for udp backchannel test --- .../test_transport_plugin_cmd_simple_send.c | 21 +++++++++--------- .../test_transport_plugin_cmd_simple_send_dv.c | 25 +++++++++++----------- .../test_transport_plugin_cmd_udp_backchannel.c | 15 +++++++------ src/transport/test_transport_udp_backchannel.sh | 2 +- 4 files changed, 33 insertions(+), 30 deletions(-) (limited to 'src/transport') diff --git a/src/transport/test_transport_plugin_cmd_simple_send.c b/src/transport/test_transport_plugin_cmd_simple_send.c index 6a6861d77..154c0abca 100644 --- a/src/transport/test_transport_plugin_cmd_simple_send.c +++ b/src/transport/test_transport_plugin_cmd_simple_send.c @@ -97,15 +97,15 @@ static void handle_test (void *cls, const struct GNUNET_TRANSPORT_TESTING_TestMessage *message) { - struct GNUNET_TESTING_AsyncContext *ac; + const struct GNUNET_TESTING_AsyncContext *ac; GNUNET_TESTING_get_trait_async_context (&block_receive, &ac); GNUNET_assert (NULL != ac); if (NULL == ac->cont) - GNUNET_TESTING_async_fail (ac); + GNUNET_TESTING_async_fail ((struct GNUNET_TESTING_AsyncContext *) ac); else - GNUNET_TESTING_async_finish (ac); + GNUNET_TESTING_async_finish ((struct GNUNET_TESTING_AsyncContext *) ac); } @@ -116,15 +116,15 @@ handle_test (void *cls, static void all_peers_started () { - struct GNUNET_TESTING_AsyncContext *ac; + const struct GNUNET_TESTING_AsyncContext *ac; GNUNET_TESTING_get_trait_async_context (&block_send, &ac); GNUNET_assert (NULL != ac); if (NULL == ac->cont) - GNUNET_TESTING_async_fail (ac); + GNUNET_TESTING_async_fail ((struct GNUNET_TESTING_AsyncContext *) ac); else - GNUNET_TESTING_async_finish (ac); + GNUNET_TESTING_async_finish ((struct GNUNET_TESTING_AsyncContext *) ac); } @@ -167,7 +167,7 @@ static void * notify_connect (struct GNUNET_TESTING_Interpreter *is, const struct GNUNET_PeerIdentity *peer) { - struct ConnectPeersState *cps; + const struct ConnectPeersState *cps; const struct GNUNET_TESTING_Command *cmd; cmd = GNUNET_TESTING_interpreter_lookup_command (is, @@ -188,15 +188,16 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is, static void all_local_tests_prepared () { - struct LocalPreparedState *lfs; + const struct LocalPreparedState *lfs; GNUNET_TESTING_get_trait_local_prepared_state (&local_prepared, &lfs); GNUNET_assert (NULL != &lfs->ac); if (NULL == lfs->ac.cont) - GNUNET_TESTING_async_fail (&lfs->ac); + GNUNET_TESTING_async_fail ((struct GNUNET_TESTING_AsyncContext *) &lfs->ac); else - GNUNET_TESTING_async_finish (&lfs->ac); + GNUNET_TESTING_async_finish ((struct + GNUNET_TESTING_AsyncContext *) &lfs->ac); } diff --git a/src/transport/test_transport_plugin_cmd_simple_send_dv.c b/src/transport/test_transport_plugin_cmd_simple_send_dv.c index 6a3492705..e73e5a0b2 100644 --- a/src/transport/test_transport_plugin_cmd_simple_send_dv.c +++ b/src/transport/test_transport_plugin_cmd_simple_send_dv.c @@ -96,7 +96,7 @@ static void handle_test (void *cls, const struct GNUNET_TRANSPORT_TESTING_TestMessage *message) { - struct GNUNET_TESTING_AsyncContext *ac; + const struct GNUNET_TESTING_AsyncContext *ac; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received test message\n"); @@ -104,9 +104,9 @@ handle_test (void *cls, &ac); GNUNET_assert (NULL != ac); if (NULL == ac->cont) - GNUNET_TESTING_async_fail (ac); + GNUNET_TESTING_async_fail ((struct GNUNET_TESTING_AsyncContext *) ac); else - GNUNET_TESTING_async_finish (ac); + GNUNET_TESTING_async_finish ((struct GNUNET_TESTING_AsyncContext *) ac); } @@ -117,7 +117,7 @@ handle_test (void *cls, static void all_peers_started () { - struct GNUNET_TESTING_AsyncContext *ac; + const struct GNUNET_TESTING_AsyncContext *ac; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received message\n"); @@ -125,9 +125,9 @@ all_peers_started () &ac); GNUNET_assert (NULL != ac); if (NULL == ac->cont) - GNUNET_TESTING_async_fail (ac); + GNUNET_TESTING_async_fail ((struct GNUNET_TESTING_AsyncContext *) ac); else - GNUNET_TESTING_async_finish (ac); + GNUNET_TESTING_async_finish ((struct GNUNET_TESTING_AsyncContext *) ac); } @@ -170,7 +170,7 @@ static void * notify_connect (struct GNUNET_TESTING_Interpreter *is, const struct GNUNET_PeerIdentity *peer) { - struct ConnectPeersState *cps; + const struct ConnectPeersState *cps; const struct GNUNET_TESTING_Command *cmd; void *ret = NULL; @@ -178,12 +178,12 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is, "notify_connect peer %s\n", GNUNET_i2s (peer)); cmd = GNUNET_TESTING_interpreter_lookup_command_all (is, - "connect-peers"); + "connect-peers"); GNUNET_TRANSPORT_get_trait_connect_peer_state (cmd, &cps); cps->notify_connect (is, peer); - + return ret; } @@ -194,15 +194,16 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is, static void all_local_tests_prepared () { - struct LocalPreparedState *lfs; + const struct LocalPreparedState *lfs; GNUNET_TESTING_get_trait_local_prepared_state (&local_prepared, &lfs); GNUNET_assert (NULL != &lfs->ac); if (NULL == lfs->ac.cont) - GNUNET_TESTING_async_fail (&lfs->ac); + GNUNET_TESTING_async_fail ((struct GNUNET_TESTING_AsyncContext *) &lfs->ac); else - GNUNET_TESTING_async_finish (&lfs->ac); + GNUNET_TESTING_async_finish ((struct + GNUNET_TESTING_AsyncContext *) &lfs->ac); } diff --git a/src/transport/test_transport_plugin_cmd_udp_backchannel.c b/src/transport/test_transport_plugin_cmd_udp_backchannel.c index b594049c9..537832e61 100644 --- a/src/transport/test_transport_plugin_cmd_udp_backchannel.c +++ b/src/transport/test_transport_plugin_cmd_udp_backchannel.c @@ -113,15 +113,15 @@ handle_test (void *cls, static void all_peers_started () { - struct GNUNET_TESTING_AsyncContext *ac; + const struct GNUNET_TESTING_AsyncContext *ac; GNUNET_TESTING_get_trait_async_context (&block_send, &ac); GNUNET_assert (NULL != ac); if ((NULL == ac->cont)) - GNUNET_TESTING_async_fail (ac); + GNUNET_TESTING_async_fail ((struct GNUNET_TESTING_AsyncContext *) ac); else - GNUNET_TESTING_async_finish (ac); + GNUNET_TESTING_async_finish ((struct GNUNET_TESTING_AsyncContext *) ac); } @@ -163,7 +163,7 @@ static void * notify_connect (struct GNUNET_TESTING_Interpreter *is, const struct GNUNET_PeerIdentity *peer) { - struct ConnectPeersState *cps; + const struct ConnectPeersState *cps; GNUNET_TRANSPORT_get_trait_connect_peer_state (&connect_peers, &cps); @@ -180,15 +180,16 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is, static void all_local_tests_prepared () { - struct LocalPreparedState *lfs; + const struct LocalPreparedState *lfs; GNUNET_TESTING_get_trait_local_prepared_state (&local_prepared, &lfs); GNUNET_assert (NULL != &lfs->ac); if (NULL == lfs->ac.cont) - GNUNET_TESTING_async_fail (&lfs->ac); + GNUNET_TESTING_async_fail ((struct GNUNET_TESTING_AsyncContext *) &lfs->ac); else - GNUNET_TESTING_async_finish (&lfs->ac); + GNUNET_TESTING_async_finish ((struct + GNUNET_TESTING_AsyncContext *) &lfs->ac); } /** diff --git a/src/transport/test_transport_udp_backchannel.sh b/src/transport/test_transport_udp_backchannel.sh index b42186307..1b0e283b5 100755 --- a/src/transport/test_transport_udp_backchannel.sh +++ b/src/transport/test_transport_udp_backchannel.sh @@ -4,7 +4,7 @@ if ! [ -d "/run/netns" ]; then fi if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" == 1 ]; then #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" -exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; ./test_transport_start_with_config test_transport_udp_backchannel_topo.conf" +exec 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" # 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" else 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" -- cgit v1.2.3