diff --git a/sbin/pfctl/tests/files/pf1006.in b/sbin/pfctl/tests/files/pf1006.in new file mode 100644 index 000000000000..b50c16994cfc --- /dev/null +++ b/sbin/pfctl/tests/files/pf1006.in @@ -0,0 +1,2 @@ +altq on igb0 fairq bandwidth 1Gb queue { qLink } +queue qLink fairq(default) diff --git a/sbin/pfctl/tests/files/pf1006.ok b/sbin/pfctl/tests/files/pf1006.ok new file mode 100644 index 000000000000..be44b765c2e9 --- /dev/null +++ b/sbin/pfctl/tests/files/pf1006.ok @@ -0,0 +1,2 @@ +altq on igb0 fairq bandwidth 1Gb tbrsize 36000 queue { qLink } +queue qLink fairq( default ) diff --git a/sbin/pfctl/tests/files/pfctl_test_descr.sh b/sbin/pfctl/tests/files/pfctl_test_descr.sh index 1f164c8c2596..e26e7bbf943c 100755 --- a/sbin/pfctl/tests/files/pfctl_test_descr.sh +++ b/sbin/pfctl/tests/files/pfctl_test_descr.sh @@ -1,82 +1,83 @@ # $FreeBSD$ # atf-sh, to be sourced by run.sh pf0001_descr () { echo "Pass with labels" ; } pf0002_descr () { echo "Block/pass" ; } pf0003_descr () { echo "Block/pass with flags" ; } pf0004_descr () { echo "Block" ; } pf0005_descr () { echo "Block with variables" ; } pf0006_descr () { echo "Variables" ; } pf0007_descr () { echo "Block/pass with return" ; } pf0008_descr () { echo "Block with address list" ; } pf0009_descr () { echo "Block with interface list" ; } pf0010_descr () { echo "Block/pass with return" ; } pf0011_descr () { echo "Block/pass ICMP" ; } pf0012_descr () { echo "Pass to subnets" ; } pf0013_descr () { echo "Pass quick" ; } pf0014_descr () { echo "Pass quick IPv6" ; } pf0016_descr () { echo "Pass with no state" ; } pf0018_descr () { echo "Address lists" ; } pf0019_descr () { echo "Lists" ; } pf0020_descr () { echo "Lists" ; } pf0022_descr () { echo "Set options" ; } pf0023_descr () { echo "Block on negated interface" ; } pf0024_descr () { echo "Variable concatenation" ; } pf0025_descr () { echo "Antispoof" ; } pf0026_descr () { echo "Block from negated interface" ; } pf0028_descr () { echo "Block with log and quick" ; } pf0030_descr () { echo "Line continuation" ; } pf0031_descr () { echo "Block policy" ; } pf0032_descr () { echo "Pass to any" ; } pf0034_descr () { echo "Pass with probability" ; } pf0035_descr () { echo "Matching on TOS" ; } pf0038_descr () { echo "Pass with user" ; } pf0039_descr () { echo "Ordered opts" ; } pf0040_descr () { echo "Block/pass" ; } pf0041_descr () { echo "Anchors" ; } pf0047_descr () { echo "Pass with labels" ; } pf0048_descr () { echo "Tables" ; } pf0049_descr () { echo "Broadcast and network modifiers" ; } pf0050_descr () { echo "Double macro set" ; } pf0052_descr () { echo "Set optimization" ; } pf0053_descr () { echo "Pass with labels" ; } pf0055_descr () { echo "Set options" ; } pf0056_descr () { echo "State opts" ; } pf0057_descr () { echo "Variables" ; } pf0060_descr () { echo "Pass from multicast" ; } pf0061_descr () { echo "Dynaddr with netmask" ; } pf0065_descr () { echo "Antispoof with labels" ; } pf0067_descr () { echo "Tags" ; } pf0069_descr () { echo "Tags" ; } pf0070_descr () { echo "Tags" ; } pf0071_descr () { echo "Tags" ; } pf0072_descr () { echo "Tags" ; } pf0074_descr () { echo "Synproxy" ; } pf0075_descr () { echo "Block quick with tags" ; } pf0077_descr () { echo "Dynaddr with netmask" ; } pf0078_descr () { echo "Table with label" ; } pf0079_descr () { echo "No-route with label" ; } pf0081_descr () { echo "Address list and table list with no-route" ; } pf0082_descr () { echo "Pass with interface, table and no-route" ; } pf0084_descr () { echo "Source track" ; } pf0085_descr () { echo "Tag macro expansion" ; } pf0087_descr () { echo "Optimization rule reordering" ; } pf0088_descr () { echo "Optimization duplicate rules handling" ; } pf0089_descr () { echo "TCP connection tracking" ; } pf0090_descr () { echo "Log opts" ; } pf0091_descr () { echo "Nested anchors" ; } pf0092_descr () { echo "Comments" ; } pf0094_descr () { echo "Address ranges" ; } pf0095_descr () { echo "Include" ; } pf0096_descr () { echo "Variables" ; } pf0097_descr () { echo "Divert-to" ; } pf0098_descr () { echo "Pass" ; } pf0100_descr () { echo "Anchor with multiple path components" ; } pf0101_descr () { echo "Prio" ; } pf0102_descr () { echo "Address lists with mixed address family" ; } pf0104_descr () { echo "Divert-to with localhost" ; } pf1001_descr () { echo "Binat" ; } pf1002_descr () { echo "Set timeout interval" ; } pf1003_descr () { echo "ALTQ" ; } pf1004_descr () { echo "ALTQ with Codel" ; } pf1005_descr () { echo "PR 231323" ; } +pf1006_descr () { echo "pfctl crashes with certain fairq configurations" ; } diff --git a/sbin/pfctl/tests/pfctl_test.sh b/sbin/pfctl/tests/pfctl_test.sh index 23cc755f5db7..b231170afb2c 100755 --- a/sbin/pfctl/tests/pfctl_test.sh +++ b/sbin/pfctl/tests/pfctl_test.sh @@ -1,48 +1,48 @@ # $FreeBSD$ # Make will add a #! line at the top of this file. # Tests 0001-0999 are copied from OpenBSD's regress/sbin/pfctl. # Tests 1001-1999 are ours (FreeBSD's own). # pf: Run pfctl -nv on pfNNNN.in and check that the output matches pfNNNN.ok. # Copied from OpenBSD. Main differences are some things not working # in FreeBSD: # * The action 'match' # * The command 'set reassemble' # * The 'from'/'to' options together with 'route-to' # * The option 'scrub' (it is an action in FreeBSD) # * Accepting undefined routing tables in actions (??: see pf0093.in) # * The 'route' option # * The 'set queue def' option # selfpf: Feed pfctl output through pfctl again and verify it stays the same. # Copied from OpenBSD. pftests="0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0016 0018 0019 0020 0022 0023 0024 0025 0026 0028 0030 0031 0032 0034 0035 0038 0039 0040 0041 0047 0048 0049 0050 0052 0053 0055 0056 0057 0060 0061 0065 0067 0069 0070 0071 0072 0074 0075 0077 0078 0079 0081 0082 0084 0085 0087 0088 0089 0090 0091 0092 0094 0095 0096 -0097 0098 0100 0101 0102 0104 1001 1002 1003 1004 1005" +0097 0098 0100 0101 0102 0104 1001 1002 1003 1004 1005 1006" . $(atf_get_srcdir)/files/pfctl_test_descr.sh for i in ${pftests} ; do atf_test_case "pf${i}" eval "pf${i}_head () { atf_set descr \"$(pf${i}_descr)\" ; }" eval "pf${i}_body () { \ kldstat -m pf || atf_skip \"pf(4) is not loaded\" && \ cd $(atf_get_srcdir)/files && \ atf_check -o file:pf${i}.ok \ pfctl -o none -nvf - < pf${i}.in ; }" atf_test_case "selfpf${i}" eval "selfpf${i}_head () { atf_set descr \"self$(pf${i}_descr)\" ; }" eval "selfpf${i}_body () { \ cd $(atf_get_srcdir)/files && \ atf_check -o file:pf${i}.ok \ pfctl -o none -nvf - < pf${i}.ok ; }" done atf_init_test_cases () { for i in ${pftests} ; do atf_add_test_case "pf${i}" atf_add_test_case "selfpf${i}" ; done ; }