shared,generic: move shared/006 to generic/
authorTheodore Ts'o <tytso@mit.edu>
Fri, 28 Jun 2019 22:59:09 +0000 (18:59 -0400)
committerEryu Guan <guaneryu@gmail.com>
Fri, 5 Jul 2019 07:56:37 +0000 (15:56 +0800)
The shared/006 uses _scratch_mkfs_sized to create a limited size
file system, and then creates inodes until it gets ENOSPC, and then
checks to make sure the file system is consistent.  It then remounts
the file system, removes all of the files, and makes sure the file
system is consistent afterwards. This test was marked as only being
supported on ext[234] and xfs, and so it was in shared.

Now introduce a new _require_inode_limits() rule to run test on
filesystems that have a fixed inode number, then move the test to
generic.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc
tests/generic/558 [new file with mode: 0755]
tests/generic/558.out [new file with mode: 0644]
tests/generic/group
tests/shared/006 [deleted file]
tests/shared/006.out [deleted file]
tests/shared/group

index 25203bb44d2f21a888dade89627a70782b1fbf32..dcd591b33b87d03473ffd138c70a0fe9c5472970 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -3997,6 +3997,13 @@ _require_scratch_btime()
        _scratch_unmount
 }
 
+_require_inode_limits()
+{
+       if [ $(_get_free_inode $TEST_DIR) -eq 0 ]; then
+               _notrun "$FSTYP does not have a fixed number of inodes available"
+       fi
+}
+
 _require_filefrag_options()
 {
        _require_command "$FILEFRAG_PROG" filefrag
diff --git a/tests/generic/558 b/tests/generic/558
new file mode 100755 (executable)
index 0000000..c05aa96
--- /dev/null
@@ -0,0 +1,80 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2014 Red Hat Inc.  All Rights Reserved.
+#
+# FS QA Test No. generic/558
+#
+# Stress test fs by using up all inodes and check fs.
+#
+# Also a regression test for xfsprogs commit
+# d586858 xfs_repair: fix sibling pointer tests in verify_dir2_path()
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1       # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    cd /
+    rm -f $tmp.*
+}
+
+create_file()
+{
+       local dir=$1
+       local nr_file=$2
+       local prefix=$3
+       local i=0
+
+       while [ $i -lt $nr_file ]; do
+               echo -n > $dir/${prefix}_${i}
+               let i=$i+1
+       done
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_inode_limits
+
+rm -f $seqres.full
+echo "Silence is golden"
+
+_scratch_mkfs_sized $((1024 * 1024 * 1024)) >>$seqres.full 2>&1
+_scratch_mount
+
+i=0
+free_inode=`_get_free_inode $SCRATCH_MNT`
+file_per_dir=1000
+loop=$((free_inode / file_per_dir + 1))
+mkdir -p $SCRATCH_MNT/testdir
+
+echo "Create $((loop * file_per_dir)) files in $SCRATCH_MNT/testdir" >>$seqres.full
+while [ $i -lt $loop ]; do
+       create_file $SCRATCH_MNT/testdir $file_per_dir $i >>$seqres.full 2>&1 &
+       let i=$i+1
+done
+wait
+
+# log inode status in $seqres.full for debug purpose
+echo "Inode status after taking all inodes" >>$seqres.full
+$DF_PROG -i $SCRATCH_MNT >>$seqres.full
+
+_check_scratch_fs
+
+# Check again after removing all the files
+rm -rf $SCRATCH_MNT/testdir
+echo "Inode status after deleting all test files" >>$seqres.full
+$DF_PROG -i $SCRATCH_MNT >>$seqres.full
+
+status=0
+exit
diff --git a/tests/generic/558.out b/tests/generic/558.out
new file mode 100644 (file)
index 0000000..9a6c4e7
--- /dev/null
@@ -0,0 +1,2 @@
+QA output created by 558
+Silence is golden
index 543c062784fdd6e038dd5a81c6d7ad904679d4b6..8fc85b633cdebc1418e5e423f7e8e5b481cbd512 100644 (file)
 555 auto quick cap
 556 auto quick casefold
 557 auto quick log
+558 auto enospc
diff --git a/tests/shared/006 b/tests/shared/006
deleted file mode 100755 (executable)
index aa65e9a..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#! /bin/bash
-# SPDX-License-Identifier: GPL-2.0
-# Copyright (c) 2014 Red Hat Inc.  All Rights Reserved.
-#
-# FS QA Test No. shared/006
-#
-# Stress test fs by using up all inodes and check fs.
-#
-# Also a regression test for xfsprogs commit
-# d586858 xfs_repair: fix sibling pointer tests in verify_dir2_path()
-#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1       # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    rm -f $tmp.*
-}
-
-create_file()
-{
-       local dir=$1
-       local nr_file=$2
-       local prefix=$3
-       local i=0
-
-       while [ $i -lt $nr_file ]; do
-               echo -n > $dir/${prefix}_${i}
-               let i=$i+1
-       done
-}
-
-# get standard environment, filters and checks
-. ./common/rc
-. ./common/filter
-
-# real QA test starts here
-_supported_fs ext4 ext3 ext2 xfs
-_supported_os Linux
-
-_require_scratch
-
-rm -f $seqres.full
-echo "Silence is golden"
-
-_scratch_mkfs_sized $((1024 * 1024 * 1024)) >>$seqres.full 2>&1
-_scratch_mount
-
-i=0
-free_inode=`_get_free_inode $SCRATCH_MNT`
-file_per_dir=1000
-loop=$((free_inode / file_per_dir + 1))
-mkdir -p $SCRATCH_MNT/testdir
-
-echo "Create $((loop * file_per_dir)) files in $SCRATCH_MNT/testdir" >>$seqres.full
-while [ $i -lt $loop ]; do
-       create_file $SCRATCH_MNT/testdir $file_per_dir $i >>$seqres.full 2>&1 &
-       let i=$i+1
-done
-wait
-
-# log inode status in $seqres.full for debug purpose
-echo "Inode status after taking all inodes" >>$seqres.full
-$DF_PROG -i $SCRATCH_MNT >>$seqres.full
-
-_check_scratch_fs
-
-# Check again after removing all the files
-rm -rf $SCRATCH_MNT/testdir
-echo "Inode status after deleting all test files" >>$seqres.full
-$DF_PROG -i $SCRATCH_MNT >>$seqres.full
-
-status=0
-exit
diff --git a/tests/shared/006.out b/tests/shared/006.out
deleted file mode 100644 (file)
index 675c1b7..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-QA output created by 006
-Silence is golden
index 3507d7d4f09fdf38a6d63c64094bda111d09eefe..2cf910bdaf98ff1e919ffe2abc802710a5ea33dd 100644 (file)
@@ -4,7 +4,6 @@
 # - comment line before each group is "new" description
 #
 002 auto metadata quick log
-006 auto enospc
 008 auto stress dedupe
 009 auto stress dedupe
 010 auto stress dedupe