remote/client: support OpenOCD bootstrap without environment#1864
remote/client: support OpenOCD bootstrap without environment#1864ozan956 wants to merge 2 commits into
Conversation
4800392 to
91725b3
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1864 +/- ##
========================================
+ Coverage 46.0% 46.2% +0.2%
========================================
Files 180 180
Lines 14462 14475 +13
========================================
+ Hits 6654 6695 +41
+ Misses 7808 7780 -28
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
Do we need a complete yaml definition and loader for the bootstrap arguments? Can't we instead supply an openocd native target configuration instead or limit this to a list of key-value items? |
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>
91725b3 to
83839d1
Compare
Add unit tests for OpenOCD bootstrap argument parsing and the NetworkUSBDebugger fallback path in the client. Keep these tests separate from the OpenOCD integration tests so they do not depend on the openocd binary being installed. Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
83839d1 to
8026458
Compare
Thanks @Emantor, As you see I am trying to solve two problems. First, extending the bootstrap fallback path so labgrid-client bootstrap can also instantiate OpenOCDDriver for NetworkUSBDebugger when no local environment is available. Second, making it possible to pass the structured OpenOCD driver arguments needed by that CLI-only path. Regarding your suggestion, I can say that this can work for some cases, but I do not think its the best option to have a config wrapper like that. The main reason is that the arguments here are not only static target configuration. They also describe the bootstrap workflow itself, for example custom I do agree that the generic YAML parsing may be overkill. The important part for me is the ability to pass the OpenOCD-specific structured arguments needed by this bootstrap flow, not to introduce a fully generic typed argument mechanism for bootstrap in general. So, I think we can maybe restrict this path to a small whitelist of OpenOCD-specific keys such as config, search, load_commands, interface_config, etc. |
The bootstrap fallback path was too narrow for OpenOCD-based setups without a
local environment.
Previously,
labgrid-client bootstraponly auto-createdOpenOCDDriverforNetworkAlteraUSBBlaster. If a place exposed onlyNetworkUSBDebugger, theclient still failed with
target has no compatible resource availableeventhough
OpenOCDDrivercan bind to that resource type.The existing
bootstrap_argspath was also too limited. It only handled rawkey=valuestrings, which was not sufficient forOpenOCDDriverargumentssuch as
load_commands,search, orconfig, where structured values likelists are often required.
This change:
NetworkUSBDebuggerThis 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