Skip to content

fix: raise clear error when ping utility is missing#64

Merged
ltekieli merged 1 commit intomainfrom
lt_itf_missing_ping_error
Mar 6, 2026
Merged

fix: raise clear error when ping utility is missing#64
ltekieli merged 1 commit intomainfrom
lt_itf_missing_ping_error

Conversation

@ltekieli
Copy link
Member

@ltekieli ltekieli commented Mar 6, 2026

Previously, if the system ping binary was not installed, os.system() returned exit code 127 (shell command not found), which was silently treated as a failed ping attempt. This caused a misleading assertion failure like "Target is not pingable within expected time frame" instead of indicating that ping itself is missing.

Fix by checking shutil.which("ping") before invoking the binary and raising a RuntimeError with an actionable message if it is absent.

Add unit tests covering the missing-binary error, reachable host, and unreachable host cases.

Closes #63

Previously, if the system ping binary was not installed, os.system()
returned exit code 127 (shell command not found), which was silently
treated as a failed ping attempt. This caused a misleading assertion
failure like "Target is not pingable within expected time frame"
instead of indicating that ping itself is missing.

Fix by checking shutil.which("ping") before invoking the binary and
raising a RuntimeError with an actionable message if it is absent.

Add unit tests covering the missing-binary error, reachable host,
and unreachable host cases.

Closes #63
@ltekieli ltekieli force-pushed the lt_itf_missing_ping_error branch from 5c7c340 to bc4dcd8 Compare March 6, 2026 12:45
@ltekieli ltekieli marked this pull request as ready for review March 6, 2026 12:45
@ltekieli ltekieli enabled auto-merge March 6, 2026 13:13
@ltekieli ltekieli added this pull request to the merge queue Mar 6, 2026
Merged via the queue into main with commit 44c75de Mar 6, 2026
5 checks passed
@ltekieli ltekieli deleted the lt_itf_missing_ping_error branch March 6, 2026 13:18
@github-project-automation github-project-automation bot moved this from Backlog to Done in TST - Testing Community Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

if the ping utility is missing the error message is missleading

2 participants