git: c589ea89f9f5 - main - pf tests: run the ioctl tests in their own vnet too

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Thu, 19 Nov 2026 16:59:54 UTC
The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=c589ea89f9f582f6c01d739f11ed46f0146f52d8

commit c589ea89f9f582f6c01d739f11ed46f0146f52d8
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2026-11-19 06:48:54 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2026-11-19 16:59:21 +0000

    pf tests: run the ioctl tests in their own vnet too
    
    Fix the validation:settflags test, because using a NULL buffer succeeds
    if there's no table to set tflags in. Create a table to fix the test.
    
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 tests/sys/netpfil/pf/ioctl/Makefile     | 4 ++++
 tests/sys/netpfil/pf/ioctl/validation.c | 8 ++++++++
 2 files changed, 12 insertions(+)

diff --git a/tests/sys/netpfil/pf/ioctl/Makefile b/tests/sys/netpfil/pf/ioctl/Makefile
index 6bcf48432d30..27ef15ea5110 100644
--- a/tests/sys/netpfil/pf/ioctl/Makefile
+++ b/tests/sys/netpfil/pf/ioctl/Makefile
@@ -2,6 +2,10 @@ PACKAGE=	tests
 
 TESTSDIR=       ${TESTSBASE}/sys/netpfil/pf/ioctl
 
+# Allow tests to run in parallel in their own jails
+TEST_METADATA+= execenv="jail"
+TEST_METADATA+= execenv_jail_params="vnet"
+
 ATF_TESTS_C += \
 	validation
 
diff --git a/tests/sys/netpfil/pf/ioctl/validation.c b/tests/sys/netpfil/pf/ioctl/validation.c
index 8de07d6506c4..0d7be8dfcaa2 100644
--- a/tests/sys/netpfil/pf/ioctl/validation.c
+++ b/tests/sys/netpfil/pf/ioctl/validation.c
@@ -346,6 +346,14 @@ ATF_TC_BODY(settflags, tc)
 	if (ioctl(dev, DIOCRSETTFLAGS, &io) != 0)
 		atf_tc_fail("Request with size 1 << 24 failed");
 
+	/*
+	 * Actually add a table, otherwise we don't do anything and a NULL buffer
+	 * succeeds.
+	 */
+	io.pfrio_size = 1;
+	if (ioctl(dev, DIOCRADDTABLES, &io) != 0)
+		atf_tc_fail("Failed to add a table.");
+
 	/* NULL buffer */
 	io.pfrio_buffer = NULL;
 	if (ioctl(dev, DIOCRSETTFLAGS, &io) != -1)