rm -f $tmp.list $tmp.tmp $tmp.grep $here/$iam.out $tmp.xlist
-# we need common/config
-if ! . ./common/config
-then
- echo "$iam: failed to source common/config"
- exit 1
-fi
-
SRC_GROUPS="generic shared"
export SRC_DIR="tests"
check options
-nfs test NFS
-cifs test CIFS
+ -overlay test overlay
-tmpfs test TMPFS
-l line mode diff
-udiff show unified diff (default)
-d dump test output to stdout
--large-fs optimise scratch device for large filesystems
-s section run only specified section from config file
+ -S section exclude the specified section from the config file
testlist options
-g group[,group...] include tests from these groups
grp=$1
for d in $SRC_GROUPS $FSTYP; do
+ if ! test -d "$SRC_DIR/$d" ; then
+ continue
+ fi
l=$(sed -n < $SRC_DIR/$d/group \
-e 's/#.*//' \
-e 's/$/ /' \
{
touch $tmp.list
for d in $SRC_GROUPS $FSTYP; do
+ if ! test -d "$SRC_DIR/$d" ; then
+ continue
+ fi
ls $SRC_DIR/$d/* | \
grep -v "\..*" | \
grep "^$SRC_DIR/$d/$VALID_TEST_NAME"| \
case "$1" in
-\? | -h | --help) usage ;;
- -nfs) FSTYP=nfs ;;
- -cifs) FSTYP=cifs ;;
- -tmpfs) FSTYP=tmpfs ;;
+ -nfs) FSTYP=nfs ;;
+ -cifs) FSTYP=cifs ;;
+ -overlay) FSTYP=overlay ;;
+ -tmpfs) FSTYP=tmpfs ;;
-g) group=$2 ; shift ;
GROUP_LIST="$GROUP_LIST ${group//,/ }"
fi
;;
-s) RUN_SECTION="$RUN_SECTION $2"; shift ;;
+ -S) EXCLUDE_SECTION="$EXCLUDE_SECTION $2"; shift ;;
-l) diff="diff" ;;
-udiff) diff="$diff -u" ;;
shift
done
+# we need common/config, source it after processing args, overlay needs FSTYP
+# set before sourcing common/config
+if ! . ./common/config; then
+ echo "$iam: failed to source common/config"
+ exit 1
+fi
+
# Process tests from command line now.
if $have_test_arg; then
while [ $# -gt 0 ]; do
for s in $RUN_SECTION; do
if [ $section == $s ]; then
skip=false
+ break;
+ fi
+ done
+ if $skip; then
+ continue
+ fi
+ fi
+
+ # Did this section get excluded?
+ if [ ! -z "$EXCLUDE_SECTION" ]; then
+ skip=false
+ for s in $EXCLUDE_SECTION; do
+ if [ $section == $s ]; then
+ skip=true
+ break;
fi
done
if $skip; then
if $RECREATE_TEST_DEV || [ "$OLD_FSTYP" != "$FSTYP" ]; then
echo "RECREATING -- $FSTYP on $TEST_DEV"
- umount $TEST_DEV 2> /dev/null
+ _test_unmount 2> /dev/null
if ! _test_mkfs >$tmp.err 2>&1
then
echo "our local _test_mkfs routine ..."
fi
_prepare_test_list
elif [ "$OLD_MOUNT_OPTIONS" != "$MOUNT_OPTIONS" ]; then
- umount $TEST_DEV 2> /dev/null
+ _test_unmount 2> /dev/null
out=`_mount_or_remount_rw "$MOUNT_OPTIONS" $TEST_DEV $TEST_DIR`
if [ $? -ne 1 ]; then
echo $out
needwrap=true
if [ ! -z "$SCRATCH_DEV" ]; then
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2> /dev/null
# call the overridden mkfs - make sure the FS is built
# the same as we'll create it later.
_wrapup
echo
- umount $TEST_DEV 2> /dev/null
- umount $SCRATCH_DEV 2> /dev/null
+ _test_unmount 2> /dev/null
+ _scratch_unmount 2> /dev/null
done
interrupt=false