git: cc136589fadb - stable/12 - pf tests: Add a defer mode test for pfsync
Kristof Provost
kp at FreeBSD.org
Sun Jan 3 22:18:50 UTC 2021
The branch stable/12 has been updated by kp:
URL: https://cgit.FreeBSD.org/src/commit/?id=cc136589fadb85996f9ba772a236fa500b6901dd
commit cc136589fadb85996f9ba772a236fa500b6901dd
Author: Kristof Provost <kp at FreeBSD.org>
AuthorDate: 2018-12-05 19:53:09 +0000
Commit: Kristof Provost <kp at FreeBSD.org>
CommitDate: 2021-01-03 20:26:48 +0000
pf tests: Add a defer mode test for pfsync
Repeat the pfsync test, this time with the 'defer' option enabled. This
exercises slightly different code paths.
(cherry picked from commit 369d9a2c153e45e2645bc78cdc3a8cdc42f45b7b)
---
tests/sys/netpfil/pf/pfsync.sh | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/tests/sys/netpfil/pf/pfsync.sh b/tests/sys/netpfil/pf/pfsync.sh
index 85e54675c498..95209b832c62 100755
--- a/tests/sys/netpfil/pf/pfsync.sh
+++ b/tests/sys/netpfil/pf/pfsync.sh
@@ -7,12 +7,16 @@ basic_head()
{
atf_set descr 'Basic pfsync test'
atf_set require.user root
-
- atf_set require.progs scapy
}
basic_body()
{
+ common_body
+}
+
+common_body()
+{
+ defer=$1
pfsynct_init
epair_sync=$(vnet_mkepair)
@@ -28,12 +32,14 @@ basic_body()
jexec one ifconfig pfsync0 \
syncdev ${epair_sync}a \
maxupd 1 \
+ $defer \
up
jexec two ifconfig ${epair_two}a 198.51.100.2/24 up
jexec two ifconfig ${epair_sync}b 192.0.2.2/24 up
jexec two ifconfig pfsync0 \
syncdev ${epair_sync}b \
maxupd 1 \
+ $defer \
up
# Enable pf!
@@ -64,7 +70,25 @@ basic_cleanup()
pfsynct_cleanup
}
+atf_test_case "defer" "cleanup"
+defer_head()
+{
+ atf_set descr 'Defer mode pfsync test'
+ atf_set require.user root
+}
+
+defer_body()
+{
+ common_body defer
+}
+
+defer_cleanup()
+{
+ pfsynct_cleanup
+}
+
atf_init_test_cases()
{
atf_add_test_case "basic"
+ atf_add_test_case "defer"
}
More information about the dev-commits-src-all
mailing list