run_bonnie of storage_test fails to check the status if there are two hard disks

Bug #1224820 reported by Taihsiang Ho on 2013-09-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox
Low
Unassigned

Bug Description

Hardware: CID 201210-11859 HP ENVY 6 Sleekbook (there are two hard disk and one of them is SSD)
Image: 12.04.3
checkbox version:0.16.8+bzr2362+201309110938~ubuntu12.04.1 0
http://paste.ubuntu.com/6100343/

Description:
If there are two hard disk, run_bonnie of storage_test will fail to test the secondary hard disk which is SSD

This is because run_bonnie() function tried to parse information by df command.
        free_space=$(df -m | grep -m 1 $1 | awk '{print $4}')
        http://bazaar.launchpad.net/~checkbox-dev/checkbox/trunk/view/head:/checkbox-old/scripts/storage_test

The secondary hard disk did be mounted before the "df" command was applied, so "df -h" did not give the free_space value.
This will raise the following statement to be syntax error
        disk_needed=$(($free_space/2))
        https://certification.canonical.com/hardware/201210-11859/submission/94016/test/363/result/6942026/

Step to reproduce the bug:
    1. get the latest checkbox by
        * apt-add-repository -y ppa:checkbox-dev
        * apt-get update
        * checkbox-certification-prepare
    2. launch checkbox by "run-checkbox.sh"
    3. check the test component:
        "Disk tests --> Verify that storage devices, such as Fibre Channel and... --> disk/storage_device_sdb"
    4. Start testing

Expected Result:
Checkbox will report the test result status.

Actual Result:
This test component failed because of syntax error:
    /usr/share/checkbox/scripts/storage_test: line 25: /2: syntax error: operand expected (error token is "/2")
    https://certification.canonical.com/hardware/201210-11859/submission/94016/test/363/result/6942026/

Fail Rate:
100%

Other Information:
1. No matter sdb with/without partitions, this bug could be reproduced.
2. If you give sdb a partition to be sdb1 and mount sdb1. This test component could be done.
https://certification.canonical.com/hardware/201210-11859/submission/94122/test/363/result/6948283/

Related branches

Taihsiang Ho (taihsiangho) wrote :

This bug could be reproduced on CID 201208-11455 (Dell Inspiron 5423) which has two hard disks.

Zygmunt Krynicki (zyga) wrote :

Could you please rerun this script with

set -x

Added somewhere near the top and add the log file here?

tags: added: scripts
Daniel Manrique (roadmr) on 2013-09-13
Changed in checkbox:
status: New → Fix Committed
Taihsiang Ho (taihsiangho) wrote :

set -x dumped

http://paste.ubuntu.com/6100920/

+ disk=/dev/sdb
+ '[' -b /dev/sdb ']'
+ echo '/dev/sdb is a block device'
++ parted -l -s
++ grep /dev/sdb
++ awk '{print $3}'
+ size=32.0GB
+ '[' -n 32.0GB ']'
+ echo '/dev/sdb reports a size of 32.0GB.'
+ size_range=GB + '[' GB == KB ']' + '[' GB == MB ']'
+ run_bonnie /dev/sdb + echo 'Running bonnie++ on /dev/sdb...'
++ df -h
++ awk '{print $6}'
++ grep -m 1 /dev/sdb
+ mount_point=
+ echo 'Putting scratch disk at '
+ mkdir -p /tmp/scratchdir
++ df -m
++ grep -m 1 /dev/sdb
++ awk '{print $4}'
+ free_space= + echo ' Disk /dev/sdb has MB available'
++ free -m ++ grep Mem ++ awk '{print $2}'
+ memory=5871
+ echo ' System has 5871MB RAM'
+ disk_needed=11742
+ echo ' We need 11742MB of disk space for testing'
+ [[ 11742 -ge '' ]]
+ echo ' Insufficient disk space available for defaults.'
+ echo ' reducing memory footprint to be 1/2 of free disk space.' /usr/share/checkbox/scripts/storage_test: line 27

Taihsiang Ho (taihsiangho) wrote :
Changed in checkbox:
status: Fix Committed → Fix Released
Changed in checkbox:
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers