diff options
| author | Kristof Provost <kp@FreeBSD.org> | 2026-06-24 10:21:20 +0000 |
|---|---|---|
| committer | Kristof Provost <kp@FreeBSD.org> | 2026-06-28 13:59:35 +0000 |
| commit | e4f3ab161a9e149fd2f657f6d8af2ba3c618255f (patch) | |
| tree | b4d39639c7d18ff6acce6f0aa09f349d522d8370 /tests | |
| parent | be23edc1e4028e32a46e8fe7118de787fd5d79a2 (diff) | |
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/sys/netpfil/pf/nat64.py | 4 | ||||
| -rw-r--r-- | tests/sys/netpfil/pf/pflog.sh | 36 |
2 files changed, 38 insertions, 2 deletions
diff --git a/tests/sys/netpfil/pf/nat64.py b/tests/sys/netpfil/pf/nat64.py index ba0d2ae01a9e..990d99f57b08 100644 --- a/tests/sys/netpfil/pf/nat64.py +++ b/tests/sys/netpfil/pf/nat64.py @@ -33,7 +33,7 @@ from atf_python.sys.net.tools import ToolsHelper from atf_python.sys.net.vnet import VnetTestTemplate class TestNAT64(VnetTestTemplate): - REQUIRED_MODULES = [ "pf", "pflog" ] + REQUIRED_MODULES = [ "pf", "pflog", "pfsync" ] TOPOLOGY = { "vnet1": {"ifaces": ["if1"]}, "vnet2": {"ifaces": ["if1", "if2"]}, @@ -101,7 +101,7 @@ class TestNAT64(VnetTestTemplate): "pass in on %s inet6 af-to inet from 192.0.2.1" % ifname, ]) - vnet.pipe.send(socket.if_nametoindex("pflog0")) + vnet.pipe.send(socket.if_nametoindex("pfsync0")) @pytest.mark.require_user("root") @pytest.mark.require_progs(["scapy"]) diff --git a/tests/sys/netpfil/pf/pflog.sh b/tests/sys/netpfil/pf/pflog.sh index 0b737a96791f..3b8221895146 100644 --- a/tests/sys/netpfil/pf/pflog.sh +++ b/tests/sys/netpfil/pf/pflog.sh @@ -459,6 +459,41 @@ rule_number_cleanup() pft_cleanup } +atf_test_case "create_destroy" "cleanup" +create_destroy_head() +{ + atf_set descr 'Test adding/remove pflog interfaces' + atf_set require.user root +} + +create_destroy_body() +{ + pflog_init + + # Make sure pflog15 doesn't exist + atf_check -s exit:1 -e ignore timeout 3 \ + tcpdump -i pflog15 + + # Create more devices + sysctl net.pflog.if_count=16 + + # It does now + atf_check -s exit:124 -o ignore -e ignore timeout 3 \ + tcpdump -i pflog15 + + # Back down to the default 8 devices: + sysctl net.pflog.if_count=8 + + # And pflog15 no longer exists + atf_check -s exit:1 -e ignore timeout 3 \ + tcpdump -i pflog15 +} + +create_destroy_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "malformed" @@ -469,4 +504,5 @@ atf_init_test_cases() atf_add_test_case "unspecified_v6" atf_add_test_case "rdr_action" atf_add_test_case "rule_number" + atf_add_test_case "create_destroy" } |
