diff options
author | Kristof Provost <kp@FreeBSD.org> | 2024-10-02 09:59:23 +0000 |
---|---|---|
committer | Kristof Provost <kp@FreeBSD.org> | 2024-10-02 10:03:19 +0000 |
commit | c17a0f62da173df5e4a5433dfb90ef9f8dab98d4 (patch) | |
tree | ab79d1080ca7cc88bf2faa6de06fdcb0787b3d93 | |
parent | f5a04b16b1895b331d6b54534321a8395fc2d5de (diff) |
pf tests: use unique pid files for inetd processes
Ensure that we don't conflict with other inetd processes running in other jails
by setting an explicit pid file (rather than relying on the default /var/run/
inetd.pid). This could lead to failure to start inetd, which in turn could cause
test failures.
Sponsored by: Rubicon Communications, LLC ("Netgate")
-rw-r--r-- | tests/sys/netpfil/pf/ether.sh | 4 | ||||
-rw-r--r-- | tests/sys/netpfil/pf/utils.subr | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/sys/netpfil/pf/ether.sh b/tests/sys/netpfil/pf/ether.sh index 0369e0e57ee6..104baf468aa4 100644 --- a/tests/sys/netpfil/pf/ether.sh +++ b/tests/sys/netpfil/pf/ether.sh @@ -286,7 +286,7 @@ captive_body() # Run the echo server only on the gw, so we know we've redirectly # correctly if we get an echo message. - jexec gw /usr/sbin/inetd $(atf_get_srcdir)/echo_inetd.conf + jexec gw /usr/sbin/inetd -p ${PWD}/echo_inetd.pid $(atf_get_srcdir)/echo_inetd.conf # Confirm that we're getting redirected atf_check -s exit:0 -o match:"^foo$" -x "echo foo | nc -N 198.51.100.2 7" @@ -304,7 +304,7 @@ captive_body() atf_check -s exit:1 -x "echo foo | nc -N 198.51.100.2 7" # Start a server in srv - jexec srv /usr/sbin/inetd $(atf_get_srcdir)/echo_inetd.conf + jexec srv /usr/sbin/inetd -p ${PWD}/echo_inetd.pid $(atf_get_srcdir)/echo_inetd.conf # And now we can talk to that one. atf_check -s exit:0 -o match:"^foo$" -x "echo foo | nc -N 198.51.100.2 7" diff --git a/tests/sys/netpfil/pf/utils.subr b/tests/sys/netpfil/pf/utils.subr index 0b7ee621e6fa..c854ad5e69d8 100644 --- a/tests/sys/netpfil/pf/utils.subr +++ b/tests/sys/netpfil/pf/utils.subr @@ -217,7 +217,7 @@ setup_router_server_ipv4() jexec server route add -net ${net_tester} ${net_server_host_router} inetd_conf=$(mktemp) echo "discard stream tcp nowait root internal" > $inetd_conf - jexec server inetd $inetd_conf + jexec server inetd -p ${PWD}/inetd.pid $inetd_conf } # Create a bare router jail. @@ -271,7 +271,7 @@ setup_router_server_ipv6() jexec server route add -6 ${net_tester} ${net_server_host_router} inetd_conf=$(mktemp) echo "discard stream tcp6 nowait root internal" > $inetd_conf - jexec server inetd $inetd_conf + jexec server inetd -p ${PWD}/inetd.pid $inetd_conf } # Ping the dummy static NDP target. |