Skip to content

remote/client: support OpenOCD bootstrap without environment#1864

Open
ozan956 wants to merge 1 commit intolabgrid-project:masterfrom
ozan956:fix/remote-client-openocd-bootstrap
Open

remote/client: support OpenOCD bootstrap without environment#1864
ozan956 wants to merge 1 commit intolabgrid-project:masterfrom
ozan956:fix/remote-client-openocd-bootstrap

Conversation

@ozan956
Copy link
Copy Markdown

@ozan956 ozan956 commented May 7, 2026

The bootstrap fallback path was too narrow for OpenOCD-based setups without a
local environment.

Previously, labgrid-client bootstrap only auto-created OpenOCDDriver for
NetworkAlteraUSBBlaster. If a place exposed only NetworkUSBDebugger, the
client still failed with target has no compatible resource available even
though OpenOCDDriver can bind to that resource type.

The existing bootstrap_args path was also too limited. It only handled raw
key=value strings, which was not sufficient for OpenOCDDriver arguments
such as load_commands, search, or config, where structured values like
lists are often required.

This change:

  • extends the bootstrap fallback to NetworkUSBDebugger
  • parses bootstrap driver arguments as YAML values
  • allows structured OpenOCD driver arguments to be passed directly from the CLI

This makes CLI-only OpenOCD bootstrap flows usable in more cases without
requiring a local environment file.

I verified the change with focused regression tests:

pytest -q tests/test_client.py -k 'bootstrap_network_usb_debugger or bootstrap_openocd_args'

Checklist

  • Tests for the feature
  • PR has been tested

The bootstrap fallback path was too narrow for OpenOCD-based setups
without a local environment.

So far, `labgrid-client bootstrap` only auto-created `OpenOCDDriver`
for `NetworkAlteraUSBBlaster`. If a place exposed only
`NetworkUSBDebugger`, the client failed with "target has no compatible
resource available" even though `OpenOCDDriver` can bind to that
resource type.

In addition, the existing `bootstrap_args` path only handled raw
`key=value` strings. This was not sufficient for `OpenOCDDriver`
arguments such as `load_commands`, `search`, or `config`, which often
need structured values like lists.

Extend the bootstrap fallback to `NetworkUSBDebugger` and parse
bootstrap driver arguments as YAML values. This allows CLI-only OpenOCD
bootstrap flows to pass structured driver arguments without requiring a
local environment file.

Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
@ozan956 ozan956 force-pushed the fix/remote-client-openocd-bootstrap branch from 4800392 to 91725b3 Compare May 7, 2026 11:14
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

❌ Patch coverage is 13.33333% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.7%. Comparing base (ec5ec29) to head (91725b3).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
labgrid/remote/client.py 13.3% 13 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1864     +/-   ##
========================================
- Coverage    45.8%   45.7%   -0.1%     
========================================
  Files         182     182             
  Lines       14720   14733     +13     
========================================
+ Hits         6743    6745      +2     
- Misses       7977    7988     +11     
Flag Coverage Δ
3.10 45.7% <13.3%> (-0.1%) ⬇️
3.11 45.7% <13.3%> (-0.1%) ⬇️
3.12 45.7% <13.3%> (-0.1%) ⬇️
3.13 45.7% <13.3%> (-0.1%) ⬇️
3.14 45.7% <13.3%> (-0.1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

1 participant