exit 1
fi
-# Autodetect fs type based on what's on $TEST_DEV unless it's been set
-# externally
-if [ -z "$FSTYP" -a "$HOSTOS" == "Linux" ]; then
- FSTYP=`blkid -c /dev/null -s TYPE -o value $TEST_DEV`
-fi
-FSTYP=${FSTYP:=xfs}
-export FSTYP
-
SUPPORTED_TESTS="[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]"
SRC_GROUPS="generic shared"
export SRC_DIR="tests"
-T output timestamps
-r randomize test order
--large-fs optimise scratch device for large filesystems
+ -s section run only specified section from config file
testlist options
-g group[,group...] include tests from these groups
-x group[,group...] exclude tests from these groups
-X file exclude individual tests
+ -E external_file exclude individual tests
[testlist] include tests matching names in testlist
'
exit 0
_wallclock()
{
- date "+%H %M %S" | $AWK_PROG '{ print $1*3600 + $2*60 + $3 }'
+ date "+%s"
}
_timestamp()
done
done
;;
-
+ -E) xfile=$2; shift ;
+ if [ -f $xfile ]; then
+ cat "$xfile" >> $tmp.xlist
+ fi
+ ;;
+ -s) RUN_SECTION="$RUN_SECTION $2"; shift ;;
-l) diff="diff" ;;
-udiff) diff="$diff -u" ;;
done
fi
-_prepare_test_list
-
# we need common/rc
if ! . ./common/rc
then
rm -f $tmp.*
}
+_prepare_test_list
+
if $OPTIONS_HAVE_SECTIONS; then
trap "_summary; exit \$status" 0 1 2 3 15
else
fi
for section in $HOST_OPTIONS_SECTIONS; do
+ OLD_FSTYP=$FSTYP
+ OLD_MOUNT_OPTIONS=$MOUNT_OPTIONS
get_next_config $section
- init_rc
+
+ # Do we need to run only some sections ?
+ if [ ! -z "$RUN_SECTION" ]; then
+ skip=true
+ for s in $RUN_SECTION; do
+ if [ $section == $s ]; then
+ skip=false
+ fi
+ done
+ if $skip; then
+ continue
+ fi
+ fi
mkdir -p $RESULT_BASE
if [ ! -d $RESULT_BASE ]; then
- echo "failed to create results directory $RESULTS_BASE"
+ echo "failed to create results directory $RESULT_BASE"
exit 1;
fi
+ if $OPTIONS_HAVE_SECTIONS; then
+ echo "SECTION -- $section"
+ fi
+
+ if $RECREATE_TEST_DEV || [ "$OLD_FSTYP" != "$FSTYP" ]; then
+ echo "RECREATING -- $FSTYP on $TEST_DEV"
+ umount $TEST_DEV 2> /dev/null
+ if ! _test_mkfs >$tmp.err 2>&1
+ then
+ echo "our local _test_mkfs routine ..."
+ cat $tmp.err
+ echo "check: failed to mkfs \$TEST_DEV using specified options"
+ exit 1
+ fi
+ out=`_mount_or_remount_rw "$MOUNT_OPTIONS" $TEST_DEV $TEST_DIR`
+ if [ $? -ne 1 ]; then
+ echo $out
+ exit 1
+ fi
+ _prepare_test_list
+ elif [ "$OLD_MOUNT_OPTIONS" != "$MOUNT_OPTIONS" ]; then
+ umount $TEST_DEV 2> /dev/null
+ out=`_mount_or_remount_rw "$MOUNT_OPTIONS" $TEST_DEV $TEST_DIR`
+ if [ $? -ne 1 ]; then
+ echo $out
+ exit 1
+ fi
+ fi
+
+ init_rc
+
seq="check"
check="$RESULT_BASE/check"
[ -f $check.time ] || touch $check.time
# print out our test configuration
- if $OPTIONS_HAVE_SECTIONS; then
- echo "SECTION -- $section"
- fi
echo "FSTYP -- `_full_fstyp_details`"
echo "PLATFORM -- `_full_platform_details`"
if [ ! -z "$SCRATCH_DEV" ]; then
done
_wrapup
echo
+
+ umount $TEST_DEV 2> /dev/null
+ umount $SCRATCH_DEV 2> /dev/null
done
interrupt=false