storage_test fails when parted dumps a warning

Bug #1395821 reported by Jeff Lane 
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox Provider - Base
Fix Released
Critical
Jeff Lane 

Bug Description

Found this on a test system. Parted dumped a warning message that included the device name in the message, this caused the grep in storage test (that greps for $DISK in the parted output) to grab the wrong thing.

Here's the actual test output:

Warning: Unable to open /dev/sda read-write (Read-only file system). /dev/sda has been opened read-only.
Model: VIRTUAL-DISK (scsi)
Disk /dev/sda: 1476MB
Sector size (logical/physical): 512B/4096B
Partition Table: loop

Number Start End Size File system Flags
 1 0.00B 1476MB 1476MB ext4

Ignore the read-only bit, that's secondary to this bug and will also be fixed. The important thing is that because /dev/sda appears in the warning, the grep grabs that and then the awk grabs the word "to" and thus creates a $SIZE variable that looks like this:

"to 1476MB"

To fix this:
Change the regex
add some error handling

Related branches

Zygmunt Krynicki (zyga)
Changed in plainbox-provider-checkbox:
status: In Progress → Fix Committed
milestone: none → 0.16
Changed in plainbox-provider-checkbox:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.