Debug FBOSS AgentHwTest failures - build, run, analyze logs, crash debug, vendor diag shell, hypothesis-driven debugging. Use when running sai_agent_hw_test or multi_switch_agent_hw_test and investigating test failures.
Copy the install command and let the AI configure it · recommended for beginners
Please install the "debug-agent-hw-test" skill from askskill: 1. Download https://raw.githubusercontent.com/facebook/fboss/main/fboss/skills/debug-agent-hw-test/SKILL.md 2. Save it as ~/.claude/skills/debug-agent-hw-test/SKILL.md 3. Reload skills and tell me it's ready
End-to-end workflow for building, running, and debugging FBOSS AgentHwTest failures on switches. Drives iterative test-debug-fix cycles.
This skill requires access to a lab switch to deploy and run tests. Read the device access reference (see Reference Routing below) to learn the available commands for your environment (upload, download, run commands on switch).
The skill supports two modes:
| Mode | Input | Behavior |
|---|---|---|
| Mode A — Single test | A test name (e.g. AgentVoqSwitchTest.addRemoveNeighbor) | Run one test, debug if it fails (today's behavior) |
| Mode B — Batch test list | A file path (e.g. /tmp/test_list.txt) | Read test names from file, run each sequentially |
Mode selection: If the user provides a single test name, run Mode A. If the user provides a file path, read the file and run Mode B.
One test name per line. Lines starting with # are comments, blank lines are ignored.
# /tmp/test_list.txt
AgentVoqSwitchTest.addRemoveNeighbor
AgentAclCounterTest.AclStatTest
Gather these before starting:
| Input | Example | Required? |
|---|---|---|
| Test name | AgentVoqSwitchTest.addRemoveNeighbor | Yes (Mode A) |
| Test list file | /tmp/test_list.txt | Yes (Mode B) |
| Mode | mono or multi | Yes |
| SDK version | 12.2 DNX | Yes |
| Switch name | fboss325966941.ash6 | Yes |
| Config file path | /root/<user>/<platform>.agent.materialized_JSON (mono) or /root/<user>/<platform>_multi.agent.materialized_JSON (multi) | Yes — see build-and-load.md for how to obtain |
| HW agent binary path | /root/<user>/fboss_hw_agent-brcm-12.2.0.0_dnx_odp | No — derived from SDK version |
| Switch IDs | 0 2 | No — extract from config's switchIdToSwitchInfo (see below) |
Switch IDs are platform-specific. Extract them from the materialized config file:
python3 -c "
import json, sys
with open(sys.argv[1]) as f:
cfg = json.load(f)
for sid, info in cfg['sw']['switchSettings']['switchIdToSwitchInfo'].items():
print(f'switchId={sid} switchIndex={info[\"switchIndex\"]}')
" /root/<user>/<platform>_multi.agent.materialized_JSON
Known platform switch IDs:
| Platform | Switch IDs | Switch Indices |
|---|---|---|
| meru800bfa | 0, 2 | 0, 1 |
| janga800bic | 0, 4 | 0, 1 |
The --switch_id_for_testing flag takes the switch ID (not the switch index).
MANDATORY: Always build binaries on every skill invocation before running any test. Never skip the build step, even if binaries already exist on the switch from a previous session or invocation. Stale binaries produce incorrect results because the source code may have changed.
On every skill invocation:
strip_and_copy.sh uses md5 dedup — unchanged binaries skip the network copy automatically)The md5 dedup in strip_and_copy.sh makes this safe and fast — if the binary hasn't changed, the copy is skipped. But the build must always run to ensure the binary reflects the current source.
Follow this iterative cycle for each failing test:
…
Checks FBOSS code for standards, architecture misuse, and testing gaps.
Review FBOSS diffs with parallel checks for architecture, reliability, and testing.
Write and run Markdown-driven end-to-end tests for Relay apps.
Get idiomatic Relay guidance for React code, debugging, and code reviews.
Apply the right commit prefix, reviewer, and test plan for code changes.
Debug Pysa false negatives by comparing outputs and locating lost taint flows.