test(ufw): cover the service_rules cases with fewer owners #469

Open
Claude wants to merge 1 commits from test/457-ufw-fewer-owners into main
pull from: test/457-ufw-fewer-owners
Owner

What and why

Closes #457

The ufw scenario's converge called service_rules 8 times, once per owner, and every call runs in both check passes, converge and idempotence on both platforms. It now calls it 3 times, with every case kept:

Old owner and case New owner
a: 8001 (also the collision case), 8002 with from svc_a
b: 8003, the 8004 deny with no comment and no proto svc_a
g: 8022 with a comment that mentions 22 svc_a
e: 7201, stale 7003 kept because purge is off svc_a
c: 7101, stale 7001 deleted svc_c
h: 7301, SSH lookalike kept svc_c
p: 7602, stale 7601 deleted, no-port, source-only and range rules kept svc_c
d (absent) svc_d, unchanged
  • Tagged rules stay at 20 (svc_a 7, svc_c 7, m 1, o2 1, o3 4) and untagged at 5. Owner isolation is still proven: svc_c purges after svc_a has run, and svc_a's stale 7003 must survive.
  • Converge keeps two orphan checks: one after the three no-op cases and one after the purge. The verify-side check after the invalid managed owner is dropped, because the Verify play asserts the same state. The cost is diagnostic only: a failure no longer says which no-op case deleted a rule.
  • Converge runs with gather_facts: false; the role reads no facts.

Verified

  • pre-commit run --all-files passes, and ansible-test sanity passed on push.
  • A clean-context review worked the scenario through by hand from service_rules.yml, computing the rule keys, for converge, idempotence and both check passes. Every count and assert holds, and the collision, SSH-lookalike and 8022 cases still behave as before.

Not verified

  • The scenario on a container: this PR's Molecule run is the first. Its scenario time goes into a comment here once it finishes.

  • I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.

Assisted-by: Claude Code

## What and why Closes #457 The `ufw` scenario's converge called `service_rules` 8 times, once per owner, and every call runs in both check passes, converge and idempotence on both platforms. It now calls it 3 times, with every case kept: | Old owner and case | New owner | |---|---| | a: 8001 (also the collision case), 8002 with `from` | svc_a | | b: 8003, the 8004 deny with no comment and no proto | svc_a | | g: 8022 with a comment that mentions 22 | svc_a | | e: 7201, stale 7003 kept because purge is off | svc_a | | c: 7101, stale 7001 deleted | svc_c | | h: 7301, SSH lookalike kept | svc_c | | p: 7602, stale 7601 deleted, no-port, source-only and range rules kept | svc_c | | d (absent) | svc_d, unchanged | - Tagged rules stay at 20 (svc_a 7, svc_c 7, m 1, o2 1, o3 4) and untagged at 5. Owner isolation is still proven: svc_c purges after svc_a has run, and svc_a's stale 7003 must survive. - Converge keeps two orphan checks: one after the three no-op cases and one after the purge. The verify-side check after the invalid managed owner is dropped, because the Verify play asserts the same state. The cost is diagnostic only: a failure no longer says which no-op case deleted a rule. - Converge runs with `gather_facts: false`; the role reads no facts. ## Verified - `pre-commit run --all-files` passes, and `ansible-test sanity` passed on push. - A clean-context review worked the scenario through by hand from `service_rules.yml`, computing the rule keys, for converge, idempotence and both check passes. Every count and assert holds, and the collision, SSH-lookalike and `8022` cases still behave as before. ## Not verified - The scenario on a container: this PR's Molecule run is the first. Its scenario time goes into a comment here once it finishes. --- - [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none. Assisted-by: Claude Code
Claude added this to the CI velocity (emergency) milestone 2026-11-28 21:55:59 +00:00
Claude added 1 commit 2026-11-28 21:56:00 +00:00
test(ufw): cover the service_rules cases with fewer owners
Build / build (pull_request) Successful in 37s
Lint / lint (pull_request) Successful in 2m46s
Molecule / molecule (pull_request) Successful in 18m9s
0779e8b5c7
The scenario called service_rules once per owner, eight times, about 30 tasks each, on every
check, converge and idempotence pass. Three owners keep every case.

- svc_a (no purge): the old svc_a (8001, 8002 with from), svc_b (8003, the 8004 deny with no
  comment or proto), svc_g (8022 with a comment mentioning 22), svc_e (7201 and the stale
  7003 kept because purging is off).
- svc_c (purge): the old svc_c (7101, stale 7001 deleted), svc_h (7301, the stale SSH
  lookalike kept), svc_p (7602, stale 7601 deleted, no-port, source-only and range rules
  kept). svc_a's stale 7003 surviving svc_c's purge proves owner isolation.
- svc_d (absent): unchanged.

The tagged total stays at 20 (svc_a 7, svc_c 7, svc_m 1, svc_o2 1, svc_o3 4) and the untagged
at 5. Converge keeps two orphan checks, one after the three cases without a purge and one after
the purge; the check after the invalid managed owner in verify goes, as the Verify play asserts
the same state. Converge gathers no facts: the role reads none.

Closes #457

Assisted-by: Claude Code
Author
Owner

Measured: the Molecule job passed. The change selects ufw and its users gitea, gitea_runner and traefik; ufw/default took 1005 s while sharing the runner with another PR's run. Task rounds in the scenario went from 1890 to 1167 (−38%), against the log of run 6363 on main before this change. Seconds from this run are not a fair comparison: traefik/default took 1074 s here and 523 s when it ran alone in #470.

Assisted-by: Claude Code

Measured: the Molecule job passed. The change selects `ufw` and its users `gitea`, `gitea_runner` and `traefik`; `ufw/default` took 1005 s while sharing the runner with another PR's run. Task rounds in the scenario went from 1890 to 1167 (−38%), against the log of run 6363 on `main` before this change. Seconds from this run are not a fair comparison: `traefik/default` took 1074 s here and 523 s when it ran alone in #470. Assisted-by: Claude Code
All checks were successful
Build / build (pull_request) Successful in 37s
Required
Details
Lint / lint (pull_request) Successful in 2m46s
Required
Details
Molecule / molecule (pull_request) Successful in 18m9s
Required
Details
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin test/457-ufw-fewer-owners:test/457-ufw-fewer-owners
git checkout test/457-ufw-fewer-owners
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#469