aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2023-07-14 19:10:52 +0200
committert3sserakt <t3ss@posteo.de>2023-07-14 19:10:52 +0200
commit80971b6327e1906bdfe2d3e9012f93c36bae47fa (patch)
tree13f3a22a8f9eb62c66b5b8a8518cfc3188a43440 /src
parent40a5a650d3b61aca9474692416adeba7272e61b3 (diff)
downloadgnunet-80971b6327e1906bdfe2d3e9012f93c36bae47fa.tar.gz
gnunet-80971b6327e1906bdfe2d3e9012f93c36bae47fa.zip
TNG: Added generic start script for test cases.
Diffstat (limited to 'src')
-rw-r--r--src/transport/Makefile.am22
-rwxr-xr-xsrc/transport/test_transport_start_testcase.sh12
2 files changed, 33 insertions, 1 deletions
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index eeafab840..93d6aed13 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -363,7 +363,25 @@ plugin_LTLIBRARIES = \
363 libgnunet_test_transport_plugin_cmd_simple_send.la \ 363 libgnunet_test_transport_plugin_cmd_simple_send.la \
364 libgnunet_test_transport_plugin_cmd_simple_send_broadcast.la \ 364 libgnunet_test_transport_plugin_cmd_simple_send_broadcast.la \
365 libgnunet_test_transport_plugin_cmd_simple_send_dv.la \ 365 libgnunet_test_transport_plugin_cmd_simple_send_dv.la \
366 libgnunet_test_transport_plugin_cmd_udp_backchannel.la 366 libgnunet_test_transport_plugin_cmd_udp_backchannel.la \
367 libgnunet_test_transport_plugin_cmd_just_run.la
368
369libgnunet_test_transport_plugin_cmd_just_run_la_SOURCES = \
370 test_transport_plugin_cmd_just_run.c
371libgnunet_test_transport_plugin_cmd_just_run_la_LIBADD = \
372 libgnunettransporttesting2.la \
373 libgnunettransportapplication.la \
374 libgnunettransportcore.la \
375 $(top_builddir)/src/testing/libgnunettesting.la \
376 $(top_builddir)/src/peerstore/libgnunetpeerstore.la \
377 $(top_builddir)/src/statistics/libgnunetstatistics.la \
378 $(top_builddir)/src/hello/libgnunethello.la \
379 $(top_builddir)/src/ats/libgnunetats.la \
380 $(top_builddir)/src/arm/libgnunetarm.la \
381 $(top_builddir)/src/util/libgnunetutil.la \
382 $(LTLIBINTL)
383libgnunet_test_transport_plugin_cmd_just_run_la_LDFLAGS = \
384 $(GN_PLUGIN_LDFLAGS)
367 385
368libgnunet_test_transport_plugin_cmd_nat_upnp_la_SOURCES = \ 386libgnunet_test_transport_plugin_cmd_nat_upnp_la_SOURCES = \
369 test_transport_plugin_cmd_nat_upnp.c 387 test_transport_plugin_cmd_nat_upnp.c
@@ -779,6 +797,7 @@ endif
779# Only test TNG if we run experimental 797# Only test TNG if we run experimental
780if HAVE_EXPERIMENTAL 798if HAVE_EXPERIMENTAL
781check_SCRIPTS= \ 799check_SCRIPTS= \
800 test_transport_start_testcase.sh \
782 test_transport_simple_send_performance.sh \ 801 test_transport_simple_send_performance.sh \
783 test_transport_nat_icmp_tcp.sh \ 802 test_transport_nat_icmp_tcp.sh \
784 test_transport_nat_upnp.sh \ 803 test_transport_nat_upnp.sh \
@@ -1530,6 +1549,7 @@ test_transport_api_slow_ats_LDADD = \
1530 1549
1531 1550
1532EXTRA_DIST = \ 1551EXTRA_DIST = \
1552test_transport_start_testcase.sh \
1533test_transport_simple_send_performance.sh \ 1553test_transport_simple_send_performance.sh \
1534test_transport_nat_icmp_tcp.sh \ 1554test_transport_nat_icmp_tcp.sh \
1535test_transport_nat_upnp.sh \ 1555test_transport_nat_upnp.sh \
diff --git a/src/transport/test_transport_start_testcase.sh b/src/transport/test_transport_start_testcase.sh
new file mode 100755
index 000000000..028c8f248
--- /dev/null
+++ b/src/transport/test_transport_start_testcase.sh
@@ -0,0 +1,12 @@
1#!/bin/bash
2read -p "Test case configuration to use:" conf
3if ! [ -d "/run/netns" ]; then
4 echo You have to create the directory /run/netns.
5fi
6if [ -f /proc/sys/kernel/unprivileged_userns_clone ]; then
7 if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" != 1 ]; then
8 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"
9 exit 78
10 fi
11fi
12exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; ./test_transport_start_with_config $conf"