diff options
author | t3sserakt <t3ss@posteo.de> | 2023-07-14 19:10:52 +0200 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2023-07-14 19:10:52 +0200 |
commit | 80971b6327e1906bdfe2d3e9012f93c36bae47fa (patch) | |
tree | 13f3a22a8f9eb62c66b5b8a8518cfc3188a43440 /src | |
parent | 40a5a650d3b61aca9474692416adeba7272e61b3 (diff) | |
download | gnunet-80971b6327e1906bdfe2d3e9012f93c36bae47fa.tar.gz gnunet-80971b6327e1906bdfe2d3e9012f93c36bae47fa.zip |
TNG: Added generic start script for test cases.
Diffstat (limited to 'src')
-rw-r--r-- | src/transport/Makefile.am | 22 | ||||
-rwxr-xr-x | src/transport/test_transport_start_testcase.sh | 12 |
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 | |||
369 | libgnunet_test_transport_plugin_cmd_just_run_la_SOURCES = \ | ||
370 | test_transport_plugin_cmd_just_run.c | ||
371 | libgnunet_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) | ||
383 | libgnunet_test_transport_plugin_cmd_just_run_la_LDFLAGS = \ | ||
384 | $(GN_PLUGIN_LDFLAGS) | ||
367 | 385 | ||
368 | libgnunet_test_transport_plugin_cmd_nat_upnp_la_SOURCES = \ | 386 | libgnunet_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 |
780 | if HAVE_EXPERIMENTAL | 798 | if HAVE_EXPERIMENTAL |
781 | check_SCRIPTS= \ | 799 | check_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 | ||
1532 | EXTRA_DIST = \ | 1551 | EXTRA_DIST = \ |
1552 | test_transport_start_testcase.sh \ | ||
1533 | test_transport_simple_send_performance.sh \ | 1553 | test_transport_simple_send_performance.sh \ |
1534 | test_transport_nat_icmp_tcp.sh \ | 1554 | test_transport_nat_icmp_tcp.sh \ |
1535 | test_transport_nat_upnp.sh \ | 1555 | test_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 | ||
2 | read -p "Test case configuration to use:" conf | ||
3 | if ! [ -d "/run/netns" ]; then | ||
4 | echo You have to create the directory /run/netns. | ||
5 | fi | ||
6 | if [ -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 | ||
11 | fi | ||
12 | exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; ./test_transport_start_with_config $conf" | ||