2 # FS QA Test No. shared/006
4 # Stress test fs by using up all inodes and check fs.
6 # Also a regression test for xfsprogs commit
7 # d586858 xfs_repair: fix sibling pointer tests in verify_dir2_path()
9 #-----------------------------------------------------------------------
10 # Copyright (c) 2014 Red Hat Inc. All Rights Reserved.
12 # This program is free software; you can redistribute it and/or
13 # modify it under the terms of the GNU General Public License as
14 # published by the Free Software Foundation.
16 # This program is distributed in the hope that it would be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write the Free Software Foundation,
23 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #-----------------------------------------------------------------------
28 seqres=$RESULT_DIR/$seq
29 echo "QA output created by $seq"
33 status=1 # failure is the default!
34 trap "_cleanup; exit \$status" 0 1 2 3 15
49 while [ $i -lt $nr_file ]; do
50 echo -n > $dir/${prefix}_${i}
55 # get standard environment, filters and checks
59 # real QA test starts here
60 _supported_fs ext4 ext3 ext2 xfs
66 echo "Silence is golden"
68 _scratch_mkfs_sized $((1024 * 1024 * 1024)) >>$seqres.full 2>&1
72 free_inode=`$DF_PROG -i $SCRATCH_MNT | tail -1 | awk '{print $3}'`
74 loop=$((free_inode / file_per_dir + 1))
75 mkdir -p $SCRATCH_MNT/testdir
77 echo "Create $((loop * file_per_dir)) files in $SCRATCH_MNT/testdir" >>$seqres.full
78 while [ $i -lt $loop ]; do
79 create_file $SCRATCH_MNT/testdir $file_per_dir $i >>$seqres.full 2>&1 &
84 # log inode status in $seqres.full for debug purpose
85 echo "Inode status after taking all inodes" >>$seqres.full
86 $DF_PROG -i $SCRATCH_MNT >>$seqres.full
90 # Check again after removing all the files
91 rm -rf $SCRATCH_MNT/testdir
92 echo "Inode status after deleting all test files" >>$seqres.full
93 $DF_PROG -i $SCRATCH_MNT >>$seqres.full