4 # growfs QA tests - repeatedly fill/grow the filesystem
5 # check the filesystem contents after each operation
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
9 #-----------------------------------------------------------------------
16 echo "QA output created by $seq"
20 status=1 # failure is the default!
28 trap "_cleanup ; exit \$status" 0 1 2 3 15
30 # get standard environment, filters and checks
34 # real QA test starts here
36 _supported_os IRIX Linux
40 umount $SCRATCH_DEV 2>/dev/null
44 if [ $# -ne 1 ]; then echo "Usage: _fill \"path\"" 1>&2 ; exit 1; fi
45 _do "Fill filesystem" \
46 "src/fill2fs --verbose --dir=$1 --seed=0 --filesize=65536 --stddev=32768 --list=- >>$tmp.manifest"
49 _do_die_on_error=message_only
52 echo -n "Make $agsize megabyte filesystem on SCRATCH_DEV and mount... "
53 _scratch_mkfs_xfs -dsize=${agsize}m,agcount=1 2>&1 >/dev/null || _fail "mkfs failed"
54 _scratch_mount || _fail "mount failed"
58 # full allocation group -> partial; partial -> expand partial + new partial;
59 # partial -> expand partial; partial -> full
60 # 17 -> 33 -> 35 -> 48 megabytes, converted to fs blocks below
61 # for size in 4352 8448 8960 12288
62 # 33 -> 67 -> 75 -> 96 converted to fs blocks:
63 for size in 8448 17512 19200 24576
65 _fill $SCRATCH_MNT/fill_$size
66 _do "Grow filesystem to $size blocks" "xfs_growfs -D ${size} $SCRATCH_MNT"
67 echo -n "Flush filesystem... "
68 _do "umount $SCRATCH_MNT"
71 echo -n "Check files... "
72 if ! _do "src/fill2fs_check $tmp.manifest"; then
73 echo "fail (see $seq.full)"
74 _do "cat $tmp.manifest"
75 _do "ls -altrR $SCRATCH_MNT"
76 _do "dd if=$SCRATCH_DEV bs=4096 count=$size | gzip -9 > $seq.fsimage.gz"
83 echo "Growfs tests passed."