xfstests: random regression tests
cover xfstests: random regression tests
308 and 309 are actually at version 3, revised after the re-factor. Posts for version 2 are:
http://oss.sgi.com/archives/xfs/2013-03/msg00746.html
http://oss.sgi.com/archives/xfs/2013-03/msg00747.html
310 and 311 are new test cases.
I keep the NNN test name and make the seq number unique across different test types.
All comments are appreciated.
Thanks,
Eryu Guan
Eryu Guan (4):
xfstests generic 308: check ctime updates for setfacl xfstests generic 309: test write to the last block of max file size on
ext4
xfstests ext4 310: test read /proc/fs/ext4/<dev>/mb_groups while the
fs is being unmounted
xfstests generic 311: test dir mtime and ctime are updated on rename
tests/ext4/310 | 74 +++++++++++++++++++++++++++++++++++++++++++++++ tests/ext4/310.out | 2 ++ tests/ext4/group | 2 +- tests/generic/308 | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/308.out | 2 ++ tests/generic/309 | 69 ++++++++++++++++++++++++++++++++++++++++++++ tests/generic/309.out | 2 ++ tests/generic/311 | 74 +++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/311.out | 2 ++ tests/generic/group | 3 ++ 10 files changed, 308 insertions(+), 1 deletion(-) create mode 100644 tests/ext4/310 create mode 100644 tests/ext4/310.out create mode 100644 tests/generic/308 create mode 100644 tests/generic/308.out create mode 100644 tests/generic/309 create mode 100644 tests/generic/309.out create mode 100644 tests/generic/311 create mode 100644 tests/generic/311.out
Signature · 6 lines
1.8.1.4 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH 2/4 xfstests generic 309: test write to the last block of max file size on ext4
On unpatched ext4 if an extent exists which includes the block right before the maximum file offset, and the block for the maximum file offset is written, the kernel panics.
On patched ext4, the write would get EFBIG since we lower s_maxbytes by one fs block.
Regression test for commit:
f17722f ext4: Fix max file size and logical block counting of extent format file
Though it's an ext4 specific issue, it's no harm to run on all file systems, so put it in generic.
--- tests/generic/309 | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/309.out | 2 ++ tests/generic/group | 1 + 3 files changed, 72 insertions(+) create mode 100644 tests/generic/309 create mode 100644 tests/generic/309.out
tests/generic/309 new file +69 -0
@@ -0,0 +1,69 @@ +#! /bin/bash +# FS QA Test No. 309 +# +# Regression test for commit: +# f17722f ext4: Fix max file size and logical block counting of extent format file +# +#----------------------------------------------------------------------- +# Copyright (c) 2013 Red Hat, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $testfile +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter + +testfile=$TEST_DIR/testfile.$seq + +# real QA test starts here +_supported_fs generic +_supported_os Linux + +rm -f $seq.full +echo "Silence is golden" + +block_size=`stat -f -c %s $TEST_DIR` + +# On unpatched ext4, if an extent exists which includes the block right +# before the maximum file offset, and the block for the maximum file offset +# is written, the kernel panics +# On patched ext4, the write would get EFBIG since we lower s_maxbytes by +# one fs block + +# Create a sparse file with an extent lays at one block before old s_maxbytes +offset=$(((2**32 - 2) * $block_size)) +$XFS_IO_PROG -f -c "pwrite $offset $block_size" -c fsync $testfile >$seq.full 2>&1 + +# Write to the block after the extent just created +offset=$(((2**32 - 1) * $block_size)) +$XFS_IO_PROG -f -c "pwrite $offset $block_size" -c fsync $testfile >>$seq.full 2>&1 + +# Got here without hitting BUG_ON(), test passed +status=0 +exit
tests/generic/309.out new file +2 -0
@@ -0,0 +1,2 @@ +QA output created by 309 +Silence is golden
tests/generic/group +1 -0
@@ -110,3 +110,4 @@ 300 auto aio enospc preallocrw stress 306 auto quick rw 308 auto quick +309 auto quick
Signature · 6 lines
1.8.1.4 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 2/4] xfstests generic 309: test write to the last block of max file size on ext4
Looks good.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 3/4 xfstests ext4 310: test read /proc/fs/ext4/<dev>/mb_groups while the fs is being unmounted
In reply to Eryu GuanRegression test for commit:
9559996 ext4: remove mb_groups before tearing down the buddy_cache
--- tests/ext4/310 | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/ext4/310.out | 2 ++ tests/ext4/group | 2 +- 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 tests/ext4/310 create mode 100644 tests/ext4/310.out
tests/ext4/310 new file +74 -0
@@ -0,0 +1,74 @@ +#! /bin/bash +# FS QA Test No. 310 +# +# Regression test for commit: +# 9559996 ext4: remove mb_groups before tearing down the buddy_cache +# +#----------------------------------------------------------------------- +# Copyright (c) 2013 Red Hat, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +PIDS="" +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + kill $PIDS >/dev/null 2>&1 +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter + +# real QA test starts here +_supported_fs ext4 +_supported_os Linux + +_require_scratch + +rm -f $seq.full +echo "Silence is golden" + +DEV_BASENAME=$(basename $(readlink -f $SCRATCH_DEV)) +echo "Start test on device $SCRATCH_DEV, basename $DEV_BASENAME" >$seq.full +_scratch_mkfs >>$seq.full 2>&1 + +while true;do + mount $SCRATCH_DEV $SCRATCH_MNT + umount $SCRATCH_DEV +done & +PIDS=$! + +while true;do + cat /proc/fs/ext4/$DEV_BASENAME/mb_groups > /dev/null 2>&1 +done & +PIDS="$PIDS $!" + +# sleep for 180s, in most cases a buggy kernel could hit BUG_ON within 3 minutes +sleep 180 + +# no BUG_ON, all done +kill $PIDS >/dev/null 2>&1 +wait +status=0 +exit
tests/ext4/310.out new file +2 -0
@@ -0,0 +1,2 @@ +QA output created by 310 +Silence is golden
tests/ext4/group +1 -1
@@ -8,4 +8,4 @@ 302 aio dangerous ioctl rw stress 303 aio dangerous ioctl rw stress 304 aio dangerous ioctl rw stress - +310 auto
Signature · 6 lines
1.8.1.4 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 3/4] xfstests ext4 310: test read /proc/fs/ext4/<dev>/mb_groups while the fs is being unmounted
Looks good.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 4/4 xfstests generic 311: test dir mtime and ctime are updated on rename
In reply to Eryu GuanTest directory mtime and ctime are updated when moving a file onto an existing file in the directory
Regression test for commit:
0b23076 ext3: fix update of mtime and ctime on rename
--- tests/generic/311 | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/311.out | 2 ++ tests/generic/group | 1 + 3 files changed, 77 insertions(+) create mode 100644 tests/generic/311 create mode 100644 tests/generic/311.out
tests/generic/311 new file +74 -0
@@ -0,0 +1,74 @@ +#! /bin/bash +# FS QA Test No. 311 +# +# Test directory mtime and ctime are updated when moving a file onto an +# existing file in the directory +# +# Regression test for commit: +# 0b23076 ext3: fix update of mtime and ctime on rename +# +#----------------------------------------------------------------------- +# Copyright (c) 2013 Red Hat, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +status=0 # success is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $TEST_DIR/testdir_$seq + rm -f $TEST_DIR/testfile.$seq +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter + +# real QA test starts here +_supported_fs generic +_supported_os IRIX Linux + +echo "Silence is golden" + +mkdir -p $TEST_DIR/testdir_$seq +touch $TEST_DIR/testdir_$seq/testfile +touch $TEST_DIR/testfile.$seq + +mtime1=`stat -c %Y $TEST_DIR/testdir_$seq` +ctime1=`stat -c %Z $TEST_DIR/testdir_$seq` + +sleep 1 +mv $TEST_DIR/testfile.$seq $TEST_DIR/testdir_$seq/testfile + +mtime2=`stat -c %Y $TEST_DIR/testdir_$seq` +ctime2=`stat -c %Z $TEST_DIR/testdir_$seq` + +if [ "$mtime1" == "$mtime2" ]; then + echo "mtime not updated" + let status=$status+1 +fi +if [ "$ctime1" == "$ctime2" ]; then + echo "ctime not updated" + let status=$status+1 +fi + +exit
tests/generic/311.out new file +2 -0
@@ -0,0 +1,2 @@ +QA output created by 311 +Silence is golden
tests/generic/group +1 -0
@@ -111,3 +111,4 @@ 306 auto quick rw 308 auto quick 309 auto quick +311 auto quick
Signature · 6 lines
1.8.1.4 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 4/4] xfstests generic 311: test dir mtime and ctime are updated on rename
Looks good.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Thanks for submitting this patchset, it has been committed.
--Rich
commit 797c82f0e22528df369cf198c2a9d6109e085838
Author: Eryu Guan <[email protected]> Date: Mon Apr 1 10:57:44 2013 +0000
xfstests generic 309: test dir mtime and ctime are updated on rename
Test directory mtime and ctime are updated when moving a file onto an existing file in the directory
Regression test for commit:
0b23076 ext3: fix update of mtime and ctime on rename
commit f7922730727844c6dee837bd1a64221342fef1d1
Author: Eryu Guan <[email protected]> Date: Mon Apr 1 10:57:43 2013 +0000
xfstests ext4 305: test read /proc/fs/ext4/<dev>/mb_groups while
the fs is being unmounted
Regression test for commit:
9559996 ext4: remove mb_groups before tearing down the buddy_cache
commit 94e1e7e53a89d9a3387bee7dea60091afaf79704
Author: Eryu Guan <[email protected]> Date: Mon Apr 1 10:57:42 2013 +0000
xfstests generic 308: test write to the last block of max file size
on ext4
On unpatched ext4 if an extent exists which includes the block right before the maximum file offset, and the block for the maximum file offset is written, the kernel panics.
On patched ext4, the write would get EFBIG since we lower s_maxbytes by one fs block.
Regression test for commit:
f17722f ext4: Fix max file size and logical block counting of
extent format file
Though it's an ext4 specific issue, it's no harm to run on all file systems, so put it in generic.
commit 6422b818388c652183b6b517be1feac554f5f004
Author: Eryu Guan <[email protected]> Date: Mon Apr 1 10:57:41 2013 +0000
xfstests generic 307: check ctime updates for setfacl
Check if ctime is updated and written to disk after setfacl
Regression test for the following extN commits
c6ac12a ext4: update ctime when changing the file's permission by
setfacl
30e2bab ext3: update ctime when changing the file's permission by
setfacl
523825b ext2: update ctime when changing the file's permission by
setfacl
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs