Skip to content

Fix offline connectivity test for fancy busybox ping - #4905

Merged
agners merged 1 commit into
devfrom
fix/offline-test-fancy-ping
Jul 18, 2026
Merged

agners merged 1 commit into
devfrom
fix/offline-test-fancy-ping

Conversation

@agners

@agners agners commented Jul 18, 2026 •

Copy link
Copy Markdown
Member

The problem

The QEMU test job has failed on the last two dev builds. The first failure is test_ha_runs_offline, which times out (pytest-timeout, 120s) and cascades into the os_update/supervisor modules.

Root cause: #4854 enabled CONFIG_FEATURE_FANCY_PING in busybox (HAOS 18.2+). The fancy applet behaves like iputils ping — a bare ping HOST pings continuously and never returns without an explicit count. The offline connectivity helper ran ping 1.1.1.1, so on 18.2+ it blocks forever instead of doing a single probe:

# ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes    ← hangs until the test is killed

The minimal applet on <= 18.1 does the opposite — one-shot ping HOST prints HOST is alive! and rejects -c, so we can't just hard-code -c 1 either.

The fix

Detect the applet at runtime and adapt:

  • fancy (18.2+): ping -c 1 -W 2 HOST — bounded, matches on the ping statistics (0% packet loss), and accepts 100% packet loss as a disconnected result.
  • minimal (<= 18.1): fall back to the one-shot ping HOST and the HOST is alive! string.

Runtime capability detection keeps the test working on both pre- and post-18.2 images without gating on VERSION_ID.

Verified by hand against both applets:

# 18.1 (minimal)              | # 18.2.dev (fancy)
ping 1.1.1.1 -> "1.1.1.1 is   | ping -c 1 1.1.1.1 -> 64 bytes ...,
  alive!"                     |   0% packet loss
ping -c 1 -> Usage: ping HOST | (bare ping never returns)

Note

This fixes the offline test. The os_update failure in the same job (update to stable reports "Command completed successfully" but never installs to slot B / reboots) is a separate, Supervisor-side issue and is not addressed here.

Summary by CodeRabbit

  • Tests
    • Improved offline connectivity checks across environments with different BusyBox ping implementations.
    • Added support for recognizing additional success and failure messages, improving test reliability.

CONFIG_FEATURE_FANCY_PING (enabled in #4854, HAOS 18.2) turns `ping HOST`
into a continuous ping that never returns without an explicit count. The
offline smoke test's connectivity helper ran a bare `ping 1.1.1.1`, so on
18.2+ it blocked until the pytest timeout instead of doing a single probe,
failing test_ha_runs_offline (and cascading into the following test modules).

Detect the applet at runtime and adapt: use `ping -c 1 -W 2` when the fancy
applet is available (which bounds the run), and fall back to the minimal
one-shot `ping HOST` otherwise. Match both output styles ("HOST is alive!"
vs. ping statistics) and accept "100% packet loss" as a disconnected result.

Runtime capability detection keeps the test working on both pre- and
post-18.2 images without hard-coding version numbers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 18, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5c33c9a0-73e1-4bfa-a424-0ee2f32303ca

📥 Commits

Reviewing files that changed from the base of the PR and between ef7db16 and d078e9b.

📒 Files selected for processing (1)
  • tests/smoke_test/test_offline.py

📝 Walkthrough

Walkthrough

The offline smoke tests now detect BusyBox fancy ping support, choose a compatible ping command, and recognize additional success and failure output formats for connectivity checks.

Changes

Offline connectivity checks

Layer / File(s) Summary
Ping detection and connectivity assertions
tests/smoke_test/test_offline.py
Adds fancy-ping detection, dynamically selects bounded or plain ping commands, and accepts 0% packet loss and 100% packet loss outputs.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

A rabbit checked the ping in the night,
Fancy or plain, it chose just right.
“Alive!” it heard, or packets gone,
And bounded hops before the dawn.
The offline tests now thump along.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: updating the offline connectivity test to handle BusyBox fancy ping behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/offline-test-fancy-ping

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a flaky/hanging offline smoke test by adapting the connectivity probe to BusyBox’s two different ping behaviors (minimal one-shot vs. fancy continuous-by-default), ensuring the test remains bounded and reliable across HAOS versions.

Changes:

  • Added runtime detection of the “fancy” BusyBox ping applet (supports -c/statistics).
  • Updated the connectivity helper to use ping -c 1 -W 2 for fancy ping and fallback to bare ping HOST for minimal ping.
  • Expanded disconnected-mode acceptance to include the 100% packet loss outcome as a valid “offline” signal.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@agners
agners merged commit 7c1099f into dev Jul 18, 2026
2 checks passed
@agners
agners deleted the fix/offline-test-fancy-ping branch July 18, 2026 17:37
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 26, 2026
@agners agners added the os label Jul 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants