storage_test fails when parted dumps a warning
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
- Daniel Manrique (community): Approve
- Jeff Lane : Needs Resubmitting
-
Diff: 44 lines (+17/-3)1 file modifiedproviders/plainbox-provider-checkbox/bin/storage_test (+17/-3)
Changed in plainbox-provider-checkbox: | |
status: | In Progress → Fix Committed |
milestone: | none → 0.16 |
Changed in plainbox-provider-checkbox: | |
status: | Fix Committed → Fix Released |