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
diff --git a/checkbox_support/scripts/run_watcher.py b/checkbox_support/scripts/run_watcher.py
index 7a33b85..36e3d2b 100644
--- a/checkbox_support/scripts/run_watcher.py
+++ b/checkbox_support/scripts/run_watcher.py
@@ -53,7 +53,7 @@ class USBWatcher:
53 signal.alarm(self.USB_ACTION_TIMEOUT)53 signal.alarm(self.USB_ACTION_TIMEOUT)
54 if self.args.usb_type == "mediacard":54 if self.args.usb_type == "mediacard":
55 # Match something like "mmcblk0: p1".55 # Match something like "mmcblk0: p1".
56 self.PART_RE = re.compile("mmcblk\d+: (?P<part_name>p\d+)")56 self.PART_RE = re.compile("mmcblk(?P<dev_num>\d)+: (?P<part_name>p\d+)")
5757
58 def run(self):58 def run(self):
59 j = journal.Reader()59 j = journal.Reader()
@@ -81,7 +81,10 @@ class USBWatcher:
81 # looking for string like "sdb: sdb1"81 # looking for string like "sdb: sdb1"
82 match = re.search(self.PART_RE, line_str)82 match = re.search(self.PART_RE, line_str)
83 if match:83 if match:
84 self.MOUNTED_PARTITION = match.group('part_name')84 if self.args.usb_type == "mediacard":
85 self.MOUNTED_PARTITION = 'mmcblk'+match.group('dev_num')+match.group('part_name')
86 else:
87 self.MOUNTED_PARTITION = match.group('part_name')
8588
86 def _refresh_detection(self, line_str):89 def _refresh_detection(self, line_str):
87 """90 """

Subscribers

People subscribed via source and target branches