Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: client/site_tests/hardware_DiskSize/hardware_DiskSize.py

Issue 3349001: hardware_DiskSize,SsdDetection: fix hardware root dev discovery (Closed) Base URL: http://git.chromium.org/git/autotest.git
Patch Set: don't drop re Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | client/site_tests/hardware_SsdDetection/hardware_SsdDetection.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/site_tests/hardware_DiskSize/hardware_DiskSize.py
diff --git a/client/site_tests/hardware_DiskSize/hardware_DiskSize.py b/client/site_tests/hardware_DiskSize/hardware_DiskSize.py
index 1422082a98f3c1157781ce68e8e12c66d2d195f6..e7363d5631971a94d7b9ed831d3c1a6fd10148c4 100644
--- a/client/site_tests/hardware_DiskSize/hardware_DiskSize.py
+++ b/client/site_tests/hardware_DiskSize/hardware_DiskSize.py
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import logging
+import os
import re
from autotest_lib.client.bin import test, utils
@@ -12,11 +13,8 @@ class hardware_DiskSize(test.test):
version = 1
def run_once(self):
- cmdline = file('/proc/cmdline').read()
- match = re.search(r'root=/dev/([^ ]+)', cmdline)
- if not match:
- raise error.TestError('Unable to find the root partition')
- device = match.group(1)[:-1]
+ devnode = utils.system_output('rootdev -s -d -i')
+ device = os.path.basename(devnode)
for line in file('/proc/partitions'):
try:
« no previous file with comments | « no previous file | client/site_tests/hardware_SsdDetection/hardware_SsdDetection.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698