summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-03-07 20:16:28 +0100
committerMartin Schanzenbach <schanzen@gnunet.org>2022-03-07 20:16:28 +0100
commit13be8d080e44f6ad2c971de590e5217c9a9328b5 (patch)
tree8361b4f19bb13154d9178011abddfb7a7d22892d
parentfd88ee22f383b42084acbb2a44c356e2d277e912 (diff)
-better handling of tng netns
-rwxr-xr-xsrc/transport/test_transport_simple_send_broadcast.sh8
-rwxr-xr-xsrc/transport/test_transport_simple_send_dv.sh8
-rwxr-xr-xsrc/transport/test_transport_simple_send_dv_circle.sh9
-rwxr-xr-xsrc/transport/test_transport_simple_send_string.sh8
-rwxr-xr-xsrc/transport/test_transport_udp_backchannel.sh9
5 files changed, 21 insertions, 21 deletions
diff --git a/src/transport/test_transport_simple_send_broadcast.sh b/src/transport/test_transport_simple_send_broadcast.sh
index f264b1203..a4801bf70 100755
--- a/src/transport/test_transport_simple_send_broadcast.sh
+++ b/src/transport/test_transport_simple_send_broadcast.sh
@@ -2,10 +2,10 @@
if ! [ -d "/run/netns" ]; then
echo You have to create the directory /run/netns.
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/sed/bash ./test_transport_start_with_config test_transport_simple_send_broadcast_topo.conf"
- exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; ./test_transport_start_with_config test_transport_simple_send_broadcast_topo.conf"
-else
+if [ -f /proc/sys/kernel/unprivileged_userns_clone ]; then
+ if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" != 1 ]; then
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"
exit 78
+ fi
fi
+exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; ./test_transport_start_with_config test_transport_simple_send_broadcast_topo.conf"
diff --git a/src/transport/test_transport_simple_send_dv.sh b/src/transport/test_transport_simple_send_dv.sh
index fa127cfa4..b57ee0629 100755
--- a/src/transport/test_transport_simple_send_dv.sh
+++ b/src/transport/test_transport_simple_send_dv.sh
@@ -2,10 +2,10 @@
if ! [ -d "/run/netns" ]; then
echo You have to create the directory /run/netns.
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/sed/bash ./test_transport_start_with_config test_transport_distance_vector_topo.conf"
- exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; ./test_transport_start_with_config test_transport_distance_vector_topo.conf"
-else
+if [ -f /proc/sys/kernel/unprivileged_userns_clone ]; then
+ if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" != 1 ]; then
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"
exit 78
+ fi
fi
+exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; ./test_transport_start_with_config test_transport_distance_vector_topo.conf"
diff --git a/src/transport/test_transport_simple_send_dv_circle.sh b/src/transport/test_transport_simple_send_dv_circle.sh
index de16df356..bd5f00abe 100755
--- a/src/transport/test_transport_simple_send_dv_circle.sh
+++ b/src/transport/test_transport_simple_send_dv_circle.sh
@@ -2,11 +2,10 @@
if ! [ -d "/run/netns" ]; then
echo You have to create the directory /run/netns.
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/sed/bash ./test_transport_start_with_config test_transport_distance_vector_topo.conf"
- exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; ./test_transport_start_with_config test_transport_distance_vector_circle_topo.conf"
- #./test_transport_start_with_config test_transport_distance_vector_circle_topo.conf
-else
+if [ -f /proc/sys/kernel/unprivileged_userns_clone ]; then
+ if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" != 1 ]; then
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"
exit 78
+ fi
fi
+exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; ./test_transport_start_with_config test_transport_distance_vector_circle_topo.conf"
diff --git a/src/transport/test_transport_simple_send_string.sh b/src/transport/test_transport_simple_send_string.sh
index b2bd05d5f..211abb494 100755
--- a/src/transport/test_transport_simple_send_string.sh
+++ b/src/transport/test_transport_simple_send_string.sh
@@ -11,9 +11,11 @@ EOF
if ! [ -d "/run/netns" ]; then
echo You have to create the directory /run/netns.
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; ./test_transport_start_with_config -s '$string'"
-else
+if [ -f /proc/sys/kernel/unprivileged_userns_clone ]; then
+ if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" != 1 ]; then
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"
exit 78
+ fi
fi
+
+exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; ./test_transport_start_with_config -s '$string'"
diff --git a/src/transport/test_transport_udp_backchannel.sh b/src/transport/test_transport_udp_backchannel.sh
index c52734a55..1a7c83385 100755
--- a/src/transport/test_transport_udp_backchannel.sh
+++ b/src/transport/test_transport_udp_backchannel.sh
@@ -5,11 +5,10 @@ fi
if ! [ -d "/run/netns" ]; then
echo You have to create the directory /run/netns.
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; GNUNET_FORCE_LOG=';;;;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
+if [ -f /proc/sys/kernel/unprivileged_userns_clone ]; then
+ if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" != 1 ]; then
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"
exit 78
+ fi
fi
+exec 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"