From: Nathan Scott Date: Mon, 15 Jan 2001 05:01:19 +0000 (+0000) Subject: cmd/xfs/stress/001 1.6 Renamed to cmd/xfstests/001 X-Git-Tag: v1.1.0~1342 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=27fba05e66981c239c3be7a7e5a3aa0d8dc59247;p=users%2Fhch%2Fxfstests-dev.git cmd/xfs/stress/001 1.6 Renamed to cmd/xfstests/001 --- 27fba05e66981c239c3be7a7e5a3aa0d8dc59247 diff --git a/001 b/001 new file mode 100755 index 000000000..b9172104e --- /dev/null +++ b/001 @@ -0,0 +1,314 @@ +#! /bin/sh +# +# XFS QA Test No. 001 +# $Id: 1.1 $ +# +# Random file copier to produce chains of identical files so the head +# and the tail cna be diff'd at then end of each iteration. +# +# Exercises creat, write and unlink for a variety of directory sizes, and +# checks for data corruption. +# +# run [config] +# +# config has one line per file with filename and byte size, else use +# the default one below. +# +#----------------------------------------------------------------------- +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 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. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +#----------------------------------------------------------------------- +# +# creator +owner=kenmcd@bruce.melbourne.sgi.com + +seq=`basename $0` +echo "QA output created by $seq" + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +tmp=/tmp/$$ +here=`pwd` +status=1 +done_cleanup=false +trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15 + +# real QA test starts here + +verbose=true + +if [ $# -eq 0 ] +then + # use the default config + # + cat <$tmp.config +# pathname size in bytes +# +small 10 +big 102400 +sub/small 10 +sub/big 102400 +# +sub/a 1 +sub/b 2 +sub/c 4 +sub/d 8 +sub/e 16 +sub/f 32 +sub/g 64 +sub/h 128 +sub/i 256 +sub/j 512 +sub/k 1024 +sub/l 2048 +sub/m 4096 +sub/n 8192 +# +sub/a00 100 +sub/b00 200 +sub/c00 400 +sub/d00 800 +sub/e00 1600 +sub/f00 3200 +sub/g00 6400 +sub/h00 12800 +sub/i00 25600 +sub/j00 51200 +sub/k00 102400 +sub/l00 204800 +sub/m00 409600 +sub/n00 819200 +# +sub/a000 1000 +sub/e000 16000 +sub/h000 128000 +sub/k000 1024000 +End-of-File +elif [ $# -eq 1 ] +then + if [ -f $1 ] + then + cp $1 $tmp.config + else + echo "Error: cannot open config \"$1\"" + exit 1 + fi +else + echo "Usage: run [config]" + exit 1 +fi + +ncopy=200 # number of file copies in the chain step + +_setup() +{ + if mkdir -p $TEST_DIR/$$ + then + : + else + echo "Error: cannot mkdir \"$TEST_DIR/$$\"" + exit 1 + fi + cd $TEST_DIR/$$ + + $verbose && echo -n "setup " + sed -e '/^#/d' $tmp.config \ + | while read file nbytes + do + dir=`dirname $file` + if [ "$dir" != "." ] + then + if [ ! -d $dir ] + then + if mkdir $dir + then + : + else + $verbose && echo + echo "Error: cannot mkdir \"$dir\"" + exit 1 + fi + fi + fi + rm -f $file + if $here/src/fill $file $file $nbytes + then + : + else + $verbose && echo + echo "Error: cannot create \"$file\"" + exit 1 + fi + $verbose && echo -n "." + done + $verbose && echo +} + +_mark_iteration() +{ + $verbose && echo -n "mark_iteration " + sed -e '/^#/d' $tmp.config \ + | while read file nbytes + do + if [ ! -f $file ] + then + $verbose && echo + echo "Error: $file vanished!" + touch $tmp.bad + continue + fi + sed -e "s/ [0-9][0-9]* / $1 /" <$file >$file.tmp + mv $file.tmp $file + $verbose && echo -n "." + done + $verbose && echo +} + +# for each file, make a number of copies forming a chain like foo.0, +# foo.1, foo.2, ... foo.N +# +# files are chosen at random, so the lengths of the chains are different +# +# then rename foo.N to foo.last and remove all of the other files in +# the chain +# +_chain() +{ + $AWK_PROG <$tmp.config ' +BEGIN { nfile = 0 } +/^\#/ { next } + { file[nfile] = $1 + link[nfile] = 0 + nfile++ + } +END { srand('$iter') + for (i=0; i < '$ncopy'; i++) { + # choose a file at random, and add one copy to that chain + j = -1 + while (j < 0 || j >= nfile) + j = int(rand() * nfile) + if (link[j] == 0) { + printf "if [ ! -f %s ]; then echo \"%s missing!\"; exit; fi\n",file[j],file[j] + printf "if [ -f %s.0 ]; then echo \"%s.0 already present!\"; exit; fi\n",file[j],file[j] + printf "cp %s %s.0\n",file[j],file[j] + } + else { + printf "if [ ! -f %s.%d ]; then echo \"%s.%d missing!\"; exit; fi\n",file[j],link[j]-1,file[j],link[j]-1 + printf "if [ -f %s.%d ]; then echo \"%s.%d already present!\"; exit; fi\n",file[j],link[j],file[j],link[j] + printf "cp %s.%d %s.%d\n",file[j],link[j]-1,file[j],link[j] + } + link[j]++ + } + # close all the chains, and remove all of the files except + # the head of the chain + for (j=0; j 0) + printf "mv %s.%d %s.last\n",file[j],link[j]-1,file[j] + for (i=0; i/dev/null 2>&1 + then + $verbose && echo -n "." + else + $verbose && echo + echo "Error: corruption for $file ..." + diff -c $file $file.last + touch $tmp.bad + fi + else + $verbose && echo -n "." + fi + done + $verbose && echo +} + +_cleanup() +{ + # cleanup + # + if $done_cleanup + then + : + elif [ $status -eq 0 ] + then + $verbose && echo "cleanup" + cd / + rm -rf $TEST_DIR/$$ + done_cleanup=true + fi +} + +status=0 +_cleanup +status=1 +done_cleanup=false + +_setup + +# do the test +# +for iter in 1 2 3 4 5 +do + echo -n "iter $iter chain ... " + _chain + _check + if [ -f $tmp.bad ] + then + echo "Fatal error: test abandoned without changes" + exit 1 + fi +done + +status=0 +exit diff --git a/001.out b/001.out new file mode 100644 index 000000000..e843a586c --- /dev/null +++ b/001.out @@ -0,0 +1,9 @@ +QA output created by 001 +cleanup +setup .................................... +iter 1 chain ... check .................................... +iter 2 chain ... check .................................... +iter 3 chain ... check .................................... +iter 4 chain ... check .................................... +iter 5 chain ... check .................................... +cleanup diff --git a/002 b/002 new file mode 100755 index 000000000..d9dfe484a --- /dev/null +++ b/002 @@ -0,0 +1,88 @@ +#! /bin/sh +# +# XFS QA Test No. 002 +# $Id: 1.1 $ +# +# simple inode link count test for a regular file +# +#----------------------------------------------------------------------- +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 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. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +#----------------------------------------------------------------------- +# +# creator +owner=kenmcd@sgi.com + +seq=`basename $0` +echo "QA output created by $seq" + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +tmp=/tmp/$$ +here=`pwd` +status=0 # success is the default! +trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 + +# real QA test starts here + +echo "Silence is goodness ..." + +# ensure target directory exists +mkdir `dirname $TEST_DIR/$tmp` 2>/dev/null + +touch $TEST_DIR/$tmp.1 +for l in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +do + ln $TEST_DIR/$tmp.1 $TEST_DIR/$tmp.$l + x=`src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'` + if [ "$l" -ne $x ] + then + echo "Arrgh, created link #$l and lstat64 looks like ..." + src/lstat64 $TEST_DIR/$tmp.1 + status=1 + fi +done + +for l in 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 +do + x=`src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'` + if [ "$l" -ne $x ] + then + echo "Arrgh, about to remove link #$l and lstat64 looks like ..." + src/lstat64 $TEST_DIR/$tmp.1 + status=1 + fi + rm -f $TEST_DIR/$tmp.$l +done + +# success, all done +exit diff --git a/002.out b/002.out new file mode 100644 index 000000000..11426b541 --- /dev/null +++ b/002.out @@ -0,0 +1,2 @@ +QA output created by 002 +Silence is goodness ... diff --git a/003 b/003 new file mode 100755 index 000000000..c3147c1ab --- /dev/null +++ b/003 @@ -0,0 +1,104 @@ +#! /bin/sh +# +# XFS QA Test No. 003 +# $Id: 1.1 $ +# +# exercise xfs_db bug #784078 +# +#----------------------------------------------------------------------- +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 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. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +#----------------------------------------------------------------------- +# +# creator +owner=nathans@melbourne.sgi.com + +seq=`basename $0` +echo "QA output created by $seq" + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +tmp=/tmp/$$ +here=`pwd` +status=0 # success is the default! +trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 + +_need_to_be_root + +# real QA test starts here + +PATH=".:$PATH" + +[ -f core ] && rm -f core +[ -f core ] && echo "Warning: can't nuke existing core file!" + +test_done() +{ + sts=$? + [ -f core ] && echo "FAILED - core file" + [ ! -f core -a $sts != 0 ] && echo "FAILED - non-zero exit status" + rm -f core +} + +# real QA test starts here + +echo "=== TEST 1 ===" +xfs_db -r -c 'pop' -c 'type sb' $TEST_DEV +test_done + +echo "=== TEST 2 ===" +xfs_db -r -c 'push sb' $TEST_DEV +test_done + +echo "=== TEST 3 ===" +xfs_db -r -c 'pop' -c 'push sb' $TEST_DEV +test_done + +echo "=== TEST 4 ===" +xfs_db -r -c 'type sb' -c 'print' $TEST_DEV +test_done + +echo "=== TEST 5 ===" +xfs_db -r -c 'inode 128' -c 'push' -c 'type' $TEST_DEV >$tmp.out 2>&1 +test_done +if ! grep -q "current type is \"inode\"" $tmp.out +then + cat $tmp.out +fi + +echo "=== TEST 6 ===" +xfs_db -r -c 'sb' -c 'a' $TEST_DEV >$tmp.out 2>&1 # don't care about output +test_done + +echo "=== TEST 7 ===" +xfs_db -r -c 'ring' $TEST_DEV +test_done diff --git a/003.out b/003.out new file mode 100644 index 000000000..e55df2ea3 --- /dev/null +++ b/003.out @@ -0,0 +1,12 @@ +QA output created by 003 +=== TEST 1 === +no current object +=== TEST 2 === +=== TEST 3 === +=== TEST 4 === +no current object +no current type +=== TEST 5 === +=== TEST 6 === +=== TEST 7 === +no entries in location ring. diff --git a/004 b/004 new file mode 100755 index 000000000..54df4f9dd --- /dev/null +++ b/004 @@ -0,0 +1,139 @@ +#! /bin/sh +# XFS QA Test No. 004 +# $Id: 1.1 $ +# +# exercise xfs_db bug #789674 and other freesp functionality +# +#----------------------------------------------------------------------- +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 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. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +#----------------------------------------------------------------------- +# +# creator +owner=nathans@sgi.com + +seq=`basename $0` +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=0 + +_cleanup() +{ + umount $SCRATCH_MNT + rm -f $tmp.* + exit $status +} +trap "_cleanup" 0 1 2 3 15 + +_populate_scratch() +{ + mkfs -t xfs -f $SCRATCH_DEV >/dev/null 2>&1 + mount -t xfs $SCRATCH_DEV $SCRATCH_MNT + dd if=/dev/zero of=$SCRATCH_MNT/foo count=200 bs=4096 >/dev/null 2>&1 & + dd if=/dev/zero of=$SCRATCH_MNT/goo count=400 bs=4096 >/dev/null 2>&1 & + dd if=/dev/zero of=$SCRATCH_MNT/moo count=800 bs=4096 >/dev/null 2>&1 & + wait + umount $SCRATCH_MNT # flush everything + mount -t xfs $SCRATCH_DEV $SCRATCH_MNT # and then remount +} + + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +_need_to_be_root +_require_scratch + +# real QA test starts here +rm -f $seq.full + +_populate_scratch + +eval `df -P -T --block-size=512 $SCRATCH_MNT 2>&1 \ + | $AWK_PROG 'END { printf "blocks=%u used=%u avail=%u\n", $3, $4, $5 }'` +echo "df gave: blocks=$blocks used=$used avail=$avail" >>$seq.full + +blksize=`xfs_db -r -c sb -c p $SCRATCH_DEV |grep blocksize |sed -e 's/.*= *//'` +if [ -z "$blksize" ] +then + echo "Arrgh ... cannot determine blocksize for $fs, xfs_db reports" + xfs_db -r -c sb -c p $SCRATCH_DEV + status=1 + continue +fi +echo "blocksize from xfs_db is '$blksize'" >>$seq.full + +xfs_db -r -c "freesp -s" $SCRATCH_DEV >$tmp.xfs_db +echo "xfs_db for $SCRATCH_DEV" >>$seq.full +cat $tmp.xfs_db >>$seq.full + +# check the 'blocks' field from freesp command is OK +perl -ne ' + BEGIN { $avail ='$avail' * 512; + $answer="(no xfs_db free blocks line?)" } + /free blocks (\d+)$/ || next; + $freesp = $1 * '$blksize'; + if ($freesp == $avail) { $answer = "yes"; } + else { $answer = "no ($freesp != $avail)"; } + END { print "$answer\n" } + ' <$tmp.xfs_db >$tmp.ans +ans="`cat $tmp.ans`" +echo "Checking blocks column same as df: $ans" +if [ "$ans" != yes ] +then + echo "Error: $SCRATCH_DEV: freesp mismatch: $ans" + echo "xfs_db output ..." + cat $tmp.xfs_db + status=1 +fi + +# check the 'pct' field from freesp command is good +perl -ne ' + BEGIN { $percent = 0; } + /free/ && next; # skip over free extent size number + if (/\s+(\d+\.\d+)$/) { + $percent += $1; + } + END { $percent += 0.5; print int($percent), "\n" } # round up +' <$tmp.xfs_db >$tmp.ans +ans="`cat $tmp.ans`" +echo "Checking percent column yields 100: $ans" +if [ "$ans" != 100 ] +then + echo "Error: $SCRATCH_DEV: pct mismatch: $ans (expected 100)" + echo "xfs_db output ..." + cat $tmp.xfs_db + status=1 +fi + +exit diff --git a/004.out b/004.out new file mode 100644 index 000000000..b598b9035 --- /dev/null +++ b/004.out @@ -0,0 +1,3 @@ +QA output created by 004 +Checking blocks column same as df: yes +Checking percent column yields 100: 100 diff --git a/005 b/005 new file mode 100755 index 000000000..692035d04 --- /dev/null +++ b/005 @@ -0,0 +1,87 @@ +#! /bin/sh +# XFS QA Test No. 005 +# $Id: 1.1 $ +# +# Test symlinks & ELOOP +# +#----------------------------------------------------------------------- +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 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. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +#----------------------------------------------------------------------- +# +# creator +owner=dxm@sgi.com + +# +# note ELOOP limit used to be 32 but changed to 8. Who know what +# it might be next. +# + +seq=`basename $0` +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=0 # success is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd $TEST_DIR + rm -f symlink_{0,1,2,3}{0,1,2,3,4,5,6,7,8,9} symlink_self empty_file +} + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +# real QA test starts here + +cd $TEST_DIR + +o=empty_file +touch $o +for f in symlink_{0,1,2,3}{0,1,2,3,4,5,6,7,8,9} +do + ln -s $o $f + o=$f +done + +ln -s symlink_self symlink_self + +echo "*** touch deep symlinks" +echo "" +touch symlink_{0,1,2,3}{0,1,2,3,4,5,6,7,8,9} +echo "" +echo "*** touch recusive symlinks" +echo "" +touch symlink_self + +exit diff --git a/005.out b/005.out new file mode 100644 index 000000000..890720f4f --- /dev/null +++ b/005.out @@ -0,0 +1,39 @@ +QA output created by 005 +*** touch deep symlinks + +touch: symlink_08: Too many levels of symbolic links +touch: symlink_09: Too many levels of symbolic links +touch: symlink_10: Too many levels of symbolic links +touch: symlink_11: Too many levels of symbolic links +touch: symlink_12: Too many levels of symbolic links +touch: symlink_13: Too many levels of symbolic links +touch: symlink_14: Too many levels of symbolic links +touch: symlink_15: Too many levels of symbolic links +touch: symlink_16: Too many levels of symbolic links +touch: symlink_17: Too many levels of symbolic links +touch: symlink_18: Too many levels of symbolic links +touch: symlink_19: Too many levels of symbolic links +touch: symlink_20: Too many levels of symbolic links +touch: symlink_21: Too many levels of symbolic links +touch: symlink_22: Too many levels of symbolic links +touch: symlink_23: Too many levels of symbolic links +touch: symlink_24: Too many levels of symbolic links +touch: symlink_25: Too many levels of symbolic links +touch: symlink_26: Too many levels of symbolic links +touch: symlink_27: Too many levels of symbolic links +touch: symlink_28: Too many levels of symbolic links +touch: symlink_29: Too many levels of symbolic links +touch: symlink_30: Too many levels of symbolic links +touch: symlink_31: Too many levels of symbolic links +touch: symlink_32: Too many levels of symbolic links +touch: symlink_33: Too many levels of symbolic links +touch: symlink_34: Too many levels of symbolic links +touch: symlink_35: Too many levels of symbolic links +touch: symlink_36: Too many levels of symbolic links +touch: symlink_37: Too many levels of symbolic links +touch: symlink_38: Too many levels of symbolic links +touch: symlink_39: Too many levels of symbolic links + +*** touch recusive symlinks + +touch: symlink_self: Too many levels of symbolic links diff --git a/006 b/006 new file mode 100755 index 000000000..d185a0cfc --- /dev/null +++ b/006 @@ -0,0 +1,89 @@ +#! /bin/sh +# XFS QA Test No. 006 +# $Id: 1.1 $ +# +# permname +# +#----------------------------------------------------------------------- +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 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. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +#----------------------------------------------------------------------- +# +# creator +owner=dxm@sgi.com + +seq=`basename $0` +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=0 # success is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + rm -rf $TEST_DIR/permname.$$ +} + +_count() +{ + $AWK_PROG ' + BEGIN { count = 0 } + { count ++ } + END { print count " files created" } + ' +} + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +# real QA test starts here + + +mkdir $TEST_DIR/permname.$$ + +echo "" +echo "single thread permname" +echo "----------------------" +mkdir $TEST_DIR/permname.$$/a +cd $TEST_DIR/permname.$$/a +$here/src/permname -c 4 -l 6 -p 1 || echo "permname returned $?" +find . | _count + +echo "" +echo "multi thread permname" +echo "----------------------" +mkdir $TEST_DIR/permname.$$/b +cd $TEST_DIR/permname.$$/b +$here/src/permname -c 4 -l 6 -p 4 || echo "permname returned $?" +find . | _count + +exit diff --git a/006.out b/006.out new file mode 100644 index 000000000..ce17a490f --- /dev/null +++ b/006.out @@ -0,0 +1,11 @@ +QA output created by 006 + +single thread permname +---------------------- +alpha size = 4, name length = 6, total files = 4096, nproc=1 +4097 files created + +multi thread permname +---------------------- +alpha size = 4, name length = 6, total files = 4096, nproc=4 +4097 files created diff --git a/007 b/007 new file mode 100755 index 000000000..84b78d6ad --- /dev/null +++ b/007 @@ -0,0 +1,90 @@ +#! /bin/sh +# XFS QA Test No. 007 +# $Id: 1.1 $ +# +# drive the src/nametest program +# which does a heap of open(create)/unlink/stat +# and checks that error codes make sense with its +# memory of the files created. +# +#----------------------------------------------------------------------- +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 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. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +#----------------------------------------------------------------------- +# +# creator +owner=tes@sherman.melbourne.sgi.com + +seq=`basename $0` +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=0 # success is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + rm -f $tmp.* + rm -rf $TEST_DIR/$seq +} + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +# real QA test starts here +status=1 # default failure +sourcefile=$tmp.nametest +seed=1 +iterations=100000 +num_filenames=100 + +# need to create an input file with a list of +# filenames on each line +i=1 +while [ $i -le $num_filenames ]; do + echo "nametest.$i" >>$sourcefile + i=`expr $i + 1` +done + +mkdir $TEST_DIR/$seq +cd $TEST_DIR/$seq +$here/src/nametest -l $sourcefile -s $seed -i $iterations -z + + +#optional stuff if your test has verbose output to help resolve problems +#echo +#echo "If failure, check $seq.full (this) and $seq.full.ok (reference)" + + +# success, all done +status=0 +exit diff --git a/007.out b/007.out new file mode 100644 index 000000000..514b44a6a --- /dev/null +++ b/007.out @@ -0,0 +1,22 @@ +QA output created by 007 +.Seed = 1 (use "-s 1" to re-execute this test) +....................................................................... +......................................................................... +......................................................................... +......................................................................... +......................................................................... +......................................................................... +......................................................................... +......................................................................... +......................................................................... +......................................................................... +......................................................................... +......................................................................... +......................................................................... +.................................................... +creates: 18736 OK, 18802 EEXIST ( 37538 total, 50% EEXIST) +removes: 18675 OK, 19927 ENOENT ( 38602 total, 51% ENOENT) +lookups: 12000 OK, 11860 ENOENT ( 23860 total, 49% ENOENT) +total : 49411 OK, 50589 w/error (100000 total, 50% w/error) + +cleanup: 61 removes diff --git a/008 b/008 new file mode 100755 index 000000000..86ecf4f9b --- /dev/null +++ b/008 @@ -0,0 +1,98 @@ +#! /bin/sh +# XFS QA Test No. 008 +# $Id: 1.1 $ +# +# randholes test +# +#----------------------------------------------------------------------- +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 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. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +#----------------------------------------------------------------------- +# +# creator +owner=dxm@sgi.com + +seq=`basename $0` +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=0 # success is the default! +trap "rm -f $tmp.*; _cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + rm -rf $TEST_DIR/randholes.$$.* +} + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +_do_test() +{ + _n="$1" + _holes="$2" + _param="$3" + + out=$TEST_DIR/randholes.$$.$_n + echo "" + echo "randholes.$_n : $_param" + echo "------------------------------------------" + if $here/src/randholes $_param $out >$tmp.out + then + # quick check - how many holes did we get? + count=`xfs_bmap $out | egrep -c ': hole'` + # blocks can end up adjacent, therefore number of holes varies + _within_tolerance "holes" $count $_holes 10% -v + else + echo " randholes returned $? - see $seq.out.full" + echo "--------------------------------------" >>$here/$seq.out.full + echo "$_n - output from randholes:" >>$here/$seq.out.full + echo "--------------------------------------" >>$here/$seq.out.full + cat $tmp.out >>$here/$seq.out.full + echo "--------------------------------------" >>$here/$seq.out.full + echo "$_n - output from bmap:" >>$here/$seq.out.full + echo "--------------------------------------" >>$here/$seq.out.full + xfs_bmap -vvv $out >>$here/$seq.out.full + status=1 + fi +} + +# real QA test starts here + +rm -f $here/$seq.out.full + +_do_test 1 50 "-l 5000000 -c 50 -b 4096" +_do_test 2 100 "-l 10000000 -c 100 -b 4096" +_do_test 3 100 "-l 10000000 -c 100 -b 512" # test partial pages + +# success, all done +exit diff --git a/008.out b/008.out new file mode 100644 index 000000000..7bac019c9 --- /dev/null +++ b/008.out @@ -0,0 +1,13 @@ +QA output created by 008 + +randholes.1 : -l 5000000 -c 50 -b 4096 +------------------------------------------ +holes is in range + +randholes.2 : -l 10000000 -c 100 -b 4096 +------------------------------------------ +holes is in range + +randholes.3 : -l 10000000 -c 100 -b 512 +------------------------------------------ +holes is in range diff --git a/009 b/009 new file mode 100755 index 000000000..6758c991a --- /dev/null +++ b/009 @@ -0,0 +1,197 @@ +#! /bin/sh +# XFS QA Test No. 009 +# $Id: 1.1 $ +# +# alloc test +# +#----------------------------------------------------------------------- +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 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. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +#----------------------------------------------------------------------- +# +# creator +owner=dxm@sgi.com + +seq=`basename $0` +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() +{ + echo "*** unmount" + umount $SCRATCH_MNT +} + +_block_filter() +{ + sed -e 's/[0-9][0-9]*\.\.[0-9][0-9]*/BLOCKRANGE/g' +} + +_init() +{ + echo "*** mkfs" + if ! mkfs -t xfs -f $SCRATCH_DEV >$tmp.out 2>&1 + then + cat $tmp.out + echo "failed to mkfs $SCRATCH_DEV" + exit 1 + fi + + echo "*** mount" + if ! mount $SCRATCH_DEV $SCRATCH_MNT -t xfs + then + echo "failed to mount $SCRATCH_DEV" + exit 1 + fi +} + +_filesize() +{ + ls -l $1 | $AWK_PROG '{print "filesize = " $5}' +} + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +# real QA test starts here + +_require_scratch + +_init +out=$SCRATCH_MNT/$$.tmp + +# since we're using a clean FS here, we make some assumptions +# about availability of contiguous blocks + +# also interesting to note is that ALLOC == FREE. seriously. +# the _length is ignored_ in irix. the file is allocated up +# to the specified offset, and zero filled if previously +# unallocated. the file is truncated at the specified point. + +echo "*** test 1 - reservations cleared on O_TRUNC" +rm -f $out +cat <" + if ! $here/src/dirstress -d $out -f $count $args >$tmp.out 2>&1 + then + echo " dirstress failed" + echo "*** TEST $test -d $out -f $count $args" >>$seq.out.full + cat $tmp.out >>$seq.out.full + status=1 + fi +} + +# dirstress doesn't check returns - this is a crash & burn test. + +count=1000 +_test 1 "-p 1 -n 1" $count +_test 2 "-p 5 -n 1" $count +_test 3 "-p 5 -n 5" $count + +# if error +exit diff --git a/011.out b/011.out new file mode 100644 index 000000000..546a4dbfe --- /dev/null +++ b/011.out @@ -0,0 +1,4 @@ +QA output created by 011 +*** TEST 1 -p 1 -n 1 -f +*** TEST 2 -p 5 -n 1 -f +*** TEST 3 -p 5 -n 5 -f diff --git a/012 b/012 new file mode 100755 index 000000000..83d997aa4 --- /dev/null +++ b/012 @@ -0,0 +1,131 @@ +#! /bin/sh +# XFS QA Test No. 012 +# $Id: 1.1 $ +# +# holes +# +#----------------------------------------------------------------------- +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 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. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +#----------------------------------------------------------------------- +# +# creator +owner=dxm@sgi.com + +seq=`basename $0` +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=0 # success is the default! +trap "rm -f $tmp.*; _cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + rm -rf $TEST_DIR/holes.$$.* +} + +_filesize() +{ + ls -l $1 | $AWK_PROG '{print " filesize = " $5}' +} + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +_do_test() +{ + _n="$1" + _param="$2" + _count="$3" + + failed=0 + + out=$TEST_DIR/holes.$$.$_n + echo "" + echo "holes.$_n : $_param" + echo "-----------------------------------------------" + if ! $here/src/holes $_param $out >$tmp.out + then + echo " holes returned $? - see $seq.out.full" + failed=1 + status=1 + fi + + + if [ $failed -eq 0 ] + then + # quick check - how many holes did we get? + count=`xfs_bmap $out | egrep -c ': hole'` + echo " $count hole(s) detected" + # and how big was the file? + _filesize $out + + if [ $count -ne $_count ] + then + echo " unexpected number of holes - see $seq.out.full" + status=1 + failed=1 + fi + fi + + if [ $failed -eq 1 ] + then + echo "--------------------------------------" >>$here/$seq.out.full + echo "$_n - output from holes:" >>$here/$seq.out.full + echo "--------------------------------------" >>$here/$seq.out.full + cat $tmp.out >>$here/$seq.out.full + echo "--------------------------------------" >>$here/$seq.out.full + echo "$_n - output from bmap:" >>$here/$seq.out.full + echo "--------------------------------------" >>$here/$seq.out.full + xfs_bmap -vvv $out >>$here/$seq.out.full + echo "--------------------------------------" >>$here/$seq.out.full + echo "$_n - output from ls -li:" >>$here/$seq.out.full + echo "--------------------------------------" >>$here/$seq.out.full + ls -li $out >>$here/$seq.out.full + status=1 + fi +} + +# real QA test starts here + +rm -f $here/$seq.out.full + +# small & fairly dense +_do_test 1 "-l 40960000 -b 40960 -i 10 -c 1" 100 + +# big & sparse +_do_test 2 "-l 409600000 -b 40960 -i 1000 -c 1" 10 + +# no holes, but a very nasty way to write a file (lots of extents) +_do_test 3 "-l 40960000 -b 40960 -i 10 -c 10" 0 + +exit diff --git a/012.out b/012.out new file mode 100644 index 000000000..6dc7ce86f --- /dev/null +++ b/012.out @@ -0,0 +1,16 @@ +QA output created by 012 + +holes.1 : -l 40960000 -b 40960 -i 10 -c 1 +----------------------------------------------- + 100 hole(s) detected + filesize = 40960000 + +holes.2 : -l 409600000 -b 40960 -i 1000 -c 1 +----------------------------------------------- + 10 hole(s) detected + filesize = 409600000 + +holes.3 : -l 40960000 -b 40960 -i 10 -c 10 +----------------------------------------------- + 0 hole(s) detected + filesize = 40960000 diff --git a/013 b/013 new file mode 100755 index 000000000..9de502896 --- /dev/null +++ b/013 @@ -0,0 +1,141 @@ +#! /bin/sh +# XFS QA Test No. 013 +# $Id: 1.1 $ +# +# fsstress +# +#----------------------------------------------------------------------- +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 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. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +#----------------------------------------------------------------------- +# +# creator +owner=dxm@sgi.com + +seq=`basename $0` +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=0 # success is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + # we might get here with a RO FS + mount -o remount,rw $TEST_DEV >/dev/null 2>&1 + # now kill! + rm -rf $TEST_DIR/fsstress.$$.* +} + +_filesize() +{ + ls -l $1 | $AWK_PROG '{print " filesize = " $5}' +} + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +_do_test() +{ + _n="$1" + _param="$2" + _count="$3" + + failed=0 + + out=$TEST_DIR/fsstress.$$.$_n + rm -rf $out + if ! mkdir $out + then + echo " failed to mkdir $out" + status=1 + exit + fi + + echo "" + echo "-----------------------------------------------" + echo "fsstress.$_n : $_param" + echo "-----------------------------------------------" + # -v >$tmp.out + if ! $here/src/fsstress $_param $FSSTRESS_AVOID -n $_count -d $out >/dev/null 2>&1 + then + echo " fsstress (count=$_count) returned $? - see $seq.full" + + echo "--------------------------------------" >>$here/$seq.full + echo "$_n - output from fsstress:" >>$here/$seq.full + echo "--------------------------------------" >>$here/$seq.full + echo "" >>$here/$seq.full + #cat $tmp.out >>$here/$seq.full + status=1 + fi + + _check_fs $TEST_DEV +} + + +# real QA test starts here + +rm -f $here/$seq.full +echo "berevity is wit..." + +count=1000 + +_check_fs $TEST_DEV + +# the default + +_do_test 1 "-r" $count + +# and the default with multiprocess + +_do_test 2 "-p 5 -r" $count + +# from Glen's notes + +_do_test 3 "-p 4 -z -f rmdir=10 -f link=10 -f creat=10 -f mkdir=10 -f rename=30 -f stat=30 -f unlink=30 -f truncate=20" $count + +exit + +# Test with error injection: +# +# (error injection) +# fsstress -n 1000 -d $scratch -p 4 -z -f rmdir=10 -f link=10 -f creat=10 \ +# -f mkdir=10 -f rename=30 -f stat=30 -f unlink=30 -f truncate=20 \ +# -e 1 +# +# Error values 1 - 6 test IFLUSH +# 1 - corrupt buffer being flushed to di_core.di_magic +# 2 - corrupt inode being flushed i_d.di_magic +# 3 - corrupt IFREG format check +# 4 - corrupt IFDIR format check +# 5 - corrupt i_d.di_nextents +# 6 - corrupt i_d.di_forkoff > sb_inodesize diff --git a/013.out b/013.out new file mode 100644 index 000000000..547369e15 --- /dev/null +++ b/013.out @@ -0,0 +1,14 @@ +QA output created by 013 +berevity is wit... + +----------------------------------------------- +fsstress.1 : -r +----------------------------------------------- + +----------------------------------------------- +fsstress.2 : -p 5 -r +----------------------------------------------- + +----------------------------------------------- +fsstress.3 : -p 4 -z -f rmdir=10 -f link=10 -f creat=10 -f mkdir=10 -f rename=30 -f stat=30 -f unlink=30 -f truncate=20 +----------------------------------------------- diff --git a/014 b/014 new file mode 100755 index 000000000..2c8949e7e --- /dev/null +++ b/014 @@ -0,0 +1,73 @@ +#! /bin/sh +# XFS QA Test No. 014 +# $Id: 1.1 $ +# +# truncfile +# +#----------------------------------------------------------------------- +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 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. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +#----------------------------------------------------------------------- +# +# creator +owner=dxm@sgi.com + +seq=`basename $0` +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=0 # success is the default! +trap "rm -f $tmp.*; _cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + rm -rf $TEST_DIR/truncfile.$$.* +} + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + + +echo "berevity is wit..." + +echo "------" +echo "test 1" +echo "------" +if ! src/truncfile -c 10000 $TEST_DIR/truncfile.$$.0 >$tmp.out 2>&1 +then + out=`cat $tmp.out` + echo "truncfile returned $? : \"$out\"" +else + echo "OK" +fi + +exit diff --git a/014.out b/014.out new file mode 100644 index 000000000..960fcb057 --- /dev/null +++ b/014.out @@ -0,0 +1,6 @@ +QA output created by 014 +berevity is wit... +------ +test 1 +------ +OK diff --git a/015 b/015 new file mode 100755 index 000000000..cec13809b --- /dev/null +++ b/015 @@ -0,0 +1,135 @@ +#! /bin/sh +# XFS QA Test No. 015 +# $Id: 1.1 $ +# +# check out-of-space behaviour +# +#----------------------------------------------------------------------- +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 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. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +#----------------------------------------------------------------------- +# +# creator +owner=dxm@sgi.com + +seq=`basename $0` +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # success is the default! + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +_cleanup() +{ + umount $SCRATCH_MNT +} + +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_free() +{ + _df_dir $TEST_DIR | $AWK_PROG '{ print $5 }' +} + +_filter_dd() +{ + $AWK_PROG ' + /records in/ { next } + /records out/ { next } + /No space left on device/ { print " !!! disk full (expected)" + next } + { print " *** " $0 } + ' +} + +# real QA test starts here +_require_scratch + +mkfs -t xfs -f -d size=50m $SCRATCH_DEV >/dev/null +mount -t xfs $SCRATCH_DEV $SCRATCH_MNT +out=$SCRATCH_MNT/fillup.$$ + +free0=`_free` +if [ -z "$free0" ] +then + echo " *** failed to get free space (0)" + exit 1 +fi + +echo "fill disk:" # well, filesystem really - not disk + +dd if=/dev/zero of=$out bs=1024k 2>&1 | _filter_dd + +if [ ! -e $out ] +then + echo " *** file not created" + exit 1 +fi + +if [ ! -s $out ] +then + echo " *** file created with zero length" + ls -l $out + exit 1 +fi + +echo "delete fill:" + +if ! rm $out +then + echo " *** file not deleted" + exit 1 +fi + +if [ -e $out ] +then + echo " *** file still exists" + ls -l $out + exit 1 +fi + +echo "check free space:" + +free1=`_free` +if [ -z "$free1" ] +then + echo " *** failed to get free space (1)" + exit 1 +fi + +echo -n " !!! " +_within_tolerance "free space" $free1 $free0 1% -v + +status=0 +exit diff --git a/015.out b/015.out new file mode 100644 index 000000000..d2c5ae68e --- /dev/null +++ b/015.out @@ -0,0 +1,6 @@ +QA output created by 015 +fill disk: + !!! disk full (expected) +delete fill: +check free space: + !!! free space is in range diff --git a/016 b/016 new file mode 100755 index 000000000..904348356 --- /dev/null +++ b/016 @@ -0,0 +1,206 @@ +#! /bin/sh +# XFS QA Test No. 016 +# $Id: 1.1 $ +# +# test end of log overwrite bug #796141 +# +#----------------------------------------------------------------------- +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 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. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +#----------------------------------------------------------------------- +# +# creator +owner=dxm@sgi.com + +# +# pv 796141 +# +# create a new FS, mostly fill the log. Then wrap the log back to the +# start bit by bit to force wiping of stale blocks near the end of the +# log. Check the block after the log ends to check for corruption +# +# assumptions : +# - given we're only touching a single inode, the block after the +# log which is in the middle ag should never be touched. +# if it changes, we assume the log is writing over it +# + +seq=`basename $0` +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 + +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + echo "*** unmount" + umount $SCRATCH_MNT 2>/dev/null +} + +_block_filter() +{ + sed -e 's/[0-9][0-9]*\.\.[0-9][0-9]*/BLOCKRANGE/g' +} + +_init() +{ + echo "*** reset partition" + $here/src/devzero -b 2048 -n 50 -v 198 $SCRATCH_DEV + echo "*** mkfs" + if ! mkfs -t xfs -f -d size=50m -l size=512b $SCRATCH_DEV >$tmp.out 2>&1 + then + cat $tmp.out + echo "failed to mkfs $SCRATCH_DEV" + exit 1 + fi +} + +_log_traffic() +{ + count=$1 + echo "*** generate log traffic" + + out=$SCRATCH_MNT/$$.tmp + + echo " *** mount" + if ! mount $SCRATCH_DEV $SCRATCH_MNT -t xfs + then + echo "failed to mount $SCRATCH_DEV" + exit 1 + fi + + # having quota enabled means extra log traffic - evil! + $here/src/feature -u $SCRATCH_DEV && _notrun "User quota are enabled" + $here/src/feature -g $SCRATCH_DEV && _notrun "Group quota are enabled" + + echo " *** fiddle" + while [ $count -ge 0 ] + do + touch $out + rm $out + let "count = count - 1" + done + + echo " *** unmount" + if ! umount $SCRATCH_DEV + then + echo "failed to unmount $SCRATCH_DEV" + exit 1 + fi +} + +_log_size() +{ + xfs_logprint -tb $SCRATCH_DEV | $AWK_PROG ' + /log device/ { print $7} + ' +} + +_log_head() +{ + xfs_logprint -tb $SCRATCH_DEV | $AWK_PROG ' + /head:/ { print $5 } + ' +} + +_after_log() +{ + xfs_db -r $1 -c "sb" -c "print" | $AWK_PROG ' + /logstart/ { logstart = $3 } + /logblocks/ { logblocks = $3 } + END { + print logstart + logblocks + } + ' +} + +_check_corrupt() +{ + f="c6c6c6c6" + echo "*** check for corruption" + echo "expect $f..." >>$seq.full + xfs_db -r $1 -c "fsblock $2" -c "print" | head | tee -a $seq.full | \ + grep -q -v "$f $f $f $f $f $f $f $f" && \ + _fail "!!! block $2 corrupted!" +} + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +# real QA test starts here + +rm -f $seq.full + +_require_scratch +_init + +block=`_after_log $SCRATCH_DEV` +echo "fsblock after log = $block" >>$seq.full +_check_corrupt $SCRATCH_DEV $block + +size=`_log_size` +echo "log size = $size BB" >>$seq.full +head=`_log_head` +echo "log position = $head" >>$seq.full + +[ $size -eq 4096 ] || \ + _fail "!!! unexpected log size $size" +[ $head -eq 2 ] || \ + _fail "!!! unexpected initial log position $head" + +echo " lots of traffic" >>$seq.full +_log_traffic 850 +head=`_log_head` +echo "log position = $head" >>$seq.full + +[ $head -gt 3850 -a $head -lt 4050 ] || \ + _fail "!!! unexpected log position $head" + +for c in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +do + echo " little traffic" >>$seq.full + _log_traffic 2 + head=`_log_head` + echo "log position = $head" >>$seq.full + _check_corrupt $SCRATCH_DEV $block +done + +[ $head -lt 1000 ] || \ + _fail "!!! unexpected log position $head" + + +# happy exit +rm $seq.full +status=0 +exit 0 diff --git a/016.out b/016.out new file mode 100644 index 000000000..f4f9a6768 --- /dev/null +++ b/016.out @@ -0,0 +1,115 @@ +QA output created by 016 +*** reset partition +Wrote 51200.00Kb (value 0xc6) +*** mkfs +*** check for corruption +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** check for corruption +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** check for corruption +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** check for corruption +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** check for corruption +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** check for corruption +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** check for corruption +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** check for corruption +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** check for corruption +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** check for corruption +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** check for corruption +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** check for corruption +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** check for corruption +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** check for corruption +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** check for corruption +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** check for corruption +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** check for corruption +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** check for corruption +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** check for corruption +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** check for corruption +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** check for corruption +*** generate log traffic + *** mount + *** fiddle + *** unmount +*** check for corruption +*** unmount diff --git a/017 b/017 new file mode 100755 index 000000000..0ae535365 --- /dev/null +++ b/017 @@ -0,0 +1,109 @@ +#! /bin/sh +# XFS QA Test No. 017 +# $Id: 1.1 $ +# +# test remount ro - pv 795642 +# +#----------------------------------------------------------------------- +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 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. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +#----------------------------------------------------------------------- +# +# creator +owner=dxm@sgi.com + +seq=`basename $0` +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 + +_cleanup() +{ + echo "*** unmount" + umount $SCRATCH_MNT 2>/dev/null +} +trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15 + +_clean_log() +{ + echo "" >>$seq.full + echo "*** xfs_logprint ***" >>$seq.full + echo "" >>$seq.full + xfs_logprint -tb $1 | tee -a $seq.full \ + | head | grep -q "" || _fail "DIRTY LOG" +} + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +# real QA test starts here + +_require_scratch + +echo "*** init FS" + +rm -f $seq.full +umount $SCRATCH_DEV >/dev/null 2>&1 +echo "*** MKFS ***" >>$seq.full +echo "" >>$seq.full +mkfs -t xfs -f $SCRATCH_DEV >>$seq.full 2>&1 \ + || _fail "mkfs failed" +mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full 2>&1 \ + || _fail "mount failed" + +echo "*** test" + +for l in 0 1 2 3 4 +do + echo " *** test $l" + src/fsstress -d $SCRATCH_MNT -n 1000 $FSSTRESS_AVOID >>$seq.full + + mount -o remount,ro $SCRATCH_DEV \ + || _fail "remount ro failed" + + _clean_log $SCRATCH_DEV + + echo "" >>$seq.full + echo "*** XFS_CHECK ***" >>$seq.full + echo "" >>$seq.full + xfs_check $SCRATCH_DEV >>$seq.full 2>&1 \ + || _fail "xfs_check failed" + mount -o remount,rw $SCRATCH_DEV \ + || _fail "remount rw failed" +done + +echo "*** done" +# happy exit +rm -f $seq.full +status=0 +exit 0 diff --git a/017.out b/017.out new file mode 100644 index 000000000..2d11c9492 --- /dev/null +++ b/017.out @@ -0,0 +1,10 @@ +QA output created by 017 +*** init FS +*** test + *** test 0 + *** test 1 + *** test 2 + *** test 3 + *** test 4 +*** done +*** unmount diff --git a/018 b/018 new file mode 100755 index 000000000..fd02e4dc1 --- /dev/null +++ b/018 @@ -0,0 +1,143 @@ +#! /bin/sh +# XFS QA Test No. 018 +# $Id: 1.1 $ +# +# xfs_logprint test +# +#----------------------------------------------------------------------- +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 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. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +#----------------------------------------------------------------------- +# +# creator +owner=dxm@sgi.com + +seq=`basename $0` +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=0 # success is the default! + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +_cleanup() +{ + echo "*** unmount" + umount $SCRATCH_MNT 2>/dev/null +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_full() +{ + echo "" >>$seq.full + echo "*** $* ***" >>$seq.full + echo "" >>$seq.full +} + +_clean_log() +{ + _full "clean_log : xfs_logprint" + xfs_logprint -t $1 | tee -a $seq.full \ + | head | grep -q "" || _fail "DIRTY LOG" +} + +_filter_logprint() +{ + sed ' + s/data device: 0x[0-9a-f][0-9a-f]*/data device: /; + s/log device: 0x[0-9a-f][0-9a-f]*/log device: /; + s/daddr: [0-9][0-9]*/daddr: /; + s/length: [0-9][0-9]*/length: /; + s/length: [0-9][0-9]*/length: /; + s/^cycle num overwrites: .*$/cycle num overwrites: /; + s/tid: [0-9a-f][0-9a-f]*/tid: /; + s/tid:0x[0-9a-f][0-9a-f]*/tid:/; + s/q:0x[0-9a-f][0-9a-f]*/q:/; + s/a:0x[0-9a-f][0-9a-f]*/a:/g; + s/blkno:0x[0-9a-f][0-9a-f]*/blkno:/g; + s/blkno: [0-9][0-9]* (0x[0-9a-f]*)/blkno: ()/g; + s/blkno: [0-9][0-9]*/blkno: /g; + s/boff: [0-9][0-9]*/boff: /g; + s/len: *[0-9][0-9]*/len:/g; + s/skipped [0-9][0-9]* zeroed blocks/skipped zeroed blocks/; + s/atime:[0-9a-fx]* *mtime:[0-9a-fx]* *ctime:[0-9a-fx]*/atime: