shared,ext4: move ext4-specific tests out of shared/
authorTheodore Ts'o <tytso@mit.edu>
Fri, 28 Jun 2019 22:59:06 +0000 (18:59 -0400)
committerEryu Guan <guaneryu@gmail.com>
Fri, 5 Jul 2019 07:24:25 +0000 (15:24 +0800)
The tests shared/{001,003,004,272} test behaviour around the ext4's
journal.  As such, they are pointless to run on ext2, and ext3 no
longer is in kernels newer than 4.3.  (And most enterprise
distributions have been using ext4 to support the ext3 file system;
that capability has been around since 2.6.33.)  So we can move these
tests out of shared and into the ext4 class of tests:

shared/001 --> ext4/036
shared/003 --> ext4/037
shared/004 --> ext4/038
shared/272 --> ext4/039

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
18 files changed:
tests/ext4/036 [new file with mode: 0755]
tests/ext4/036.out [new file with mode: 0644]
tests/ext4/037 [new file with mode: 0755]
tests/ext4/037.out [new file with mode: 0644]
tests/ext4/038 [new file with mode: 0755]
tests/ext4/038.out [new file with mode: 0644]
tests/ext4/039 [new file with mode: 0755]
tests/ext4/039.out [new file with mode: 0644]
tests/ext4/group
tests/shared/001 [deleted file]
tests/shared/001.out [deleted file]
tests/shared/003 [deleted file]
tests/shared/003.out [deleted file]
tests/shared/004 [deleted file]
tests/shared/004.out [deleted file]
tests/shared/272 [deleted file]
tests/shared/272.out [deleted file]
tests/shared/group

diff --git a/tests/ext4/036 b/tests/ext4/036
new file mode 100755 (executable)
index 0000000..1d17001
--- /dev/null
@@ -0,0 +1,56 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2015 Red Hat Inc.  All Rights Reserved.
+#
+# FS QA Test No. ext4/036
+#
+# Test truncate orphan inodes when mounting ext4
+# ext4 used to hit WARNING, this commit fixed the issue
+#
+# 721e3eb ext4: lock i_mutex when truncating orphan inodes
+#
+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.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# real QA test starts here
+_supported_fs ext3 ext4
+_supported_os Linux
+_require_scratch
+
+rm -f $seqres.full
+echo "Silence is golden"
+
+_scratch_mkfs_sized $((16*1024*1024)) >>$seqres.full 2>&1
+_scratch_mount
+
+# create a file and get its inode number, usually it's 12, but to be accurate
+testfile=$SCRATCH_MNT/testfile
+touch $testfile
+inode=`ls -i $testfile | awk '{print $1}'`
+
+# add the inode in orphan inode list
+_scratch_unmount
+debugfs -w -R "set_super_value last_orphan $inode" $SCRATCH_DEV \
+       >>$seqres.full 2>&1
+
+# mount again to truncate orphan inode, _check_dmesg will catch the WARNING
+_scratch_mount
+
+status=0
+exit
diff --git a/tests/ext4/036.out b/tests/ext4/036.out
new file mode 100644 (file)
index 0000000..ed460d9
--- /dev/null
@@ -0,0 +1,2 @@
+QA output created by 036
+Silence is golden
diff --git a/tests/ext4/037 b/tests/ext4/037
new file mode 100755 (executable)
index 0000000..9394509
--- /dev/null
@@ -0,0 +1,53 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2015 Red Hat Inc.  All Rights Reserved.
+#
+# FS QA Test ext4/037
+#
+# Test mount a needs_recovery partition with noload option.
+# ext4 used to Oops until part of this commit:
+#
+# 744692d ext4: use ext4_get_block_write in buffer write
+#
+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.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# real QA test starts here
+_supported_fs ext3 ext4
+_supported_os Linux
+
+# nofsck as we modify sb via debugfs
+_require_scratch_nocheck
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+echo "Silence is golden"
+
+_scratch_mkfs >>$seqres.full 2>&1
+
+# set needs_recovery feature bit
+debugfs -w -R "feature +needs_recovery" $SCRATCH_DEV \
+       >>$seqres.full 2>&1
+
+# mount with noload option
+_try_scratch_mount "-o noload" >>$seqres.full 2>&1
+
+# success, all done
+status=0
+exit
diff --git a/tests/ext4/037.out b/tests/ext4/037.out
new file mode 100644 (file)
index 0000000..5c3a30a
--- /dev/null
@@ -0,0 +1,2 @@
+QA output created by 037
+Silence is golden
diff --git a/tests/ext4/038 b/tests/ext4/038
new file mode 100755 (executable)
index 0000000..5569c79
--- /dev/null
@@ -0,0 +1,49 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2016 Fujitsu.  All Rights Reserved.
+#
+# FS QA Test ext4/038
+#
+# Regression test for commit:
+# c9eb13a ext4: fix hang when processing corrupted orphaned inode list
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+tmp=/tmp/$$
+status=1       # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       cd /
+       rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+
+# real QA test starts here
+_supported_fs ext3 ext4
+_supported_os Linux
+_require_scratch
+_require_command "$DEBUGFS_PROG" debugfs
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+echo "Silence is golden"
+
+# Although the bug only happens when last_orphan is set to 5
+# it is better to test all reserved inode numbers 1-10 here
+for i in {1..10}; do
+       # create smaller filesystems to save test time
+       _scratch_mkfs_sized $((16 * 1024 * 1024)) >>$seqres.full 2>&1
+       $DEBUGFS_PROG -w -R "ssv last_orphan $i" $SCRATCH_DEV >>$seqres.full 2>&1
+       _scratch_mount
+       _scratch_unmount
+done
+
+# success, all done
+status=0
+exit
diff --git a/tests/ext4/038.out b/tests/ext4/038.out
new file mode 100644 (file)
index 0000000..5e0f13e
--- /dev/null
@@ -0,0 +1,2 @@
+QA output created by 038
+Silence is golden
diff --git a/tests/ext4/039 b/tests/ext4/039
new file mode 100755 (executable)
index 0000000..d285014
--- /dev/null
@@ -0,0 +1,90 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
+#
+# FSQA Test No. ext4/039
+#
+# Test data journaling flag switch for a single file  
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1       # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# ext3 and ext4 don't support direct IO in journalling mode
+write_opt_list="iflag=noatime conv=notrunc conv=fsync"
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+_workout()
+{
+       echo "Switch data journalling mode. Silence is golden."
+       chattr_opt_list="+j -j +jS -j"
+       idx=0
+       #
+       for write_opt in $write_opt_list
+       do
+               idx=$((idx + 1))
+               for chattr_opt in $chattr_opt_list
+               do
+                   
+                       echo "OP write_opt: $write_opt 4M, \
+chattr_opt: $chattr_opt" >>$seqres.full
+                       dd if=/dev/zero of=$SCRATCH_MNT/file.$idx \
+                               bs=1M count=4 $write_opt \
+                               >> $seqres.full 2>&1 || exit
+                       $CHATTR_PROG $chattr_opt $SCRATCH_MNT/file.$idx >> $seqres.full \
+                               || exit
+               done
+       done
+       sync
+       # Same as previous test, but for one file,
+       # and with ENOSPC triggering
+       for write_opt in $write_opt_list
+       do
+               idx=$((idx + 1))
+               for chattr_opt in $chattr_opt_list
+               do
+
+                       echo "OP write_opt: $write_opt ENOSPC, \
+chattr_opt: $chattr_opt" >>$seqres.full
+                       dd if=/dev/zero of=$SCRATCH_MNT/file.$idx \
+                               bs=1M $write_opt >> $seqres.full 2>&1
+                       $CHATTR_PROG $chattr_opt $SCRATCH_MNT/file.$idx \
+                               >> $seqres.full || exit
+               done
+               sync
+               unlink $SCRATCH_MNT/file.$idx
+       done
+}
+
+# real QA test starts here
+_supported_fs ext3 ext4
+_supported_os Linux
+_require_scratch
+_exclude_scratch_mount_option dax
+
+rm -f $seqres.full
+_scratch_mkfs_sized $((64 * 1024 * 1024)) >> $seqres.full 2>&1
+_scratch_mount
+
+if ! _workout; then
+       echo "workout failed"
+       _scratch_unmount
+       status=1
+       exit
+fi
+
+if ! _scratch_unmount; then
+       echo "failed to umount"
+       status=1
+       exit
+fi
+echo "Check filesystem"
+status=0
+exit
diff --git a/tests/ext4/039.out b/tests/ext4/039.out
new file mode 100644 (file)
index 0000000..2c8aaba
--- /dev/null
@@ -0,0 +1,3 @@
+QA output created by 039
+Switch data journalling mode. Silence is golden.
+Check filesystem
index d27ec893333b7152968ab8918fbac26e5f7be188..6418d82d01865f9a0d6b95b96db1e3aac393b30c 100644 (file)
 033 auto ioctl resize
 034 auto quick quota
 035 auto quick resize
+036 auto quick
+037 auto quick
+038 auto quick
+039 auto enospc rw
 271 auto rw quick
 301 aio auto ioctl rw stress defrag
 302 aio auto ioctl rw stress defrag
diff --git a/tests/shared/001 b/tests/shared/001
deleted file mode 100755 (executable)
index bde6e19..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#! /bin/bash
-# SPDX-License-Identifier: GPL-2.0
-# Copyright (c) 2015 Red Hat Inc.  All Rights Reserved.
-#
-# FS QA Test No. 001
-#
-# Test truncate orphan inodes when mounting extN.
-# ext4 used to hit WARNING, this commit fixed the issue
-#
-# 721e3eb ext4: lock i_mutex when truncating orphan inodes
-#
-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.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
-. ./common/filter
-
-# real QA test starts here
-_supported_fs ext2 ext3 ext4
-_supported_os Linux
-_require_scratch
-
-rm -f $seqres.full
-echo "Silence is golden"
-
-_scratch_mkfs_sized $((16*1024*1024)) >>$seqres.full 2>&1
-_scratch_mount
-
-# create a file and get its inode number, usually it's 12, but to be accurate
-testfile=$SCRATCH_MNT/testfile
-touch $testfile
-inode=`ls -i $testfile | awk '{print $1}'`
-
-# add the inode in orphan inode list
-_scratch_unmount
-debugfs -w -R "set_super_value last_orphan $inode" $SCRATCH_DEV \
-       >>$seqres.full 2>&1
-
-# mount again to truncate orphan inode, _check_dmesg will catch the WARNING
-_scratch_mount
-
-status=0
-exit
diff --git a/tests/shared/001.out b/tests/shared/001.out
deleted file mode 100644 (file)
index 88678b8..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-QA output created by 001
-Silence is golden
diff --git a/tests/shared/003 b/tests/shared/003
deleted file mode 100755 (executable)
index 761b969..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#! /bin/bash
-# SPDX-License-Identifier: GPL-2.0
-# Copyright (c) 2015 Red Hat Inc.  All Rights Reserved.
-#
-# FS QA Test 003
-#
-# Test mount a needs_recovery partition with noload option.
-# ext4 used to Oops until part of this commit:
-#
-# 744692d ext4: use ext4_get_block_write in buffer write
-#
-# Also test on ext2/3.
-#
-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.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
-. ./common/filter
-
-# real QA test starts here
-_supported_fs ext2 ext3 ext4
-_supported_os Linux
-
-# nofsck as we modify sb via debugfs
-_require_scratch_nocheck
-
-# remove previous $seqres.full before test
-rm -f $seqres.full
-echo "Silence is golden"
-
-_scratch_mkfs >>$seqres.full 2>&1
-
-# set needs_recovery feature bit
-debugfs -w -R "feature +needs_recovery" $SCRATCH_DEV \
-       >>$seqres.full 2>&1
-
-# mount with noload option
-_try_scratch_mount "-o noload" >>$seqres.full 2>&1
-
-# success, all done
-status=0
-exit
diff --git a/tests/shared/003.out b/tests/shared/003.out
deleted file mode 100644 (file)
index 6895fc8..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-QA output created by 003
-Silence is golden
diff --git a/tests/shared/004 b/tests/shared/004
deleted file mode 100755 (executable)
index 3021c85..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#! /bin/bash
-# SPDX-License-Identifier: GPL-2.0
-# Copyright (c) 2016 Fujitsu.  All Rights Reserved.
-#
-# FS QA Test 004
-#
-# Regression test for commit:
-# c9eb13a ext4: fix hang when processing corrupted orphaned inode list
-#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-tmp=/tmp/$$
-status=1       # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-       cd /
-       rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
-
-# real QA test starts here
-_supported_fs ext2 ext3 ext4
-_supported_os Linux
-_require_scratch
-_require_command "$DEBUGFS_PROG" debugfs
-
-# remove previous $seqres.full before test
-rm -f $seqres.full
-echo "Silence is golden"
-
-# Although the bug only happens when last_orphan is set to 5
-# it is better to test all reserved inode numbers 1-10 here
-for i in {1..10}; do
-       # create smaller filesystems to save test time
-       _scratch_mkfs_sized $((16 * 1024 * 1024)) >>$seqres.full 2>&1
-       $DEBUGFS_PROG -w -R "ssv last_orphan $i" $SCRATCH_DEV >>$seqres.full 2>&1
-       _scratch_mount
-       _scratch_unmount
-done
-
-# success, all done
-status=0
-exit
diff --git a/tests/shared/004.out b/tests/shared/004.out
deleted file mode 100644 (file)
index af8614a..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-QA output created by 004
-Silence is golden
diff --git a/tests/shared/272 b/tests/shared/272
deleted file mode 100755 (executable)
index b94dfc3..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-#! /bin/bash
-# SPDX-License-Identifier: GPL-2.0
-# Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
-#
-# FSQA Test No. 272
-#
-# Test data journaling flag switch for a single file  
-#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
-
-# ext3 and ext4 don't support direct IO in journalling mode
-write_opt_list="iflag=noatime conv=notrunc conv=fsync"
-
-# get standard environment, filters and checks
-. ./common/rc
-. ./common/filter
-_workout()
-{
-       echo "Switch data journalling mode. Silence is golden."
-       chattr_opt_list="+j -j +jS -j"
-       idx=0
-       #
-       for write_opt in $write_opt_list
-       do
-               idx=$((idx + 1))
-               for chattr_opt in $chattr_opt_list
-               do
-                   
-                       echo "OP write_opt: $write_opt 4M, \
-chattr_opt: $chattr_opt" >>$seqres.full
-                       dd if=/dev/zero of=$SCRATCH_MNT/file.$idx \
-                               bs=1M count=4 $write_opt \
-                               >> $seqres.full 2>&1 || exit
-                       $CHATTR_PROG $chattr_opt $SCRATCH_MNT/file.$idx >> $seqres.full \
-                               || exit
-               done
-       done
-       sync
-       # Same as previous test, but for one file,
-       # and with ENOSPC triggering
-       for write_opt in $write_opt_list
-       do
-               idx=$((idx + 1))
-               for chattr_opt in $chattr_opt_list
-               do
-
-                       echo "OP write_opt: $write_opt ENOSPC, \
-chattr_opt: $chattr_opt" >>$seqres.full
-                       dd if=/dev/zero of=$SCRATCH_MNT/file.$idx \
-                               bs=1M $write_opt >> $seqres.full 2>&1
-                       $CHATTR_PROG $chattr_opt $SCRATCH_MNT/file.$idx \
-                               >> $seqres.full || exit
-               done
-               sync
-               unlink $SCRATCH_MNT/file.$idx
-       done
-}
-
-# real QA test starts here
-_supported_fs ext3 ext4
-_supported_os Linux
-_require_scratch
-_exclude_scratch_mount_option dax
-
-rm -f $seqres.full
-_scratch_mkfs_sized $((64 * 1024 * 1024)) >> $seqres.full 2>&1
-_scratch_mount
-
-if ! _workout; then
-       echo "workout failed"
-       _scratch_unmount
-       status=1
-       exit
-fi
-
-if ! _scratch_unmount; then
-       echo "failed to umount"
-       status=1
-       exit
-fi
-echo "Check filesystem"
-status=0
-exit
diff --git a/tests/shared/272.out b/tests/shared/272.out
deleted file mode 100644 (file)
index a9eaf84..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-QA output created by 272
-Switch data journalling mode. Silence is golden.
-Check filesystem
index b091d9111359e755c4f4254a0fcbae67352c6c2d..6f184946bd67cc05be8cb6a654e5626d87213ca2 100644 (file)
@@ -3,10 +3,7 @@
 # - do not start group names with a digit
 # - comment line before each group is "new" description
 #
-001 auto quick
 002 auto metadata quick log
-003 auto quick
-004 auto quick
 005 dangerous_fuzzers
 006 auto enospc
 007 dangerous_fuzzers
@@ -15,6 +12,5 @@
 010 auto stress dedupe
 011 auto quick
 032 mkfs auto quick
-272 auto enospc rw
 289 auto quick
 298 auto trim