Files
apfstests/tests/xfs/199
T
Dave Chinner 8c4905a42e xfstests: introduce a common directory
Introduce a top level common directory and move all the common.*
files into it.  Because there is now a directory named common, the
prefix can be dropped from all the files. Convert all the tests to
use this new directory for including common files.

for f in common.*; do \
	git mv `echo -n "$f " ; echo $f | sed -e 's;n\.;n/;'` \
done

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
[rjohnston@sgi.com reworked for TOT changes]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
2013-03-26 21:44:05 -05:00

94 lines
2.5 KiB
Bash
Executable File

#! /bin/bash
# FS QA Test No. 199
#
# Check that the features2 location fixups work correctly. We check both
# a regular read-write mount of a filesystem and the case where the
# filesystem is first mounted read-only and then later remounted read-write,
# which is the usual case for the root filesystem.
#
#-----------------------------------------------------------------------
# Copyright (c) 2008 Christoph Hellwig.
#
# 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
seqres=$RESULT_DIR/$seq
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
{
cd /
umount $SCRATCH_MNT >/dev/null 2>&1
}
trap "_cleanup; exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
. ./common/filter
# real QA test starts here
_supported_fs xfs
_supported_os Linux
_require_scratch
_scratch_mkfs_xfs -l lazy-count=1 >/dev/null 2>&1
#
# Print the current flags. Just a dummy so that the test breaks
# in an obvious way when the default feature flags changed in mkfs
#
echo "Default feature2 flags:"
xfs_db -x $SCRATCH_DEV -c 'sb' -c 'print features2'
xfs_db -x $SCRATCH_DEV -c 'sb' -c 'print bad_features2'
#
# Now clear the normal flags
#
echo "Clearing features2:"
xfs_db -x $SCRATCH_DEV -c 'sb' -c 'write features2 0'
_scratch_mount
umount $SCRATCH_MNT
echo "Features 2 after mount rw:"
xfs_db -x $SCRATCH_DEV -c 'sb' -c 'print features2'
#
# Clear the normal flags again for the second rount.
#
echo "Clearing features2:"
xfs_db -x $SCRATCH_DEV -c 'sb' -c 'write features2 0'
#
# And print the flags after a mount ro and remount rw
#
_scratch_mount -o ro
_scratch_mount -o remount,rw
umount $SCRATCH_MNT
echo "Features 2 after mount ro and remount rw:"
xfs_db -x $SCRATCH_DEV -c 'sb' -c 'print features2'
# success, all done
echo "*** done"
rm -f $seqres.full
status=0