generic/554: hide permision warning on exfat
[xfstests-dev.git] / tests / generic / 558
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2014 Red Hat Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. generic/558
6 #
7 # Stress test fs by using up all inodes and check fs.
8 #
9 # Also a regression test for xfsprogs commit
10 # d586858 xfs_repair: fix sibling pointer tests in verify_dir2_path()
11 #
12 seq=`basename $0`
13 seqres=$RESULT_DIR/$seq
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 tmp=/tmp/$$
18 status=1        # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
20
21 _cleanup()
22 {
23     cd /
24     rm -f $tmp.*
25 }
26
27 create_file()
28 {
29         local dir=$1
30         local nr_file=$2
31         local prefix=$3
32         local i=0
33
34         while [ $i -lt $nr_file ]; do
35                 echo -n > $dir/${prefix}_${i}
36                 let i=$i+1
37         done
38 }
39
40 # get standard environment, filters and checks
41 . ./common/rc
42 . ./common/filter
43
44 # real QA test starts here
45 _supported_fs generic
46 _require_inode_limits
47 _require_scratch
48
49 rm -f $seqres.full
50 echo "Silence is golden"
51
52 _scratch_mkfs_sized $((1024 * 1024 * 1024)) >>$seqres.full 2>&1
53 _scratch_mount
54
55 i=0
56 free_inode=`_get_free_inode $SCRATCH_MNT`
57 file_per_dir=1000
58 loop=$((free_inode / file_per_dir + 1))
59 mkdir -p $SCRATCH_MNT/testdir
60
61 echo "Create $((loop * file_per_dir)) files in $SCRATCH_MNT/testdir" >>$seqres.full
62 while [ $i -lt $loop ]; do
63         create_file $SCRATCH_MNT/testdir $file_per_dir $i >>$seqres.full 2>&1 &
64         let i=$i+1
65 done
66 wait
67
68 # log inode status in $seqres.full for debug purpose
69 echo "Inode status after taking all inodes" >>$seqres.full
70 $DF_PROG -i $SCRATCH_MNT >>$seqres.full
71
72 _check_scratch_fs
73
74 # Check again after removing all the files
75 rm -rf $SCRATCH_MNT/testdir
76 echo "Inode status after deleting all test files" >>$seqres.full
77 $DF_PROG -i $SCRATCH_MNT >>$seqres.full
78
79 status=0
80 exit