git: 3c0846bd9c3d - main - pf tests: basic osfp test
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 25 Sep 2026 15:45:54 UTC
The branch main has been updated by kp:
URL: https://cgit.FreeBSD.org/src/commit/?id=3c0846bd9c3dfbe82377f90ef8ef1ef26e746fb9
commit 3c0846bd9c3dfbe82377f90ef8ef1ef26e746fb9
Author: Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2026-09-24 14:31:41 +0000
Commit: Kristof Provost <kp@FreeBSD.org>
CommitDate: 2026-09-25 15:45:43 +0000
pf tests: basic osfp test
Load, list and clear the fingerprints.
Sponsored by: Rubicon Communications, LLC ("Netgate")
---
tests/sys/netpfil/pf/Makefile | 1 +
tests/sys/netpfil/pf/osfp.sh | 63 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 64 insertions(+)
diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile
index 7b2e32c09543..c95bac83c92c 100644
--- a/tests/sys/netpfil/pf/Makefile
+++ b/tests/sys/netpfil/pf/Makefile
@@ -33,6 +33,7 @@ ATF_TESTS_SH+= altq \
nat \
nat64 \
once \
+ osfp \
pass_block \
pflog \
pflow \
diff --git a/tests/sys/netpfil/pf/osfp.sh b/tests/sys/netpfil/pf/osfp.sh
new file mode 100644
index 000000000000..9f0fb3713f3c
--- /dev/null
+++ b/tests/sys/netpfil/pf/osfp.sh
@@ -0,0 +1,63 @@
+#
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2026 Rubicon Communications, LLC (Netgate)
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+
+. $(atf_get_srcdir)/utils.subr
+
+atf_test_case "load_clear" "cleanup"
+load_clear_head()
+{
+ atf_set descr 'Test loading and clearing the OS fingerprint database'
+ atf_set require.user root
+}
+
+load_clear_body()
+{
+ pft_init
+
+ vnet_mkjail alcatraz
+
+ pft_set_rules alcatraz \
+ "set fingerprints \"/etc/pf.os\""
+
+ atf_check -s exit:0 -o match:".*FreeBSD.*" \
+ jexec alcatraz pfctl -sosfp
+
+ atf_check -s exit:0 \
+ jexec alcatraz pfctl -Fosfp
+
+ atf_check -s exit:0 -o not-match:".*FreeBSD.*" \
+ jexec alcatraz pfctl -sosfp
+}
+
+load_clear_cleanup()
+{
+ pft_cleanup
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case "load_clear"
+}