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)
Sat, Oct 19, 12:44 PM
Unknown Object (File)
Sat, Oct 19, 12:43 PM
Unknown Object (File)
Sat, Oct 19, 12:43 PM
Unknown Object (File)
Sat, Oct 19, 12:43 PM
Unknown Object (File)
Sat, Oct 19, 12:23 PM
Unknown Object (File)
Oct 7 2024, 1:16 PM
Unknown Object (File)
Sep 24 2024, 3:13 PM
Unknown Object (File)
Sep 21 2024, 5:51 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 Not Applicable
Unit
Tests Not Applicable

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.