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

Issue 3349001: hardware_DiskSize,SsdDetection: fix hardware root dev discovery (Closed)

Created:
10 years, 3 months ago by Will Drewry
Modified:
9 years, 7 months ago
Reviewers:
bfreed
CC:
chromium-os-reviews_chromium.org, sosa+cc_chromium.org, seano, ericli, petkov+cc_chromium.org
Visibility:
Public.

Description

hardware_DiskSize,SsdDetection: fix hardware root dev discovery When root filesystem verification is enabled, the root device discoverable by walking the kernel command line does not match the physical drive the root partition is on. Just recently, we added support for rootdev to resolve through the device-mapper device (/dev/dm-0) to find the true root device. These two tests now use rootdev with this functionality. TEST=ran these on a vboot'd dogfood device (well waiting for a full fresh build, then I will :) BUG=chromium-os:890, chromium-os:892 Change-Id: Ieda92c297d4b8ec2b93f5bf8a3f0a61e1cedd33a

Patch Set 1 #

Total comments: 3

Patch Set 2 : use basename #

Patch Set 3 : ditch re, import os #

Patch Set 4 : don't drop re #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -17 lines) Patch
M client/site_tests/hardware_DiskSize/hardware_DiskSize.py View 1 2 3 2 chunks +3 lines, -5 lines 0 comments Download
M client/site_tests/hardware_SsdDetection/hardware_SsdDetection.py View 2 chunks +6 lines, -12 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Will Drewry
10 years, 3 months ago (2010-09-01 17:50:48 UTC) #1
bfreed
http://codereview.chromium.org/3349001/diff/1/2 File client/site_tests/hardware_DiskSize/hardware_DiskSize.py (right): http://codereview.chromium.org/3349001/diff/1/2#newcode16 client/site_tests/hardware_DiskSize/hardware_DiskSize.py:16: match = re.search(r'/dev/([^ ]+)', devnode) Hmm... All our other ...
10 years, 3 months ago (2010-09-01 18:13:09 UTC) #2
Will Drewry
A few responses - do they make sense? http://codereview.chromium.org/3349001/diff/1/2 File client/site_tests/hardware_DiskSize/hardware_DiskSize.py (right): http://codereview.chromium.org/3349001/diff/1/2#newcode16 client/site_tests/hardware_DiskSize/hardware_DiskSize.py:16: match ...
10 years, 3 months ago (2010-09-01 18:20:29 UTC) #3
bfreed
http://codereview.chromium.org/3349001/diff/1/2 File client/site_tests/hardware_DiskSize/hardware_DiskSize.py (right): http://codereview.chromium.org/3349001/diff/1/2#newcode16 client/site_tests/hardware_DiskSize/hardware_DiskSize.py:16: match = re.search(r'/dev/([^ ]+)', devnode) On 2010/09/01 18:20:29, Will ...
10 years, 3 months ago (2010-09-01 18:41:08 UTC) #4
Will Drewry
10 years, 3 months ago (2010-09-01 20:35:16 UTC) #5
On Wed, Sep 1, 2010 at 1:41 PM,  <bfreed@chromium.org> wrote:
>
> http://codereview.chromium.org/3349001/diff/1/2
> File client/site_tests/hardware_DiskSize/hardware_DiskSize.py (right):
>
> http://codereview.chromium.org/3349001/diff/1/2#newcode16
> client/site_tests/hardware_DiskSize/hardware_DiskSize.py:16: match =
> re.search(r'/dev/([^ ]+)', devnode)
> On 2010/09/01 18:20:29, Will Drewry wrote:
>>
>> On 2010/09/01 18:13:09, bfreed wrote:
>> > Hmm...
>> >
>> > All our other rootdev-using tests pretty much assume something
>
> useful will be
>>
>> > returned here.  This this re search really necessary?
>
>> The re search extracts just the block device sda and not /dev/sda.
>
> I see.  In that case, os.path.basename(devnode) should be used.

Certainly! Done and pushing.

>
>> > Is -i useful?
>
>> It will ignore error if the device node doesn't exist.  However, the
>
> entry will
>>
>> exist in /proc/partitions even if there's no dev node.  rootdev will
>
> not return
>>
>> 0 with -i if it doesn't find a matching device in sys.
>
> Ok.
>
>> > I would think that if rootdev reports failure, we might want the
>
> test to fail
>>
>> > immediately.
>
>> Agreed.
>
> Other than changing the search to basename, LGTM.
>
> http://codereview.chromium.org/3349001/show
>

Powered by Google App Engine
This is Rietveld 408576698