~jocave/checkbox/hybrid-amd-gpu-mods

« back to all changes in this revision

Viewing changes to checkbox-old/scripts/max_diskspace_used

  • Committer: Zygmunt Krynicki
  • Date: 2013-05-29 07:50:30 UTC
  • mto: This revision was merged to the branch mainline in revision 2153.
  • Revision ID: zygmunt.krynicki@canonical.com-20130529075030-ngwz245hs2u3y6us
checkbox: move current checkbox code into checkbox-old

This patch cleans up the top-level directory of the project into dedicated
sub-project directories. One for checkbox-old (the current checkbox and all the
associated stuff), one for plainbox and another for checkbox-ng.

There are some associated changes, such as updating the 'source' mode of
checkbox provider in plainbox, and fixing paths in various test scripts that we
have.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

Show diffs side-by-side

added added

removed removed

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