pfctl tests: Test fairq configurationWe used to have a bug where pfctl could crash setting fairq queues. Testthis case and ensure it does not crash pfctl.Reviewed by: donnerMFC after: 1 weekSp
pfctl tests: Test fairq configurationWe used to have a bug where pfctl could crash setting fairq queues. Testthis case and ensure it does not crash pfctl.Reviewed by: donnerMFC after: 1 weekSponsored by: Rubicon Communications, LLC ("Netgate")Differential Revision: https://reviews.freebsd.org/D30348(cherry picked from commit 9938fcaa6565a660c555a0e9c712842ba1a2d31c)
show more ...
sbin/pfctl: fix tests after recent output changesThe output now contains http-alt instead of 8080 and personal-agentinstead of 5555.This was probably caused by 228e2087a32847fa51168f3f0c58f931cb2
sbin/pfctl: fix tests after recent output changesThe output now contains http-alt instead of 8080 and personal-agentinstead of 5555.This was probably caused by 228e2087a32847fa51168f3f0c58f931cb2cb0f8.Reviewed By: kpDifferential Revision: https://reviews.freebsd.org/D28481(cherry picked from commit 58de61b9967b36f5fbd34e8b51ece7b4b772f104)
[pfctl_tests] Add missing void to empty function declarationOur gcc-6.4 flags require non-empty function declarations.Fix this to match the rest of the codebase.Tested:* compiled on gcc-6.4 fo
[pfctl_tests] Add missing void to empty function declarationOur gcc-6.4 flags require non-empty function declarations.Fix this to match the rest of the codebase.Tested:* compiled on gcc-6.4 for amd64Reviewed by: impDifferential Revision: https://reviews.freebsd.org/D26795
Rewrite pfctl_test in C to reduce testsuite run timeThe new C test takes 25 seconds on QEMU-RISC-V, wheras the shell versiontakes 332 seconds.Even with the latest optimizations to atf-sh this te
Rewrite pfctl_test in C to reduce testsuite run timeThe new C test takes 25 seconds on QEMU-RISC-V, wheras the shell versiontakes 332 seconds.Even with the latest optimizations to atf-sh this test still takes a fewseconds to startup in QEMU. Re-writing it in C reduces the runtime for asingle test from about 2-3 seconds to less than .5 seconds. Since thereare ~80 tests, this adds up to about 3-4 minutes.This may not seem like a big speedup, but before the recent optimizationsto avoid atf_get_srcdir, each test took almost 100 seconds on QEMU RISC-Vinstead of 3. This also significantly reduces the time it takes to listthe available test cases, which speeds up running the tests via kyua:```root@qemu-riscv64-alex:~ # /usr/bin/time kyua test -k /usr/tests/sbin/pfctl/Kyuafile pfctl_test_old...158/158 passed (0 failed) 332.08 real 42.58 user 286.17 sysroot@qemu-riscv64-alex:~ # /usr/bin/time kyua test -k /usr/tests/sbin/pfctl/Kyuafile pfctl_test158/158 passed (0 failed) 24.96 real 9.75 user 14.26 sysroot@qemu-riscv64-alex:/usr/tests/sbin/pfctl # /usr/bin/time ./pfctl_test pf1001pfctl_test: WARNING: Running test cases outside of kyua(1) is unsupportedpfctl_test: WARNING: No isolation nor timeout control is being applied; you may get unexpected failures; see atf-test-case(4)Running pfctl -o none -nvf /usr/tests/sbin/pfctl/./files/pf1001.in---binat on em0 inet6 from fc00::/64 to any -> fc00:0:0:1::/64binat on em0 inet6 from any to fc00:0:0:1::/64 -> fc00::/64---passed 0.17 real 0.06 user 0.08 sysroot@qemu-riscv64-alex:/usr/tests/sbin/pfctl # /usr/bin/time ./pfctl_test_old pf1001pfctl_test_old: WARNING: Running test cases outside of kyua(1) is unsupportedpfctl_test_old: WARNING: No isolation nor timeout control is being applied; you may get unexpected failures; see atf-test-case(4)Id Refs Name141 1 pfExecuting command [ pfctl -o none -nvf - ]passed 1.73 real 0.25 user 1.41 sysroot@qemu-riscv64-alex:/usr/tests/sbin/pfctl # /usr/bin/time ./pfctl_test_old -l > /dev/null 24.36 real 2.26 user 21.86 sysroot@qemu-riscv64-alex:/usr/tests/sbin/pfctl # /usr/bin/time ./pfctl_test -l > /dev/null 0.04 real 0.02 user 0.01 sys```The speedups are even more noticeable on CHERI-RISC-V (since QEMU runsslower when emulating CHERI instructions):```root@qemu-cheri-alex:/usr/tests/sbin/pfctl # /usr/bin/time ./pfctl_test_new -l > /dev/null 0.51 real 0.49 user 0.00 sysroot@qemu-cheri-alex:/usr/tests/sbin/pfctl # /usr/bin/time ./pfctl_test -l > /dev/null 34.20 real 32.69 user 0.16 sysroot@qemu-cheri-alex:/usr/tests/sbin/pfctl # /usr/bin/time ./pfctl_test pf1001pfctl_test: WARNING: Running test cases outside of kyua(1) is unsupportedpfctl_test: WARNING: No isolation nor timeout control is being applied; you may get unexpected failures; see atf-test-case(4)Id Refs Name147 1 pfExecuting command [ pfctl -o none -nvf - ]passed 5.74 real 5.41 user 0.03 sysroot@qemu-cheri-alex:/usr/tests/sbin/pfctl # /usr/bin/time ./pfctl_test_new pf1001pfctl_test_new: WARNING: Running test cases outside of kyua(1) is unsupportedpfctl_test_new: WARNING: No isolation nor timeout control is being applied; you may get unexpected failures; see atf-test-case(4)Running pfctl -o none -nvf /usr/tests/sbin/pfctl/./files/pf1001.in---binat on em0 inet6 from fc00::/64 to any -> fc00:0:0:1::/64binat on em0 inet6 from any to fc00:0:0:1::/64 -> fc00::/64---passed 0.68 real 0.66 user 0.00 sysroot@qemu-cheri-alex:/usr/tests/sbin/pfctl #```Reviewed By: kpDifferential Revision: https://reviews.freebsd.org/D26779
pfctl_test: avoid 200 calls to atf_get_srcdirI have been trying to reduce the time that testsuite runs take for CheriBSDon QEMU (currently about 22 hours). One of the slowest tests is pfctl_test:
pfctl_test: avoid 200 calls to atf_get_srcdirI have been trying to reduce the time that testsuite runs take for CheriBSDon QEMU (currently about 22 hours). One of the slowest tests is pfctl_test:Just listing the available test cases currently takes 98 seconds on aCheriBSD RISC-V system due to all the processes being spawned. This trivialpatch reduces the time to 92 seconds. The better solution would be torewrite the test in C/C++ which I may do as a follow-up change.Reviewed By: kpDifferential Revision: https://reviews.freebsd.org/D26417
Fix test cases after r358448sbin.pfctl.pfctl_test.pf0087sbin.pfctl.pfctl_test.selfpf0087MFC with: r358448Sponsored by: The FreeBSD Foundation
pkgbase: pfctl: tests: Put tests files in the FreeBSD-tests packageReviewed by: kp, gjbDifferential Revision: https://reviews.freebsd.org/D21521
pfctl test: Add a test for macro names with a space in it
pf tests: Fix incorrect test for PR 231323Fix r339466. The test result file did not list the rdr rule.Additionally, the route-to rule needs a redirection address.X-MFC-with: 339466
pfctl tests: Basic test case for PR 231323PR: 231323MFC after: 2 weeksDifferential Revision: https://reviews.freebsd.org/D17508
Convert bsd.files.mk to support DIRS and simplify by only having one installtarget.Also update the pfctl tests Makefile to work with this change.Approved by: bapt (mentor)Differential Revision:
Convert bsd.files.mk to support DIRS and simplify by only having one installtarget.Also update the pfctl tests Makefile to work with this change.Approved by: bapt (mentor)Differential Revision: https://reviews.freebsd.org/D16430
Skip the pftcl(8) tests if pf isn't loaded.Previously, they would simply fail.MFC after: 2 weeks
DIRDEPS_BUILD: Connect new directories.Sponsored by: Dell EMC Isilon
pfctl parser testsCopy the most important test cases from OpenBSD's correspondingsrc/regress/sbin/pfctl, those that run pfctl on a test input file and checkcorrectness of its output. We have also
pfctl parser testsCopy the most important test cases from OpenBSD's correspondingsrc/regress/sbin/pfctl, those that run pfctl on a test input file and checkcorrectness of its output. We have also added some new tests using the sameformat.The tests consist of a collection of input files (pf*.in) andcorresponding output files (pf*.ok). We run pfctl -nv on the inputfiles and check that the output matches the output files. If anydiscrepancy is discovered during future development in the sourcetree, we know that a regression bug has been introduced into the tree.Submitted by: paggasSponsored by: Google, Inc (GSoC 2017)Differential Revision: https://reviews.freebsd.org/D11322