tests: tests for scope inheritance in rules/policies v1 - #3323
Conversation
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds regression tests for firewall rule/policy action scope inheritance validation (Suricata v9+), covering both valid inherited scopes and expected failures when an inherited scope is incompatible with a secondary action.
Changes:
- Added a “valid” test ensuring inherited scopes don’t incorrectly reject rules.
- Added an “invalid rule” test where
passinherits an unsupportedhookscope and must fail. - Added an “invalid policies” test where default policy scope inheritance triggers the same validation failure.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/firewall/firewall-action-scope-inherited-valid/test.yaml | New test asserting all rules load successfully under inherited-scope validation |
| tests/firewall/firewall-action-scope-inherited-valid/suricata.yaml | Enables engine analysis and logs to suricata.log for assertions |
| tests/firewall/firewall-action-scope-inherited-valid/firewall.rules | Adds rules that rely on scope inheritance being accepted for supported cases |
| tests/firewall/firewall-action-scope-inherited-rule-invalid/test.yaml | New negative test asserting Suricata exits non-zero and logs the expected validation error |
| tests/firewall/firewall-action-scope-inherited-rule-invalid/suricata.yaml | Minimal config for the negative test logging |
| tests/firewall/firewall-action-scope-inherited-rule-invalid/firewall.rules | Single rule designed to fail due to invalid inherited scope for pass |
| tests/firewall/firewall-action-scope-inherited-policies-invalid/test.yaml | New negative test asserting invalid inherited scope via default policy config |
| tests/firewall/firewall-action-scope-inherited-policies-invalid/suricata.yaml | Adds firewall.policies.default-policy configuration to trigger failure |
| tests/firewall/firewall-action-scope-inherited-policies-invalid/firewall.rules | Placeholder rules file (none required for policy-only validation) |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| - file: | ||
| enabled: yes | ||
| filename: suricata.log | ||
|
|
| - file: | ||
| enabled: yes | ||
| filename: suricata.log | ||
|
|
| logging: | ||
| outputs: | ||
| - file: | ||
| enabled: yes |
|
continues in #3329 |
Redmine ticket: https://redmine.openinfosecfoundation.org/issues/8954