Fix: USB SD card reader support (Bugfix)#2254
Fix: USB SD card reader support (Bugfix)#2254chochien wants to merge 1 commit intocanonical:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2254 +/- ##
==========================================
+ Coverage 53.81% 54.65% +0.84%
==========================================
Files 406 410 +4
Lines 43288 43992 +704
Branches 7997 8100 +103
==========================================
+ Hits 23296 24046 +750
+ Misses 19179 19120 -59
- Partials 813 826 +13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1407e27 to
d6463da
Compare
eb19539 to
e26b49d
Compare
The mediacard_combo storage watcher was unable to detect SD card readers that appear as SCSI/USB mass storage devices (/dev/sda) instead of mmcblk devices. This caused insertion tests to timeout. This patch enhances MediacardComboStorage._parse_journal_line() to: - Detect insertions via 'detected capacity change from 0 to X' messages - Detect removals via 'detected capacity change from X to 0' messages - Label these devices as 'SD/MMC via USB reader' The fix allows the action state to be updated dynamically, properly handling multiple insert/remove cycles even when a card is already inserted at test start. Partition extraction is handled by the existing USBStorage parent class logic. Comprehensive unit tests have been added to cover all new code paths: - test_mediacard_combo_storage_usb_sd_card_reader_insertion - test_mediacard_combo_storage_usb_sd_card_reader_removal - test_mediacard_combo_storage_usb_sd_card_reader_partition - test_mediacard_combo_storage_usb_sd_card_reader_action_update Tested with USB SD card readers that enumerate as /dev/sda devices.
e26b49d to
2635eba
Compare
|
Hello, please attach at least one passing test submission. The code lgtm, but I want to see it working |
|
submission_2026-01-20T06.14.29.607611.html @Hook25 Uploading the pass submission for your reference. |
Hook25
left a comment
There was a problem hiding this comment.
+1, LGTM, thanks for the sub
Hook25
left a comment
There was a problem hiding this comment.
sorry, didnt pay attention, are you sure?
| # This is a removal - always update to reflect current action | ||
| self.action = "removal" | ||
|
|
||
| return super()._parse_journal_line(line_str) |
There was a problem hiding this comment.
I've just noticed this, are you sure you need it? It is done above (explicitly, this only calls USBStorage._parse_journal_line)
989b7eb to
2635eba
Compare
Description
The mediacard_combo storage watcher was unable to detect SD card readers that appear as SCSI/USB mass storage devices (/dev/sda) instead of mmcblk devices. This caused insertion tests to timeout.
This patch enhances MediacardComboStorage._parse_journal_line() to:
The fix allows the action state to be updated dynamically, properly handling multiple insert/remove cycles even when a card is already inserted at test start.
Tested with USB SD card readers that enumerate as /dev/sda devices.
Resolved issues
Fixes: https://warthogs.atlassian.net/browse/CPL-258
Documentation
N/A
Tests
sudo ./run_watcher.py insertion mediacard_comboWait for the "INSERT NOW" prompt, then insert the card.