/usr/lib/plainbox-providers-1/checkbox/bin/max_diskspace_used is in plainbox-provider-checkbox 0.3-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #!/bin/bash
# Verify default partitioning has used the entire local hard disk.
# Please remove any non-local attached storage prior to running this
# test.
for disk in $@; do
echo "Checking maximum disk space available on : $disk"
psize=`parted -l | grep $disk | awk '{print $3}'`
if [ -n "$psize" ]
then
echo "Disk space available : $psize"
fsizes=`df -B ${psize:(-2)} | grep $disk | awk '{print $2}'`
if [ -n "$fsizes" ]
then
echo "Disk space used : $fsizes"
fsize=0
for i in $fsizes; do
i=`echo $i | grep -oe '[0-9\.]*'`
fsize=$(($fsize + $i))
done
psize=`echo $psize | grep -oe '[0-9\.]*'`
pct_difference=`awk "BEGIN{print(($psize - $fsize) / $fsize)}"`
echo "Difference ( > 0.15 fails ) : $pct_difference"
awk "BEGIN{exit($pct_difference > 0.15)}" || exit 1
fi
fi
done
|