-
Notifications
You must be signed in to change notification settings - Fork 225
Description
While adding a new resource to a Labgrid exporter, I ran into some non-obvious behavior that seems undocumented and potentially unexpected.
When using udev matching for USB resources, the ID_VENDOR_ID and ID_MODEL_ID fields are treated as case-sensitive strings. This means uppercase hex digits do not match lowercase ones.
Failing Configurations
"example-resource-group":
USBFlashableDevice:
match:
SUBSYSTEM: "usb"
ID_VENDOR_ID: "091e"
ID_MODEL_ID: "FFFF""example-resource-group":
USBFlashableDevice:
match:
SUBSYSTEM: "usb"
ID_VENDOR_ID: 0x091e
ID_MODEL_ID: 0xFFFFActual Behavior
-
The exporter does not match any connected USB device with vendor ID
091eand model IDffff. -
There is no error or warning explaining why the match failed.
Expected Behavior
Either:
-
Matching should be case-insensitive (
ffff==FFFF), which aligns with how USB vendor/product ID numbers are typically represented, or -
The exporter should emit a clear error/warning when uppercase hex digits are used.
Working Configuration
"example-resource-group":
USBFlashableDevice:
match:
SUBSYSTEM: "usb"
ID_VENDOR_ID: "091e"
ID_MODEL_ID: "ffff"With this configuration, the exporter successfully identifies the USB device and exports a USBFlashableDevice resource.
Additional Notes
I was not able to find any documentation highlighting that these fields are case sensitive. According to the USB standard, these values are numbers, so case should not matter.
Environment
- Labgrid version: v24.0a1
- OS: Ubuntu 22.04