Merge ~bladernr/plainbox-provider-checkbox:1667488-don into plainbox-provider-checkbox:master

Proposed by Jeff Lane 
Status: Merged
Approved by: Pierre Equoy
Approved revision: 68aaa79e797742ca87fb27ab844c16b107c24e94
Merged at revision: dd00595cfafe76b4719bcdc79c509c40e854f3a7
Proposed branch: ~bladernr/plainbox-provider-checkbox:1667488-don
Merge into: plainbox-provider-checkbox:master
Diff against target: 21 lines (+7/-1)
1 file modified
bin/disk_stress_ng (+7/-1)
Reviewer Review Type Date Requested Status
Pierre Equoy Approve
Review via email: mp+318160@code.launchpad.net

Description of the change

Modifies disk_stress_ng to exit and spit out some warnings if a disk is too small (really if the largest usable partition on that disk is too small).

This fixes a problem where tests are run on disks too small and fail because they run out of space.

To post a comment you must log in.
Revision history for this message
Pierre Equoy (pieq) wrote :

Looks good to me!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/disk_stress_ng b/bin/disk_stress_ng
2index a47ab79..de96f46 100755
3--- a/bin/disk_stress_ng
4+++ b/bin/disk_stress_ng
5@@ -151,9 +151,15 @@ mount_filesystem() {
6 fi
7
8 find_largest_partition
9-
10+
11 if [ -n "$largest_part" ] ; then
12 echo "Found largest partition: \"$largest_part\""
13+ # If largest partition is too small, just abort with a message
14+ if [ $largest_size -lt 10000000000 ] ; then
15+ echo "Warning: $largest_part is less than 10GiB in size"
16+ echo "Disk is too small to test. Aborting test!"
17+ exit 1
18+ fi
19 mount_point=$(df | grep "$largest_part " | tr -s " " | cut -d " " -f 6)
20 if [ "$mount_point" == "" ] && [ "$really_run" == "Y" ] ; then
21 disk_device=$(echo $disk_device | sed "s/\/dev\/\/dev/\/dev/g")

Subscribers

People subscribed via source and target branches