fstests: Make ./new work for non-root user
[xfstests-dev.git] / check
diff --git a/check b/check
index ee840115a14cf15b2e47f23a0cbefe759547c2cc..a8cb7289b3208c9d16dd0c50cbc5ae9ae24f0ccd 100755 (executable)
--- a/check
+++ b/check
@@ -331,10 +331,10 @@ while [ $# -gt 0 ]; do
        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"
+# we need common/rc, that also sources common/config. We need to source it
+# after processing args, overlay needs FSTYP set before sourcing common/config
+if ! . ./common/rc; then
+       echo "check: failed to source common/rc"
        exit 1
 fi
 
@@ -374,13 +374,6 @@ elif [ -z "$GROUP_LIST" ]; then
        GROUP_LIST="auto"
 fi
 
-# we need common/rc
-if ! . ./common/rc
-then
-    echo "check: failed to source common/rc"
-    exit 1
-fi
-
 if [ `id -u` -ne 0 ]
 then
     echo "check: QA must be run as root"
@@ -489,10 +482,14 @@ _check_filesystems()
        if [ -f ${RESULT_DIR}/require_test ]; then
                _check_test_fs || err=true
                rm -f ${RESULT_DIR}/require_test*
+       else
+               _test_unmount 2> /dev/null
        fi
        if [ -f ${RESULT_DIR}/require_scratch ]; then
                _check_scratch_fs || err=true
                rm -f ${RESULT_DIR}/require_scratch*
+       else
+               _scratch_unmount 2> /dev/null
        fi
 }
 
@@ -725,19 +722,16 @@ for section in $HOST_OPTIONS_SECTIONS; do
                        touch ${RESULT_DIR}/check_dmesg
                fi
                if [ "$DUMP_OUTPUT" = true ]; then
-                       ./$seq 2>&1 | tee $tmp.rawout
+                       ./$seq 2>&1 | tee $tmp.out
                        # Because $? would get tee's return code
                        sts=${PIPESTATUS[0]}
                else
-                       ./$seq >$tmp.rawout 2>&1
+                       ./$seq >$tmp.out 2>&1
                        sts=$?
                fi
                $timestamp && _timestamp
                stop=`_wallclock`
 
-               _fix_malloc <$tmp.rawout >$tmp.out
-               rm -f $tmp.rawout
-
                if [ -f core ]
                then
                    _err_msg="[dumped core]"