Skip to content

Add missing regression test for manual ip4table netifd classification#111

Draft
Copilot wants to merge 2 commits into
1.2.3from
copilot/fix-code-for-review-comment
Draft

Add missing regression test for manual ip4table netifd classification#111
Copilot wants to merge 2 commits into
1.2.3from
copilot/fix-code-for-review-comment

Conversation

Copy link
Copy Markdown

Copilot AI commented May 20, 2026

The review pointed out that the PR description claimed a regression test for the netifd/manual-ip4table classification bug, but no such test was present. This change adds that missing coverage without changing production code.

  • Regression coverage

    • Adds tests/05_interfaces/04_netifd_mark_chain.
    • Reproduces the case where an interface has a manual ip4table set in UCI but is not pbr-managed via env.netifd_mark.
  • What the test asserts

    • The interface is still treated as a normal pbr-managed interface (action == 'create').
    • The interface remains in ifacesTriggers.
    • pbr emits the per-mark nft chain for that interface.
    • Policy rules still goto the generated pbr_mark_<mark> chain.
  • Scope

    • Test-only change.
    • No production logic or config handling was modified.
{
  ".name": "vpn",
  "device": "tun0",
  "proto": "openvpn",
  "ip4table": "manual_vpn"
}

let vpn_gw = filter(result?.gateways || [], g => g.name == 'vpn')?.[0];
let vpn_mark = vpn_gw?.mark || '';

['vpn_action_create', vpn_gw?.action == 'create'];
['vpn_in_ifaces_triggers', index(result?.ifacesTriggers || '', 'vpn') >= 0];
['nft_has_vpn_mark_chain',
  index(nft_content, 'add chain inet fw4 pbr_mark_' + vpn_mark) >= 0];

Copilot AI changed the title [WIP] Fix code as per review comment suggestion Add missing regression test for manual ip4table netifd classification May 20, 2026
Copilot AI requested a review from stangri May 20, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants