shared,ext4: move ext[234]-specific tests out of shared/
authorTheodore Ts'o <tytso@mit.edu>
Fri, 28 Jun 2019 22:59:08 +0000 (18:59 -0400)
committerEryu Guan <guaneryu@gmail.com>
Fri, 5 Jul 2019 07:34:40 +0000 (15:34 +0800)
Move the following tests:

shared/005 --> ext4/040
shared/007 --> ext4/041
shared/289 --> ext4/042

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
14 files changed:
tests/ext4/040 [new file with mode: 0755]
tests/ext4/040.out [new file with mode: 0644]
tests/ext4/041 [new file with mode: 0755]
tests/ext4/041.out [new file with mode: 0644]
tests/ext4/042 [new file with mode: 0755]
tests/ext4/042.out [new file with mode: 0644]
tests/ext4/group
tests/shared/005 [deleted file]
tests/shared/005.out [deleted file]
tests/shared/007 [deleted file]
tests/shared/007.out [deleted file]
tests/shared/289 [deleted file]
tests/shared/289.out [deleted file]
tests/shared/group

diff --git a/tests/ext4/040 b/tests/ext4/040
new file mode 100755 (executable)
index 0000000..3e475f7
--- /dev/null
@@ -0,0 +1,65 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2017 Oracle, Inc.  All Rights Reserved.
+#
+# FSQA Test No. ext4/040 (was shared/005)
+#
+# Since loff_t is a signed type, it is invalid for a filesystem to load
+# an inode with i_size = -1ULL.  Unfortunately, nobody checks this,
+# which means that we can trivially DoS the VFS by creating such a file
+# and appending to it.  This causes an integer overflow in the routines
+# underlying writeback, which results in the kernel locking up.
+#
+# So, create this malformed inode and try a buffered append to make
+# sure we catch this situation.
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+PIDS=""
+tmp=/tmp/$$
+status=1       # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# real QA test starts here
+_supported_os Linux
+_supported_fs ext2 ext3 ext4
+_require_scratch_nocheck
+_disable_dmesg_check
+_require_command "$DEBUGFS_PROG"
+
+rm -f $seqres.full
+
+echo "Format and mount"
+_scratch_mkfs  >> $seqres.full 2>&1
+_scratch_mount
+
+testdir=$SCRATCH_MNT
+echo m > $testdir/a
+
+echo "Corrupt filesystem"
+_scratch_unmount
+$DEBUGFS_PROG -w -R "sif /a size -1" $SCRATCH_DEV >> $seqres.full 2>&1
+
+# check whether debugfs succeeds to set i_size to -1 or not
+$DEBUGFS_PROG -R "stat /a" $SCRATCH_DEV 2>&1 | grep -q "Size: 18446744073709551615" || \
+       _notrun "Could not set i_size to -1 successfully, skip test."
+
+echo "Remount, try to append"
+_scratch_mount
+dd if=/dev/zero of=$testdir/a bs=512 count=1 oflag=append conv=notrunc >> $seqres.full 2>&1 || echo "Write did not succeed (ok)."
+sync
+
+# success, all done
+status=0
+exit
diff --git a/tests/ext4/040.out b/tests/ext4/040.out
new file mode 100644 (file)
index 0000000..dbccb49
--- /dev/null
@@ -0,0 +1,5 @@
+QA output created by 040
+Format and mount
+Corrupt filesystem
+Remount, try to append
+Write did not succeed (ok).
diff --git a/tests/ext4/041 b/tests/ext4/041
new file mode 100755 (executable)
index 0000000..5c9c071
--- /dev/null
@@ -0,0 +1,67 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2017 Oracle, Inc.  All Rights Reserved.
+#
+# FSQA Test No. ext4/041 (was shared/007)
+#
+# Since loff_t is a signed type, it is invalid for a filesystem to load
+# an inode with i_size = -1ULL.  Unfortunately, nobody checks this,
+# which means that we can trivially DoS the VFS by creating such a file
+# and appending to it.  This causes an integer overflow in the routines
+# underlying writeback, which results in the kernel locking up.
+#
+# So, create this malformed inode and try a dio append to make sure we
+# catch this situation.
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+PIDS=""
+tmp=/tmp/$$
+status=1       # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+       rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# real QA test starts here
+_supported_os Linux
+_supported_fs ext2 ext3 ext4
+_require_scratch_nocheck
+_disable_dmesg_check
+_require_command "$DEBUGFS_PROG"
+
+rm -f $seqres.full
+
+echo "Format and mount"
+_scratch_mkfs  >> $seqres.full 2>&1
+_scratch_mount
+
+testdir=$SCRATCH_MNT
+echo m > $testdir/a
+
+echo "Corrupt filesystem"
+_scratch_unmount
+# Set the file size to the highest multiple of 512 below
+# -1 so that we can perform a dio write.
+$DEBUGFS_PROG -w -R "sif /a size 0xFFFFFFFFFFFFFE00" $SCRATCH_DEV >> $seqres.full 2>&1
+
+# check whether debugfs succeeds to set i_size to -512 or not
+$DEBUGFS_PROG -R "stat /a" $SCRATCH_DEV 2>&1 | grep -q "Size: 18446744073709551104" || \
+       _notrun "Could not set i_size to -512 successfully, skip test."
+
+echo "Remount, try to append"
+_scratch_mount
+dd if=/dev/zero of=$testdir/a bs=512 count=1 oflag=direct,append conv=notrunc >> $seqres.full 2>&1 || echo "Write did not succeed (ok)."
+sync
+
+# success, all done
+status=0
+exit
diff --git a/tests/ext4/041.out b/tests/ext4/041.out
new file mode 100644 (file)
index 0000000..9748007
--- /dev/null
@@ -0,0 +1,5 @@
+QA output created by 041
+Format and mount
+Corrupt filesystem
+Remount, try to append
+Write did not succeed (ok).
diff --git a/tests/ext4/042 b/tests/ext4/042
new file mode 100755 (executable)
index 0000000..17d482a
--- /dev/null
@@ -0,0 +1,84 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2012 Red Hat, Inc.  All Rights Reserved.
+#
+# FS QA Test No. ext4/042 (was shared/289)
+#
+# Test overhead & df output for extN filesystems
+#
+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
+
+# Modify as appropriate.
+_supported_fs ext2 ext3 ext4
+_supported_os Linux
+_require_scratch
+
+rm -f $seqres.full
+
+_scratch_mkfs >> $seqres.full 2>&1
+
+# Get the honest truth about block counts straight from metadata on disk
+TOTAL_BLOCKS=`dumpe2fs -h $SCRATCH_DEV 2>/dev/null \
+               | awk '/Block count:/{print $3}'`
+
+FREE_BLOCKS=`dumpe2fs -h $SCRATCH_DEV 2>/dev/null \
+               | awk '/Free blocks:/{print $3}'`
+
+OVERHEAD=$(($TOTAL_BLOCKS-$FREE_BLOCKS))
+
+#  bsddf|minixdf
+#         Set the behaviour  for  the  statfs  system  call.  The  minixdf
+#         behaviour is to return in the f_blocks field the total number of
+#         blocks of the filesystem, while the bsddf  behaviour  (which  is
+#         the default) is to subtract the overhead blocks used by the ext2
+#         filesystem and not available for file storage.
+
+# stat -f output looks like this; we get f_blocks from that, which
+# varies depending on the df mount options used below:
+
+#   File: "/mnt/test"
+#    ID: affc5f2b2f57652 Namelen: 255     Type: ext2/ext3
+# Block size: 4096       Fundamental block size: 4096
+# Blocks: Total: 5162741    Free: 5118725    Available: 4856465
+# Inodes: Total: 1313760    Free: 1313749
+
+_scratch_mount "-o minixdf"
+MINIX_F_BLOCKS=`stat -f $SCRATCH_MNT | awk '/^Blocks/{print $3}'`
+_scratch_unmount
+
+_scratch_mount "-o bsddf"
+BSD_F_BLOCKS=`stat -f $SCRATCH_MNT | awk '/^Blocks/{print $3}'`
+_scratch_unmount
+
+# Echo data to $seqres.full for analysis
+echo "Overhead is $OVERHEAD blocks out of $TOTAL_BLOCKS ($FREE_BLOCKS free)" >> $seqres.full
+echo "MINIX free blocks $MINIX_F_BLOCKS" >> $seqres.full
+echo "BSD free blocks $BSD_F_BLOCKS" >> $seqres.full
+
+# minix should be exactly equal (hence tolerance of 0)
+_within_tolerance "minix f_blocks" $MINIX_F_BLOCKS $TOTAL_BLOCKS 0 -v
+# bsd should be within ... we'll say 1% for some slop
+_within_tolerance "bsd f_blocks" $BSD_F_BLOCKS $(($TOTAL_BLOCKS-$OVERHEAD)) 1% -v
+
+# success, all done
+status=0
+exit
diff --git a/tests/ext4/042.out b/tests/ext4/042.out
new file mode 100644 (file)
index 0000000..1bd6f82
--- /dev/null
@@ -0,0 +1,3 @@
+QA output created by 042
+minix f_blocks is in range
+bsd f_blocks is in range
index 6418d82d01865f9a0d6b95b96db1e3aac393b30c..9dfc0d35e90d39cab6c58f2ddb65bef96b6323d1 100644 (file)
@@ -42,6 +42,9 @@
 037 auto quick
 038 auto quick
 039 auto enospc rw
