diff options
| author | Jeff Lane <jeffrey.lane@canonical.com> | 2014-11-24 20:07:22 +0000 |
|---|---|---|
| committer | Daniel Manrique <> | 2014-11-24 20:07:22 +0000 |
| commit | 0ad0330d95c3615d6ce314218e0a863a6051e242 (patch) | |
| tree | e5ab34f457add78d6b0b2258b959d0d4613238a5 | |
| parent | 6a76c8c166399fd2ba814e01e109a33d588fb05a (diff) | |
| parent | 27cb4006934228ca4a752f3ebb686ace7d28383c (diff) | |
"automatic merge of lp:~bladernr/checkbox/1385821/ by tarmac [r=roadmr][bug=1395821][author=bladernr]"
| -rwxr-xr-x | bin/storage_test | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/bin/storage_test b/bin/storage_test index 54e604fe..306f47c6 100755 --- a/bin/storage_test +++ b/bin/storage_test @@ -35,7 +35,21 @@ disk=/dev/$1 if [ -b $disk ] then echo "$disk is a block device" - size=`parted -l -s | grep $disk | awk '{print $3}'` + + #Add a check for warnings + WARN=$(parted -l -s |grep "^Warning.*${disk}.*[Rr]ead-only" 2>&1) + if $? + then + echo "Warning found in parted output:" + echo $WARN + echo "Aborting Test" + exit 1 + fi + + # Regex changed to better handle when $disk appears more than once + # in parted output (such as in warning messages or not caught in the + # check above) + size=`parted -l -s |grep "Disk.*${disk}" |awk '{print $3}'` if [ -n "$size" ] then @@ -54,7 +68,7 @@ then if [ $size_range == "KB" ] then - echo "$disk is too small to be functioning." + echo "$disk size reported in KB, seems to be too small for testing." exit 1 elif [ $size_range == "MB" ] then @@ -64,7 +78,7 @@ then then run_bonnie $disk else - echo "$disk is too small to be functioning." + echo "$disk is too small to be used for testing." exit 1 fi else |
