Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 148 lines (125 sloc) 3.418 kb
27fba05e » Nathan Scott
2001-01-15 cmd/xfs/stress/001 1.6 Renamed to cmd/xfstests/001
1 #! /bin/sh
2 # XFS QA Test No. 015
3 # $Id: 1.1 $
4 #
5 # check out-of-space behaviour
6 #
7 #-----------------------------------------------------------------------
3ef12e38 » Eric Sandeen
2002-06-04 Update copyright dates (again)
8 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
27fba05e » Nathan Scott
2001-01-15 cmd/xfs/stress/001 1.6 Renamed to cmd/xfstests/001
9 #
10 # This program is free software; you can redistribute it and/or modify it
11 # under the terms of version 2 of the GNU General Public License as
12 # published by the Free Software Foundation.
13 #
14 # This program is distributed in the hope that it would be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 #
18 # Further, this software is distributed without any warranty that it is
19 # free of the rightful claim of any third person regarding infringement
20 # or the like. Any license provided herein, whether implied or
21 # otherwise, applies only to this software file. Patent licenses, if
22 # any, provided herein do not apply to combinations of this program with
23 # other software, or any other product whatsoever.
24 #
25 # You should have received a copy of the GNU General Public License along
26 # with this program; if not, write the Free Software Foundation, Inc., 59
27 # Temple Place - Suite 330, Boston MA 02111-1307, USA.
28 #
29 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
30 # Mountain View, CA 94043, or:
31 #
32 # http://www.sgi.com
33 #
34 # For further information regarding this notice, see:
35 #
36 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
37 #-----------------------------------------------------------------------
38 #
39 # creator
40 owner=dxm@sgi.com
41
42 seq=`basename $0`
43 echo "QA output created by $seq"
44
45 here=`pwd`
46 tmp=/tmp/$$
47 status=1 # success is the default!
48
49 # get standard environment, filters and checks
50 . ./common.rc
51 . ./common.filter
52
53 _cleanup()
54 {
55 umount $SCRATCH_MNT
56 }
57
58 trap "_cleanup; exit \$status" 0 1 2 3 15
59
60 _free()
61 {
2bf54adf » Daniel Moore
2001-05-14 check correct filesystem
62 _df_dir $SCRATCH_MNT | $AWK_PROG '{ print $5 }'
27fba05e » Nathan Scott
2001-01-15 cmd/xfs/stress/001 1.6 Renamed to cmd/xfstests/001
63 }
64
65 _filter_dd()
66 {
67 $AWK_PROG '
68 /records in/ { next }
69 /records out/ { next }
70 /No space left on device/ { print " !!! disk full (expected)"
71 next }
72 { print " *** " $0 }
73 '
74 }
75
76 # real QA test starts here
77 _require_scratch
78
8050efd4 » fsgqa
2003-05-22 Numerous changes to QA scripts allowing tests to run with external lo…
79 _scratch_mkfs_xfs -d size=50m >/dev/null
80 _scratch_mount
27fba05e » Nathan Scott
2001-01-15 cmd/xfs/stress/001 1.6 Renamed to cmd/xfstests/001
81 out=$SCRATCH_MNT/fillup.$$
2bf54adf » Daniel Moore
2001-05-14 check correct filesystem
82 rm -f $seq.full
27fba05e » Nathan Scott
2001-01-15 cmd/xfs/stress/001 1.6 Renamed to cmd/xfstests/001
83
84 free0=`_free`
85 if [ -z "$free0" ]
86 then
87 echo " *** failed to get free space (0)"
88 exit 1
89 fi
2bf54adf » Daniel Moore
2001-05-14 check correct filesystem
90 echo "free space at start $free0" >> $seq.full
27fba05e » Nathan Scott
2001-01-15 cmd/xfs/stress/001 1.6 Renamed to cmd/xfstests/001
91
92 echo "fill disk:" # well, filesystem really - not disk
93
451eb71e » fsgqa
2003-06-12 Fix QA tests which use dd so that they specify posixly correct output
94 POSIXLY_CORRECT=yes dd if=/dev/zero of=$out bs=1024k 2>&1 | _filter_dd
27fba05e » Nathan Scott
2001-01-15 cmd/xfs/stress/001 1.6 Renamed to cmd/xfstests/001
95
2bf54adf » Daniel Moore
2001-05-14 check correct filesystem
96 echo "check free space:"
97
98 free1=`_free`
99 if [ -z "$free1" ]
100 then
101 echo " *** failed to get free space (1)"
102 exit 1
103 fi
104 echo "free space after fill $free1" >> $seq.full
105
27fba05e » Nathan Scott
2001-01-15 cmd/xfs/stress/001 1.6 Renamed to cmd/xfstests/001
106 if [ ! -e $out ]
107 then
108 echo " *** file not created"
109 exit 1
110 fi
111
112 if [ ! -s $out ]
113 then
114 echo " *** file created with zero length"
115 ls -l $out
116 exit 1
117 fi
118
119 echo "delete fill:"
120
121 if ! rm $out
122 then
123 echo " *** file not deleted"
124 exit 1
125 fi
126
127 if [ -e $out ]
128 then
129 echo " *** file still exists"
130 ls -l $out
131 exit 1
132 fi
133
134 echo "check free space:"
135
2bf54adf » Daniel Moore
2001-05-14 check correct filesystem
136 free2=`_free`
137 if [ -z "$free2" ]
27fba05e » Nathan Scott
2001-01-15 cmd/xfs/stress/001 1.6 Renamed to cmd/xfstests/001
138 then
2bf54adf » Daniel Moore
2001-05-14 check correct filesystem
139 echo " *** failed to get free space (2)"
27fba05e » Nathan Scott
2001-01-15 cmd/xfs/stress/001 1.6 Renamed to cmd/xfstests/001
140 exit 1
141 fi
2bf54adf » Daniel Moore
2001-05-14 check correct filesystem
142 echo "free space after delete $free2" >> $seq.full
27fba05e » Nathan Scott
2001-01-15 cmd/xfs/stress/001 1.6 Renamed to cmd/xfstests/001
143
144 echo -n " !!! "
2bf54adf » Daniel Moore
2001-05-14 check correct filesystem
145 _within_tolerance "free space" $free2 $free0 1% -v
27fba05e » Nathan Scott
2001-01-15 cmd/xfs/stress/001 1.6 Renamed to cmd/xfstests/001
146
147 status=0
148 exit
Something went wrong with that request. Please try again.