+040 dangerous_fuzzers
+041 dangerous_fuzzers
+042 auto quick
 271 auto rw quick
 301 aio auto ioctl rw stress defrag
 302 aio auto ioctl rw stress defrag
diff --git a/tests/shared/005 b/tests/shared/005
deleted file mode 100755 (executable)
index 67940dd..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#! /bin/bash
-# SPDX-License-Identifier: GPL-2.0
-# Copyright (c) 2017 Oracle, Inc.  All Rights Reserved.
-#
-# FSQA Test No. 005
-#
-# Since loff_t is a signed type, it is invalid for a filesystem to load
-# an inode with i_size = -1ULL.  Unfortunately, nobody checks this,
-# which means that we can trivially DoS the VFS by creating such a file
-# and appending to it.  This causes an integer overflow in the routines
-# underlying writeback, which results in the kernel locking up.
-#
-# So, create this malformed inode and try a buffered append to make
-# sure we catch this situation.
-#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-PIDS=""
-tmp=/tmp/$$
-status=1       # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-       rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
-. ./common/filter
-
-# real QA test starts here
-_supported_os Linux
-_supported_fs ext2 ext3 ext4
-_require_scratch_nocheck
-_disable_dmesg_check
-_require_command "$DEBUGFS_PROG"
-
-rm -f $seqres.full
-
-echo "Format and mount"
-_scratch_mkfs  >> $seqres.full 2>&1
-_scratch_mount
-
-testdir=$SCRATCH_MNT
-echo m > $testdir/a
-
-echo "Corrupt filesystem"
-_scratch_unmount
-$DEBUGFS_PROG -w -R "sif /a size -1" $SCRATCH_DEV >> $seqres.full 2>&1
-
-# check whether debugfs succeeds to set i_size to -1 or not
-$DEBUGFS_PROG -R "stat /a" $SCRATCH_DEV 2>&1 | grep -q "Size: 18446744073709551615" || \
-       _notrun "Could not set i_size to -1 successfully, skip test."
-
-echo "Remount, try to append"
-_scratch_mount
-dd if=/dev/zero of=$testdir/a bs=512 count=1 oflag=append conv=notrunc >> $seqres.full 2>&1 || echo "Write did not succeed (ok)."
-sync
-
-# success, all done
-status=0
-exit
diff --git a/tests/shared/005.out b/tests/shared/005.out
deleted file mode 100644 (file)
index 06e3fcd..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-QA output created by 005
-Format and mount
-Corrupt filesystem
-Remount, try to append
-Write did not succeed (ok).
diff --git a/tests/shared/007 b/tests/shared/007
deleted file mode 100755 (executable)
index 65cb527..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#! /bin/bash
-# SPDX-License-Identifier: GPL-2.0
-# Copyright (c) 2017 Oracle, Inc.  All Rights Reserved.
-#
-# FSQA Test No. 007
-#
-# Since loff_t is a signed type, it is invalid for a filesystem to load
-# an inode with i_size = -1ULL.  Unfortunately, nobody checks this,
-# which means that we can trivially DoS the VFS by creating such a file
-# and appending to it.  This causes an integer overflow in the routines
-# underlying writeback, which results in the kernel locking up.
-#
-# So, create this malformed inode and try a dio append to make sure we
-# catch this situation.
-#
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-PIDS=""
-tmp=/tmp/$$
-status=1       # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-       rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
-. ./common/filter
-
-# real QA test starts here
-_supported_os Linux
-_supported_fs ext2 ext3 ext4
-_require_scratch_nocheck
-_disable_dmesg_check
-_require_command "$DEBUGFS_PROG"
-
-rm -f $seqres.full
-
-echo "Format and mount"
-_scratch_mkfs  >> $seqres.full 2>&1
-_scratch_mount
-
-testdir=$SCRATCH_MNT
-echo m > $testdir/a
-
-echo "Corrupt filesystem"
-_scratch_unmount
-# Set the file size to the highest multiple of 512 below
-# -1 so that we can perform a dio write.
-$DEBUGFS_PROG -w -R "sif /a size 0xFFFFFFFFFFFFFE00" $SCRATCH_DEV >> $seqres.full 2>&1
-
-# check whether debugfs succeeds to set i_size to -512 or not
-$DEBUGFS_PROG -R "stat /a" $SCRATCH_DEV 2>&1 | grep -q "Size: 18446744073709551104" || \
-       _notrun "Could not set i_size to -512 successfully, skip test."
-
-echo "Remount, try to append"
-_scratch_mount
-dd if=/dev/zero of=$testdir/a bs=512 count=1 oflag=direct,append conv=notrunc >> $seqres.full 2>&1 || echo "Write did not succeed (ok)."
-sync
-
-# success, all done
-status=0
-exit
diff --git a/tests/shared/007.out b/tests/shared/007.out
deleted file mode 100644 (file)
index 3afba59..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-QA output created by 007
-Format and mount
-Corrupt filesystem
-Remount, try to append
-Write did not succeed (ok).
diff --git a/tests/shared/289 b/tests/shared/289
deleted file mode 100755 (executable)
index 94b6443..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-#! /bin/bash
-# SPDX-License-Identifier: GPL-2.0
-# Copyright (c) 2012 Red Hat, Inc.  All Rights Reserved.
-#
-# FS QA Test No. 289
-#
-# Test overhead & df output for extN filesystems
-#
-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
-
-# Modify as appropriate.
-_supported_fs ext2 ext3 ext4
-_supported_os Linux
-_require_scratch
-
-rm -f $seqres.full
-
-_scratch_mkfs >> $seqres.full 2>&1
-
-# Get the honest truth about block counts straight from metadata on disk
-TOTAL_BLOCKS=`dumpe2fs -h $SCRATCH_DEV 2>/dev/null \
-               | awk '/Block count:/{print $3}'`
-
-FREE_BLOCKS=`dumpe2fs -h $SCRATCH_DEV 2>/dev/null \
-               | awk '/Free blocks:/{print $3}'`
-
-OVERHEAD=$(($TOTAL_BLOCKS-$FREE_BLOCKS))
-
-#  bsddf|minixdf
-#         Set the behaviour  for  the  statfs  system  call.  The  minixdf
-#         behaviour is to return in the f_blocks field the total number of
-#         blocks of the filesystem, while the bsddf  behaviour  (which  is
-#         the default) is to subtract the overhead blocks used by the ext2
-#         filesystem and not available for file storage.
-
-# stat -f output looks like this; we get f_blocks from that, which
-# varies depending on the df mount options used below:
-
-#   File: "/mnt/test"
-#    ID: affc5f2b2f57652 Namelen: 255     Type: ext2/ext3
-# Block size: 4096       Fundamental block size: 4096
-# Blocks: Total: 5162741    Free: 5118725    Available: 4856465
-# Inodes: Total: 1313760    Free: 1313749
-
-_scratch_mount "-o minixdf"
-MINIX_F_BLOCKS=`stat -f $SCRATCH_MNT | awk '/^Blocks/{print $3}'`
-_scratch_unmount
-
-_scratch_mount "-o bsddf"
-BSD_F_BLOCKS=`stat -f $SCRATCH_MNT | awk '/^Blocks/{print $3}'`
-_scratch_unmount
-
-# Echo data to $seqres.full for analysis
-echo "Overhead is $OVERHEAD blocks out of $TOTAL_BLOCKS ($FREE_BLOCKS free)" >> $seqres.full
-echo "MINIX free blocks $MINIX_F_BLOCKS" >> $seqres.full
-echo "BSD free blocks $BSD_F_BLOCKS" >> $seqres.full
-
-# minix should be exactly equal (hence tolerance of 0)
-_within_tolerance "minix f_blocks" $MINIX_F_BLOCKS $TOTAL_BLOCKS 0 -v
-# bsd should be within ... we'll say 1% for some slop
-_within_tolerance "bsd f_blocks" $BSD_F_BLOCKS $(($TOTAL_BLOCKS-$OVERHEAD)) 1% -v
-
-# success, all done
-status=0
-exit
diff --git a/tests/shared/289.out b/tests/shared/289.out
deleted file mode 100644 (file)
index a4de760..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-QA output created by 289
-minix f_blocks is in range
-bsd f_blocks is in range
index 6f184946bd67cc05be8cb6a654e5626d87213ca2..3507d7d4f09fdf38a6d63c64094bda111d09eefe 100644 (file)
@@ -4,13 +4,10 @@
 # - comment line before each group is "new" description
 #
 002 auto metadata quick log
-005 dangerous_fuzzers
 006 auto enospc
-007 dangerous_fuzzers
 008 auto stress dedupe
 009 auto stress dedupe
 010 auto stress dedupe
 011 auto quick
 032 mkfs auto quick
-289 auto quick
 298 auto trim