canonical / checkbox

Checkbox is a testing framework used to validate device compatibility with Ubuntu Linux. It’s the testing tool developed for the purposes of the Ubuntu Certification program.
https://checkbox.readthedocs.io
GNU General Public License v3.0
33 stars 50 forks source link

disk/read_performance_{name} fails to run claiming device too small #1321

Open jocave opened 4 months ago

jocave commented 4 months ago

Bug Description

Using the submission as an example, the disk performance jobs will be run on devices which are not suitable for the job (based on the resource job identification as a DISK).

To Reproduce

Run the com.canonical.qa.limerick::kv260-limerick-automated-classic-20-04 test plan on the environment identified in the submission above

Environment

The submission above has an environment of: checkbox-limerick-classic (0.2.dev-focal) and checkbox20 (4.0.0-dev333) snaps

Relevant log output

CategoryDisk testsIO LogBeginning /tmp/nest-i7lhdmqq.d4c49ecd2d384a2b05434d00d068fffd23c1f2f848f6aea1d9db30f80f75f7e6/disk_read_performance_test.sh test for mtdblock14
---------------------------------------------------
INFO: mtdblock14 type is mtd
INFO: mtd: Using 1 MB/sec as the minimum throughput speed

Beginning hdparm timing runs
---------------------------------------------------
INFO: Iteration 1: Detected speed is MB/sec
WARNING: Device mtdblock14 is too small! Aborting test.

Additional context

No response

syncronize-issues-to-jira[bot] commented 4 months ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CHECKBOX-1477.

This message was autogenerated

p-gentili commented 4 months ago

Also found in 1 and 2, running checkbox22 (4.0.0-dev333-1010) and checkbox-iiotg (0.1dev-jammy-69).

jocave commented 3 months ago

I have modified the title of this because I believe there are multiple places where this test fails and I'm not convinced all of them are actually due to the partition being too small and they happen on devices other than MTD devies:

mmc device: https://certification.canonical.com/hardware/202109-29492/submission/387739/test/63709/result/43374704/

sda device: https://certification.canonical.com/hardware/202110-29509/submission/387737/test/147/result/43374284/

boukeas commented 2 months ago

Another failure: https://certification.canonical.com/hardware/202201-29844/submission/392344/test/60689/result/44114883/

omar-selo commented 2 months ago

Another one https://certification.canonical.com/hardware/202109-29492/submission/393857/test/63709/result/44353636/

fernando79513 commented 1 month ago

This issue should be solved by: https://github.com/canonical/checkbox/pull/1451

fernando79513 commented 2 weeks ago

This device had a similar issue. When running the test manually, it could be run and the speed was correct. The issue seems to be that the hdparm binary is not detected properly

fernando79513 commented 1 week ago

The test also failed on these two devices:

pieqq commented 1 week ago

I'm reviewing test results from the two devices mentioned by @fernando79513 and seeing the same output:

Beginning /tmp/nest-qqavnzf1.deaa0ef222daffdf557efc3196a9694a54cd4a98493720151e313d6d4b520ea9/disk_read_performance_test.sh test for mmcblk0
---------------------------------------------------
INFO: mmcblk0 type is mmc
INFO: mmc: Using 15 MB/sec as the minimum throughput speed

Beginning hdparm timing runs
---------------------------------------------------
INFO: Iteration 1: Detected speed is  MB/sec
WARNING: Device mmcblk0 is too small! Aborting test.

(from https://certification.canonical.com/hardware/202109-29492/submission/401516/ )

These tests used to pass at the beginning of the year:

Beginning /tmp/nest-_g0y3q_9.b10595a0e8e884d8eb640ce24b9bb0aca77605b651533fef7c1b80c22bcbc05d/disk_read_performance_test.sh test for mmcblk0
---------------------------------------------------
INFO: mmcblk0 type is mmc
INFO: mmc: Using 15 MB/sec as the minimum throughput speed

Beginning hdparm timing runs
---------------------------------------------------
INFO: Iteration 1: Detected speed is 307.21 MB/sec
INFO: Iteration 2: Detected speed is 309.64 MB/sec
INFO: Iteration 3: Detected speed is 310.38 MB/sec
INFO: Iteration 4: Detected speed is 310.64 MB/sec
INFO: Iteration 5: Detected speed is 310.98 MB/sec
INFO: Iteration 6: Detected speed is 311.00 MB/sec
INFO: Iteration 7: Detected speed is 311.32 MB/sec
INFO: Iteration 8: Detected speed is 311.46 MB/sec
INFO: Iteration 9: Detected speed is 311.14 MB/sec
INFO: Iteration 10: Detected speed is 296.18 MB/sec
INFO: Maximum detected speed is 311 MB/sec
---------------------------------------------------

PASS: mmcblk0 Max Speed of 311 MB/sec is faster than Minimum Buffer Read Speed of 15 MB/sec
All devices passed testing!

(from https://certification.canonical.com/hardware/202109-29492/submission/353554/ run in January 2024)

The script uses this hdparm command:

hdparm -t /dev/"$disk" 2>/dev/null | grep "Timing buffered disk reads" | awk -F"=" '{print $2}' | awk '{print $1}'

I've manually connected to one of the afflicted devices, entered the Checkbox snap, and ran it. It doesn't return anything:

$ sudo checkbox-iiotg.shell
checkbox-iiotg runtime shell, type 'exit' to quit the session

root@ubuntu:/home/ubuntu# hdparm -t /dev/sda >/dev/null | grep "Timing buffered disk reads" | awk -F"=" '{print $2}' | awk '{print $1}'

But just running the hdparm command without awk:

root@ubuntu:/home/ubuntu# hdparm -t /dev/sda

/dev/sda:
 Timing buffered disk reads: 940 MB in  3.00 seconds = 313.18 MB/sec

I've also simply trying on my desktop (running 24.04) and the line in the script does not return anything either:

$ sudo hdparm -t /dev/nvme1n1 >/dev/null | grep "Timing buffered disk reads" | awk -F"=" '{print $2}' | awk '{print $1}'

But the hdparm command alone does:

$ sudo hdparm -t /dev/nvme1n1
/dev/nvme1n1:
 Timing buffered disk reads: 4388 MB in  3.00 seconds = 1461.45 MB/sec
fernando79513 commented 2 days ago

We should move this bash script to python and add some unit tests to it