[ -z "$FSCK_OPTIONS" ] && _fsck_opts
-# we need common.config
+# we need common/config
if [ "$iam" != "check" ]
then
if ! . ./common/config
then
- echo "$iam: failed to source common.config"
+ echo "$iam: failed to source common/config"
exit 1
fi
fi
if [ $mkfs_status -ne 0 -a ! -z "$extra_mkfs_options" ]; then
echo "** mkfs failed with extra mkfs options added to \"$MKFS_OPTIONS\" by test $seq **" \
- >>$RESULT_DIR/$seq.full
+ >>$seqres.full
echo "** attempting to mkfs using only test $seq options: $extra_mkfs_options **" \
- >>$RESULT_DIR/$seq.full
+ >>$seqres.full
# running mkfs again. overwrite previous mkfs output files
$MKFS_XFS_PROG $SCRATCH_OPTIONS $extra_mkfs_options $SCRATCH_DEV \
2>$tmp_dir.mkfserr 1>$tmp_dir.mkfsstd
fi
}
-# Do a command, log it to $RESULT_DIR/$seq.full, optionally test return status
+# Do a command, log it to $seqres.full, optionally test return status
# and die if command fails. If called with one argument _do executes the
# command, logs it, and returns its exit status. With two arguments _do
# first prints the message passed in the first argument, and then "done"
# second argument. If the command fails and the variable _do_die_on_error
# is set to "always" or the two argument form is used and _do_die_on_error
# is set to "message_only" _do will print an error message to
-# $RESULT_DIR/$seq.out and exit.
+# $seqres.out and exit.
_do()
{
status=1; exit
fi
- (eval "echo '---' \"$_cmd\"") >>$RESULT_DIR/$seq.full
+ (eval "echo '---' \"$_cmd\"") >>$seqres.full
(eval "$_cmd") >$tmp._out 2>&1; ret=$?
- cat $tmp._out | _fix_malloc >>$RESULT_DIR/$seq.full
+ cat $tmp._out | _fix_malloc >>$seqres.full
if [ $# -eq 2 ]; then
if [ $ret -eq 0 ]; then
echo "done"
-o \( $# -eq 2 -a "$_do_die_on_error" = "message_only" \) ]
then
[ $# -ne 2 ] && echo
- eval "echo \"$_cmd\" failed \(returned $ret\): see $RESULT_DIR/$seq.full"
+ eval "echo \"$_cmd\" failed \(returned $ret\): see $seqres.full"
status=1; exit
fi
#
_notrun()
{
- echo "$*" > $RESULT_DIR/$seq.notrun
+ echo "$*" > $seqres.notrun
echo "$seq not run: $*"
status=0
exit
#
_fail()
{
- echo "$*" | tee -a $RESULT_DIR/$seq.full
- echo "(see $RESULT_DIR/$seq.full for details)"
+ echo "$*" | tee -a $seqres.full
+ echo "(see $seqres.full for details)"
status=1
exit 1
}
fsck -t $FSTYP $FSCK_OPTIONS $device >$tmp.fsck 2>&1
if [ $? -ne 0 ]
then
- echo "_check_generic_filesystem: filesystem on $device is inconsistent (see $RESULT_DIR/$seq.full)"
+ echo "_check_generic_filesystem: filesystem on $device is inconsistent (see $seqres.full)"
- echo "_check_generic filesystem: filesystem on $device is inconsistent" >>$RESULT_DIR/$seq.full
- echo "*** fsck.$FSTYP output ***" >>$RESULT_DIR/$seq.full
- cat $tmp.fsck >>$RESULT_DIR/$seq.full
- echo "*** end fsck.$FSTYP output" >>$RESULT_DIR/$seq.full
+ echo "_check_generic filesystem: filesystem on $device is inconsistent" >>$seqres.full
+ echo "*** fsck.$FSTYP output ***" >>$seqres.full
+ cat $tmp.fsck >>$seqres.full
+ echo "*** end fsck.$FSTYP output" >>$seqres.full
ok=0
fi
if [ $ok -eq 0 ]
then
- echo "*** mount output ***" >>$RESULT_DIR/$seq.full
- _mount >>$RESULT_DIR/$seq.full
- echo "*** end mount output" >>$RESULT_DIR/$seq.full
+ echo "*** mount output ***" >>$seqres.full
+ _mount >>$seqres.full
+ echo "*** end mount output" >>$seqres.full
elif [ "$type" = "$FSTYP" ]
then
# was mounted ...
| tee $tmp.logprint | grep -q "<CLEAN>"
if [ $? -ne 0 -a "$HOSTOS" = "Linux" ]
then
- echo "_check_xfs_filesystem: filesystem on $device has dirty log (see $RESULT_DIR/$seq.full)"
+ echo "_check_xfs_filesystem: filesystem on $device has dirty log (see $seqres.full)"
- echo "_check_xfs_filesystem: filesystem on $device has dirty log" >>$RESULT_DIR/$seq.full
- echo "*** xfs_logprint -t output ***" >>$RESULT_DIR/$seq.full
- cat $tmp.logprint >>$RESULT_DIR/$seq.full
- echo "*** end xfs_logprint output" >>$RESULT_DIR/$seq.full
+ echo "_check_xfs_filesystem: filesystem on $device has dirty log" >>$seqres.full
+ echo "*** xfs_logprint -t output ***" >>$seqres.full
+ cat $tmp.logprint >>$seqres.full
+ echo "*** end xfs_logprint output" >>$seqres.full
ok=0
fi
fi
if [ -s $tmp.fs_check ]
then
- echo "_check_xfs_filesystem: filesystem on $device is inconsistent (c) (see $RESULT_DIR/$seq.full)"
+ echo "_check_xfs_filesystem: filesystem on $device is inconsistent (c) (see $seqres.full)"
- echo "_check_xfs_filesystem: filesystem on $device is inconsistent" >>$RESULT_DIR/$seq.full
- echo "*** xfs_check output ***" >>$RESULT_DIR/$seq.full
- cat $tmp.fs_check >>$RESULT_DIR/$seq.full
- echo "*** end xfs_check output" >>$RESULT_DIR/$seq.full
+ echo "_check_xfs_filesystem: filesystem on $device is inconsistent" >>$seqres.full
+ echo "*** xfs_check output ***" >>$seqres.full
+ cat $tmp.fs_check >>$seqres.full
+ echo "*** end xfs_check output" >>$seqres.full
ok=0
fi
$XFS_REPAIR_PROG -n $extra_log_options $extra_rt_options $device >$tmp.repair 2>&1
if [ $? -ne 0 ]
then
- echo "_check_xfs_filesystem: filesystem on $device is inconsistent (r) (see $RESULT_DIR/$seq.full)"
+ echo "_check_xfs_filesystem: filesystem on $device is inconsistent (r) (see $seqres.full)"
- echo "_check_xfs_filesystem: filesystem on $device is inconsistent" >>$RESULT_DIR/$seq.full
- echo "*** xfs_repair -n output ***" >>$RESULT_DIR/$seq.full
- cat $tmp.repair | _fix_malloc >>$RESULT_DIR/$seq.full
- echo "*** end xfs_repair output" >>$RESULT_DIR/$seq.full
+ echo "_check_xfs_filesystem: filesystem on $device is inconsistent" >>$seqres.full
+ echo "*** xfs_repair -n output ***" >>$seqres.full
+ cat $tmp.repair | _fix_malloc >>$seqres.full
+ echo "*** end xfs_repair output" >>$seqres.full
ok=0
fi
if [ $ok -eq 0 ]
then
- echo "*** mount output ***" >>$RESULT_DIR/$seq.full
- _mount >>$RESULT_DIR/$seq.full
- echo "*** end mount output" >>$RESULT_DIR/$seq.full
+ echo "*** mount output ***" >>$seqres.full
+ _mount >>$seqres.full
+ echo "*** end mount output" >>$seqres.full
elif [ "$type" = "xfs" ]
then
_mount_or_remount_rw "$extra_mount_options" $device $mountpoint
OPT_ARG="-lastvalidblock $LAST_BLOCK"
fi
- rm -f $RESULT_DIR/$seq.checkfs
+ rm -f $seqres.checkfs
sleep 1 # Due to a problem with time stamps in udf_test
- $here/src/udf_test $OPT_ARG $device | tee $RESULT_DIR/$seq.checkfs | egrep "Error|Warning" | \
+ $here/src/udf_test $OPT_ARG $device | tee $seqres.checkfs | egrep "Error|Warning" | \
_udf_test_known_error_filter | \
egrep -iv "Error count:.*[0-9]+.*total occurrences:.*[0-9]+|Warning count:.*[0-9]+.*total occurrences:.*[0-9]+" | \
- sed "s/^.*$/Warning UDF Verifier reported errors see $RESULT_DIR/$seq.checkfs./g"
+ sed "s/^.*$/Warning UDF Verifier reported errors see $seqres.checkfs./g"
}
btrfsck $device >$tmp.fsck 2>&1
if [ $? -ne 0 ]
then
- echo "_check_btrfs_filesystem: filesystem on $device is inconsistent (see $RESULT_DIR/$seq.full)"
+ echo "_check_btrfs_filesystem: filesystem on $device is inconsistent (see $seqres.full)"
- echo "_check_btrfs_filesystem: filesystem on $device is inconsistent" >>$RESULT_DIR/$seq.full
- echo "*** fsck.$FSTYP output ***" >>$RESULT_DIR/$seq.full
- cat $tmp.fsck >>$RESULT_DIR/$seq.full
- echo "*** end fsck.$FSTYP output" >>$RESULT_DIR/$seq.full
+ echo "_check_btrfs_filesystem: filesystem on $device is inconsistent" >>$seqres.full
+ echo "*** fsck.$FSTYP output ***" >>$seqres.full
+ cat $tmp.fsck >>$seqres.full
+ echo "*** end fsck.$FSTYP output" >>$seqres.full
ok=0
fi
if [ $ok -eq 0 ]
then
- echo "*** mount output ***" >>$RESULT_DIR/$seq.full
- _mount >>$RESULT_DIR/$seq.full
- echo "*** end mount output" >>$RESULT_DIR/$seq.full
+ echo "*** mount output ***" >>$seqres.full
+ _mount >>$seqres.full
+ echo "*** end mount output" >>$seqres.full
elif [ "$type" = "$FSTYP" ]
then
# was mounted ...
run_check()
{
- echo "# $@" >> $RESULT_DIR/$seq.full 2>&1
- "$@" >> $RESULT_DIR/$seq.full 2>&1 || _fail "failed: '$@'"
+ echo "# $@" >> $seqres.full 2>&1
+ "$@" >> $seqres.full 2>&1 || _fail "failed: '$@'"
}
################################################################################
if [ "$TEST_DEV" = "" ]
then
- echo "common.rc: Error: \$TEST_DEV is not set"
+ echo "common/rc: Error: \$TEST_DEV is not set"
exit 1
fi
# $TEST_DEV is not mounted
if ! _test_mount
then
- echo "common.rc: retrying test device mount with external set"
+ echo "common/rc: retrying test device mount with external set"
[ "$USE_EXTERNAL" != "yes" ] && export USE_EXTERNAL=yes
if ! _test_mount
then
- echo "common.rc: could not mount $TEST_DEV on $TEST_DIR"
+ echo "common/rc: could not mount $TEST_DEV on $TEST_DIR"
exit 1
fi
fi
if [ "`_fs_type $TEST_DEV`" != "$FSTYP" ]
then
- echo "common.rc: Error: \$TEST_DEV ($TEST_DEV) is not a MOUNTED $FSTYP filesystem"
+ echo "common/rc: Error: \$TEST_DEV ($TEST_DEV) is not a MOUNTED $FSTYP filesystem"
$DF_PROG $TEST_DEV
exit 1
fi