diff options
Diffstat (limited to 'scripts/testing/net-scenarios/20-rival-manager.sh')
| -rw-r--r-- | scripts/testing/net-scenarios/20-rival-manager.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/testing/net-scenarios/20-rival-manager.sh b/scripts/testing/net-scenarios/20-rival-manager.sh new file mode 100644 index 0000000..0d7836b --- /dev/null +++ b/scripts/testing/net-scenarios/20-rival-manager.sh @@ -0,0 +1,27 @@ +# shellcheck shell=bash disable=SC2034 # sourced by run-net-scenarios.sh +# Scenario: a rival network manager active alongside NetworkManager is disabled. +# +# dhcpcd (or systemd-networkd / iwd) running next to NM fights it for the link. +# Break by enabling dhcpcd; the fix disables it, and the chain resets to +# reconnect. Requires dhcpcd installed in the target. +SCENARIO_DESC="an active rival manager (dhcpcd) is disabled" +SCENARIO_GROUP="control-plane" + +scenario_break() { + nexec "systemctl enable --now dhcpcd" +} + +scenario_diagnose_expect() { + # The verdict fires only when the link is also failing; in a fresh target + # with no configured uplink that holds, so the rival should be named. + ndoctor_json ".report.control_plane.rivals | index(\"dhcpcd\")" \ + | grep -vqx null +} + +scenario_fix() { + nfix +} + +scenario_assert() { + ! nexec "systemctl is-active dhcpcd >/dev/null 2>&1" +} |
