Repository navigation
Name DragonFly USB devices by driver instance when devinfo has none - #3830
Conversation
DragonFly's hardware layer extends FreeBSD's and so reads USB devices with FreeBsdUsbDevice, which oshi#3826 moved to devinfo -v. FreeBSD's devinfo prints a <description> on each line; DragonFly's prints none: uhci0 pnpinfo vendor=0x8086 device=0x7020 ... at slot=1 function=2 usbus0 uhub0 so every DragonFly USB device had a blank name, failing UsbDeviceTest in the DragonFly job of Unix CI on master. Where there is no description, name the device by its driver instance (uhci0, uhub0), which devinfo always prints. The fixture is DragonFly 6.4.2's devinfo -v from CI. Unix CI dispatched on the fork for this branch passes on all six VMs, DragonFly included.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📜 Recent review details
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3830 +/- ##
============================================
- Coverage 81.08% 81.05% -0.04%
- Complexity 650 658 +8
============================================
Files 726 726
Lines 26279 26280 +1
Branches 4465 4466 +1
============================================
- Hits 21309 21301 -8
- Misses 2763 2770 +7
- Partials 2207 2209 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fixes a regression from #3826 that has failed the DragonFly job of Unix CI on master since that PR merged.
DragonFly's hardware layer extends FreeBSD's, so it reads USB devices through
FreeBsdUsbDevice, which #3826 moved todevinfo -v. FreeBSD'sdevinfoprints a<description>on every line, but DragonFly's prints none:So every DragonFly USB device got a blank name, which
UsbDeviceTest.testUsbDevices()rejects ("USB name shouldn't be blank"). #3826's fixtures were all FreeBSD output, so the unit tests didn't catch it.Change
When a line has no description, the device is named after its driver instance (
uhci0,uhub0), whichdevinfoalways prints. The javadoc now mentions DragonFly, and DragonFly 6.4.2's realdevinfo -voutput from CI is a new test fixture.Verification
testUsbDevices()passes.-Paggregate-coveragegate and the Error Prone build pass.No CHANGELOG entry, since #3826 hasn't been released yet.
Separate, not fixed here
The first failing master run, for #3826, failed differently. The DragonFly VM stopped responding partway through the oshi-core tests, rather than failing a test.
devinfo -vruns in 0.01 s there, so it isn't the cause. The two later runs failed only on the test above. I'll watch for the hang recurring.Summary by CodeRabbit