Merge lp:~sylvain-pineau/checkbox/story597_removable_test_for_SD into lp:checkbox
Status: | Merged |
---|---|
Merged at revision: | 1631 |
Proposed branch: | lp:~sylvain-pineau/checkbox/story597_removable_test_for_SD |
Merge into: | lp:checkbox |
Diff against target: |
313 lines (+99/-26) 4 files modified
debian/changelog (+3/-0) jobs/mediacard.txt.in (+11/-0) scripts/removable_storage_test (+57/-21) scripts/removable_storage_watcher (+28/-5) |
To merge this branch: | bzr merge lp:~sylvain-pineau/checkbox/story597_removable_test_for_SD |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jeff Lane | Approve | ||
Review via email:
|
Description of the change
This MR tries to offer a way to properly identify memory cards plugged in the system under test.
Udisks correctly manages this type of devices but only shows detailed information if they are available on the sdio interface.
Memory cards plugged in a usb card reader are just seen as usb devices an we can't get the media type.
I've started to look into the ouput of the following commands, but the SCSI spec (2 or 3) doesn't provide enough information
to clearly identify such devices (My sd card is mounted as /dev/sdb):
sudo sg_scan -i (see http://
sudo sg_inq /dev/sdb (see http://
But we can see the reader model name in the sg_scan ouput and this data is also available
to udev and part of the ancestors path:
udevadm info -a -p /sys/block/sdb (see http://
Finally udisks can access the model name because it's part of the unique id name given to the device and can be retrieved with the DeviceFileById property (http://
udisks --show-info /dev/sdb (see http://
This is an extract of /dev/disk/by-id/
/dev/disk/
/dev/disk/
/dev/disk/
/dev/disk/
/dev/disk/
/dev/disk/
/dev/disk/
So the proposal is an attempt to guess the media type by looking into the parent model/name and using the following pattern: 'SD|MMC|
Both removable_
I've also left other manual test definition as they were for the moment, keeping this experimental guess for SRU.
Nice! Great enhancement! Here's the before and after testing I just did:
bladernr@ klaatu: ~/development/ sylvain- mmc-test- enhancement$ ./scripts/ removable_ storage_ test -l sdio usb scsi ------- ------ ------- ------ klaatu: ~/development/ sylvain- mmc-test- enhancement$ ./scripts/ removable_ storage_ test --memorycard -l sdio usb scsi ------- ------ ------- ------
-------
Removable devices currently mounted:
/dev/mmcblk0p1 : /media/8765-4321
/dev/sdb1 : /media/1AE8-8249
Removable devices currently not mounted:
None
-------
bladernr@
-------
Removable devices currently mounted:
/dev/mmcblk0p1 : /media/8765-4321
Removable devices currently not mounted:
None
-------
Note that sdb on my machine is a usb key... and it properly ignores the usb key!
Approve