test: cover winget/DNS/network-repair services via IPowerShellRunner seam#824
Merged
Conversation
…seam Builds on the IPowerShellRunner seam to add the missing security-guard and invocation coverage (audit findings #4, #5, #8, #9), all with a substituted runner so no winget/netsh/DNS command ever runs: - BulkInstallerServiceTests: rejects injection IDs (&, ;, |, quote/backtick/ subexpression, newline, over-length, whitespace) before any process launch; asserts the exact winget args on the happy path; propagates exit codes. - DnsServiceTests: SetDnsAsync rejects malformed/injection addresses before any script runs; asserts the Set/Reset scripts and interface index via the seam; GetCurrentDns result mapping; preset contents. - NetworkRepairServiceTests: pins ipconfig/netsh invocations and the Success/NeedsReboot mapping for flush/winsock/tcpip, incl. non-zero exit and streamed-output collection. All literals are synthetic/public (Git.Git, 8.8.8.8, calc.exe). test: only — no production change, no release.
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.
What
Audit Round 4 / PR3 — uses the
IPowerShellRunnerseam (PR #823) to add the missing security-guard and invocation coverage (test findings #4, #5, #8, #9). Every test substitutes the runner, so no winget / netsh / ipconfig / DNS command ever runs.&,;,|, quote/backtick/$()break-out, newline, over-length, whitespace) before any process launch (verifies the runner is never called); asserts the exact winget args on the happy path (install --id "Git.Git" -e --silent ...); accepts valid public IDs; propagates exit codes.SetDnsAsyncrejects malformed/injection addresses before any script runs; asserts the Set/Reset scripts + resolved interface index via the seam;GetCurrentDnsAsyncresult mapping; preset contents.ipconfig /flushdns,netsh winsock reset,netsh int ip resetinvocations and the Success/NeedsReboot mapping (incl. non-zero exit keeping the intrinsic reboot flag, and streamed-output collection).Why
These guards are the only barrier between preset/user input and a shelled-out process; they had zero coverage (TEST-PROTOCOL Phase 2 mandate). Before the seam, tests were forced to
new XxxService(new PowerShellRunner())and avoid the Apply paths entirely.Notes
Git.Git,7zip.7zip,8.8.8.8,1.1.1.1,calc.exe,whoami. No real identities, emails, hostnames, or internal references anywhere.test:only — no production change, no version bump, no release.