git: 3a04f1d1ed01 - main - pf tests: Test MAC address negation

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Wed, 02 Mar 2022 16:00:48 UTC
The branch main has been updated by kp:

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

commit 3a04f1d1ed017402f1e59d1961f8014ec266ee2a
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2021-02-09 16:04:21 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2022-03-02 16:00:04 +0000

    pf tests: Test MAC address negation
    
    Test that we can express 'ether block from ! 00:01:02:03:04:05'.
    
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:  https://reviews.freebsd.org/D31744
---
 tests/sys/netpfil/pf/ether.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests/sys/netpfil/pf/ether.sh b/tests/sys/netpfil/pf/ether.sh
index 5724d6102505..2781dda611e5 100644
--- a/tests/sys/netpfil/pf/ether.sh
+++ b/tests/sys/netpfil/pf/ether.sh
@@ -75,6 +75,15 @@ mac_body()
 	pft_set_rules alcatraz \
 		"ether block on ${epair}a from ${epair_a_mac}"
 	atf_check -s exit:0 -o ignore ping -c 1 -t 1 192.0.2.2
+
+	# Test negation
+	pft_set_rules alcatraz \
+		"ether block in on ${epair}b from ! ${epair_a_mac}"
+	atf_check -s exit:0 -o ignore ping -c 1 -t 1 192.0.2.2
+
+	pft_set_rules alcatraz \
+		"ether block out on ${epair}b to ! ${epair_a_mac}"
+	atf_check -s exit:0 -o ignore ping -c 1 -t 1 192.0.2.2
 }
 
 mac_cleanup()