Merge ~kevinyeh/checkbox-support:fix-sd-performance-manual into checkbox-support:master

Proposed by Kevin Yeh
Status: Merged
Approved by: Kevin Yeh
Approved revision: 8fc9fab60a095a1bd0562e256b21b9e4f2f3a8de
Merged at revision: fa403031999500cdec33dba8ba4e8f6d613e810d
Proposed branch: ~kevinyeh/checkbox-support:fix-sd-performance-manual
Merge into: checkbox-support:master
Diff against target: 25 lines (+5/-2)
1 file modified
checkbox_support/scripts/run_watcher.py (+5/-2)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+399835@code.launchpad.net

Description of the change

scripts/run_watcher.py

fix can't mount mediacard(mmc, sd, sdhc, etc.) correctly on UC while running *-performance-manual test

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

Thanks, make sense to adopt this fix.

For the record, a similar fix was proposed here for mediacard tests on UC:

https://code.launchpad.net/~checkbox-dev/checkbox-support/+git/checkbox-support/+merge/395890

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/checkbox_support/scripts/run_watcher.py b/checkbox_support/scripts/run_watcher.py
2index 7a33b85..36e3d2b 100644
3--- a/checkbox_support/scripts/run_watcher.py
4+++ b/checkbox_support/scripts/run_watcher.py
5@@ -53,7 +53,7 @@ class USBWatcher:
6 signal.alarm(self.USB_ACTION_TIMEOUT)
7 if self.args.usb_type == "mediacard":
8 # Match something like "mmcblk0: p1".
9- self.PART_RE = re.compile("mmcblk\d+: (?P<part_name>p\d+)")
10+ self.PART_RE = re.compile("mmcblk(?P<dev_num>\d)+: (?P<part_name>p\d+)")
11
12 def run(self):
13 j = journal.Reader()
14@@ -81,7 +81,10 @@ class USBWatcher:
15 # looking for string like "sdb: sdb1"
16 match = re.search(self.PART_RE, line_str)
17 if match:
18- self.MOUNTED_PARTITION = match.group('part_name')
19+ if self.args.usb_type == "mediacard":
20+ self.MOUNTED_PARTITION = 'mmcblk'+match.group('dev_num')+match.group('part_name')
21+ else:
22+ self.MOUNTED_PARTITION = match.group('part_name')
23
24 def _refresh_detection(self, line_str):
25 """

Subscribers

People subscribed via source and target branches