Page MenuHomeFreeBSD

ipfw(8): add ioctl/instruction generation tests
ClosedPublic

Authored by melifaro on Jun 11 2023, 4:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 16, 8:35 PM
Unknown Object (File)
Wed, Apr 2, 1:15 AM
Unknown Object (File)
Feb 28 2025, 3:29 AM
Unknown Object (File)
Feb 8 2025, 12:33 PM
Unknown Object (File)
Nov 28 2024, 6:18 AM
Unknown Object (File)
Nov 22 2024, 6:48 AM
Unknown Object (File)
Nov 22 2024, 6:48 AM
Unknown Object (File)
Nov 22 2024, 6:48 AM

Details

Summary

Add ABI-related tests for ipfw(8).

The tests are handy to ensure smooth upcoming libipfw(3) introduction.

This diff adds the python framework for parsing and generating ipfw ioctls (rules only ATM).
ipfw(8) is extended with -x key which triggers dumping ioctls (wrapped in the debug header) to the stdout, where they can be read by the tests.
Most likely, this interface is temporary for the duration of ipfw(8) conversion to use libipfw. After the conversion, the different, yet-to-be-created interface will be used.

The current form is handy as it allows "cheap" testing without any side-effects.

Test Plan
17:51 [0] m@devel0 s kyua test -k /usr/tests/sbin/ipfw/Kyuafile
test_add_rule.py:TestAddRule::test_add_ports[test_range-dst]  ->  passed  [0.228s]
test_add_rule.py:TestAddRule::test_add_ports[test_range-src]  ->  passed  [0.257s]
test_add_rule.py:TestAddRule::test_add_ports[test_ranges-dst]  ->  passed  [0.228s]
test_add_rule.py:TestAddRule::test_add_ports[test_ranges-src]  ->  passed  [0.227s]
test_add_rule.py:TestAddRule::test_add_ports[test_single-dst]  ->  passed  [0.227s]
test_add_rule.py:TestAddRule::test_add_ports[test_single-src]  ->  passed  [0.227s]
test_add_rule.py:TestAddRule::test_add_rule[test_keep_state]  ->  passed  [0.257s]
test_add_rule.py:TestAddRule::test_add_rule[test_or]  ->  passed  [0.229s]
test_add_rule.py:TestAddRule::test_add_rule[test_rulenum]  ->  passed  [0.233s]
test_add_rule.py:TestAddRule::test_add_rule[test_tables]  ->  passed  [0.284s]
test_add_rule.py:TestAddRule::test_add_single_instruction[test_ports]  ->  passed  [0.252s]
test_add_rule.py:TestAddRule::test_add_single_instruction[test_prob]  ->  passed  [0.238s]
test_add_rule.py:TestAddRule::test_add_single_instruction[test_proto]  ->  passed  [0.246s]

Results file id is usr_tests_sbin_ipfw.20230611-175151-288150
Results saved to /home/melifaro/.kyua/store/results.usr_tests_sbin_ipfw.20230611-175151-288150.db

13/13 passed (0 failed)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Errors
SeverityLocationCodeMessage
Errorsbin/ipfw/tests/test_add_rule.py:69E501PEP8 E501
Errorsbin/ipfw/tests/test_add_rule.py:131E501PEP8 E501
Errorsbin/ipfw/tests/test_add_rule.py:144E501PEP8 E501
Errorsbin/ipfw/tests/test_add_rule.py:145E501PEP8 E501
Errorsbin/ipfw/tests/test_add_rule.py:162E501PEP8 E501
Errorsbin/ipfw/tests/test_add_rule.py:200E501PEP8 E501
Errorsbin/ipfw/tests/test_add_rule.py:264E501PEP8 E501
Errortests/atf_python/sys/netpfil/ipfw/insns.py:92E262PEP8 E262
Errortests/atf_python/sys/netpfil/ipfw/insns.py:222E501PEP8 E501
Errortests/atf_python/sys/netpfil/ipfw/insns.py:261E203PEP8 E203
Errortests/atf_python/sys/netpfil/ipfw/insns.py:273E203PEP8 E203
Errortests/atf_python/sys/netpfil/ipfw/insns.py:334E501PEP8 E501
Errortests/atf_python/sys/netpfil/ipfw/insns.py:395E501PEP8 E501
Errortests/atf_python/sys/netpfil/ipfw/insns.py:396E501PEP8 E501
Errortests/atf_python/sys/netpfil/ipfw/insns.py:443E501PEP8 E501
Errortests/atf_python/sys/netpfil/ipfw/insns.py:462E203PEP8 E203
Errortests/atf_python/sys/netpfil/ipfw/insns.py:493E501PEP8 E501
Errortests/atf_python/sys/netpfil/ipfw/ioctl.py:174E501PEP8 E501
Errortests/atf_python/sys/netpfil/ipfw/ioctl.py:209E203PEP8 E203
Errortests/atf_python/sys/netpfil/ipfw/ioctl.py:209E501PEP8 E501
Errortests/atf_python/sys/netpfil/ipfw/ioctl.py:212E203PEP8 E203
Errortests/atf_python/sys/netpfil/ipfw/ioctl.py:233E203PEP8 E203
Errortests/atf_python/sys/netpfil/ipfw/ioctl.py:320E203PEP8 E203
Errortests/atf_python/sys/netpfil/ipfw/ioctl.py:381E203PEP8 E203
Errortests/atf_python/sys/netpfil/ipfw/ioctl.py:381E501PEP8 E501
Unit
No Test Coverage
Build Status
Buildable 51996
Build 48887: arc lint + arc unit

Event Timeline

melifaro added reviewers: network, ae.
melifaro edited the summary of this revision. (Show Details)

Fix keep_state test.

This revision was not accepted when it landed; it landed in state Needs Review.Jun 13 2023, 11:56 AM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.