Skip to content

Exercise ARP parsing and loopback port scans - #50

Merged
jacobyoby merged 1 commit into
mainfrom
fix/issue-13-discovery-tests
Sep 9, 2026
Merged

jacobyoby merged 1 commit into
mainfrom
fix/issue-13-discovery-tests

Conversation

@jacobyoby

Copy link
Copy Markdown
Owner

ARP discovery previously mixed command execution and platform parsing inside a catch-all that converted missing tools, permission failures, and parse regressions into an indistinguishable empty result. Port scanning had only parameter-validation coverage.

This change separates macOS arp, Linux ip neigh, and Linux fallback arp parsing into a private pure function. Recognized malformed neighbor lines, missing commands, and nonzero platform-command exits now terminate with an actionable error. The obsolete PowerShell 5 branch is removed, and Windows neighbor errors use -ErrorAction Stop.

Fixture tests cover macOS and both Linux formats, interface filtering, incomplete entries, dotted interface names, and malformed candidates. A mock-free loopback test starts a real TcpListener, verifies an open and closed ephemeral port, and captures a server banner.

Validation: git diff --check passed. PowerShell is unavailable on the local host; GitHub Actions will run Pester on Linux, macOS, and Windows plus PSScriptAnalyzer.

Closes #13

@jacobyoby
jacobyoby merged commit 06070ea into main Sep 9, 2026
4 checks passed
@jacobyoby
jacobyoby deleted the fix/issue-13-discovery-tests branch September 9, 2026 02:52
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.

No functional tests for Get-LocalARPTable or Invoke-PortScan, and Get-LocalARPTable swallows every error

1 participant