fix(#505): harden tests and correct uncovered network behavior - #505
Merged
Conversation
Replace permissive and redundant tests with exact happy-path, failure-path, payload, error, boundary, race, and cleanup assertions. Add isolated NetworkManager integration coverage for settings events, secret agent requests, WireGuard activation, wired DHCP, WiFi authentication, and monitor callbacks. Fix behavioral defects exposed by the audit, including builder serialization, saved WiFi credential handling, monitor readiness, secret-agent concurrency, veth classification, validation, and active-connection enumeration races.
cachebag
had a problem deploying
to
self-hosted-pr-integration
July 18, 2026 15:19 — with
GitHub Actions
Failure
cachebag
had a problem deploying
to
self-hosted-pr-integration
July 18, 2026 15:21 — with
GitHub Actions
Failure
cachebag
had a problem deploying
to
self-hosted-pr-integration
July 18, 2026 15:23 — with
GitHub Actions
Failure
cachebag
had a problem deploying
to
self-hosted-pr-integration
July 18, 2026 15:27 — with
GitHub Actions
Failure
cachebag
force-pushed
the
fix/505-test-audit-hardening
branch
from
July 18, 2026 15:29
c46b73f to
0585f7a
Compare
cachebag
had a problem deploying
to
self-hosted-pr-integration
July 18, 2026 15:29 — with
GitHub Actions
Failure
cachebag
had a problem deploying
to
self-hosted-pr-integration
July 18, 2026 15:35 — with
GitHub Actions
Failure
Treat a managed WiFi device in NetworkManagers transient Unavailable state as a readiness candidate instead of returning WifiNotReady immediately.
cachebag
temporarily deployed
to
self-hosted-pr-integration
July 18, 2026 15:39 — with
GitHub Actions
Inactive
cachebag
added a commit
that referenced
this pull request
Jul 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR performs a comprehensive audit and overhaul of the unit and integration test suites. The previous suite had several permissive, redundant, or overly broad assertions that could remain green without proving the intended behavior. Tests now validate exact D-Bus payloads, typed errors, state transitions, boundary conditions, race handling, cleanup behavior, and both successful and failing paths.
The integration suite has been consolidated into four strict, isolated contracts covering saved-profile CRUD and events, secret-agent registration and request handling, native WireGuard activation, wired DHCP, WPA WiFi authentication, saved-credential reuse, and callback monitoring. These tests use panic-safe cleanup and run against a private NetworkManager environment so they cannot modify developer or CI host profiles.
The audit also exposed several production defects. This PR corrects NetworkManager payload construction and decoding for WiFi, Bluetooth, VLAN, WireGuard, OpenVPN, and access points. It fixes fresh versus saved WiFi credential handling, removes failed newly-created profiles while preserving existing profiles, strengthens validation and OpenVPN parsing, prevents certificate-store collisions, and improves activation timeout handling.
Monitoring APIs now wait until their D-Bus subscriptions are ready before returning, preventing callers from missing immediate changes. Secret-agent handling now reports accurate lifecycle errors, supports concurrent requests with identical keys, handles cancellation and backpressure correctly, and reports closed responders. Active-connection enumeration also tolerates NetworkManager objects disappearing during a snapshot without hiding unrelated D-Bus failures.
Device handling now ignores unmanaged interfaces during automatic selection and recognizes NetworkManager veth devices as wired Ethernet. The integration harness includes private D-Bus, udev, veth, dnsmasq, WireGuard, hostapd, wpa_supplicant, and mac80211_hwsim support, with CI safeguards to prevent the host NetworkManager from claiming test radios. Related documentation, contributor guidance, test commands, and changelog entries have been updated.
AI Disclosure: GPT 5.6 Sol on Ultra via Zed was tasked with performing almost all of the changes. Specific coverage and unit tests we're manually refined by me and all code was manually reviewed and tested.