Merge ~sylvain-pineau/plainbox-provider-checkbox:fix-1811645 into plainbox-provider-checkbox:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: a195e859b7641f5ca2f220d270975127f448850d
Merged at revision: b0d1e33fb407dfa299574396c868dce33c639ff4
Proposed branch: ~sylvain-pineau/plainbox-provider-checkbox:fix-1811645
Merge into: plainbox-provider-checkbox:master
Diff against target: 22 lines (+5/-6)
1 file modified
bin/removable_storage_test (+5/-6)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+367959@code.launchpad.net

Description of the change

Fixes the removable storage test by adopting the same logic found in removable storage watcher. Only use the memorycard heuristics if this was explicitly requested by --memorycard.

Doing the vice-versa approach was leading to the linked bug where a thunderbolt3 external hard drive matches the CARD_READER_RE checkbox-support regexp:

"nvme-HP_Portable_SSD_P800_256GB_HBSD28232000029" is found by re.compile(r"SD|MMC|CF|MS(?!ata)|SM|xD|Card", re.I)

SSD vs SD!

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Tested successfully on somerville-berlinetta-p-mlk-cfl-201807-26342 (thanks Gavin)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/removable_storage_test b/bin/removable_storage_test
2index a7abdfe..249911a 100755
3--- a/bin/removable_storage_test
4+++ b/bin/removable_storage_test
5@@ -391,12 +391,11 @@ class DiskTest():
6 interconnect_speed * 10 ** 6)
7 else:
8 self.rem_disks_speed[dev_file] = None
9- # We need to skip-non memory cards if we look for memory cards and
10- # vice-versa so let's inspect the drive and use heuristics to
11- # detect memory cards (a memory card reader actually) now.
12- if self.memorycard != is_memory_card(drive_props['Vendor'],
13- drive_props['Model'],
14- drive_props['Media']):
15+ # Ensure it is a media card reader if this was explicitly requested
16+ drive_is_reader = is_memory_card(
17+ drive_props['Vendor'], drive_props['Model'],
18+ drive_props['Media'])
19+ if self.memorycard and not drive_is_reader:
20 continue
21 # The if/else test below simply distributes the mount_point to the
22 # appropriate variable, to keep the API requirements. It is

Subscribers

People subscribed via source and target branches