common/config: create $RESULT_BASE before dumping kmemleak leaks
[xfstests-dev.git] / common / config
index 2f1f2720677604f8be15408320484dfb51dc027f..0f153412bcdc09ffd245a3251fb778ed5b537258 100644 (file)
@@ -170,6 +170,7 @@ export WIPEFS_PROG="$(type -P wipefs)"
 export DUMP_PROG="$(type -P dump)"
 export RESTORE_PROG="$(type -P restore)"
 export LVM_PROG="$(type -P lvm)"
+export LSATTR_PROG="$(type -P lsattr)"
 export CHATTR_PROG="$(type -P chattr)"
 export DEBUGFS_PROG="$(type -P debugfs)"
 export UUIDGEN_PROG="$(type -P uuidgen)"
@@ -456,8 +457,9 @@ _check_device()
        fi
 
        case "$FSTYP" in
-       9p)
+       9p|tmpfs)
                # 9p mount tags are just plain strings, so anything is allowed
+               # tmpfs doesn't use mount source, ignore
                ;;
        overlay)
                if [ ! -d "$dev" ]; then
@@ -530,7 +532,7 @@ _overlay_config_override()
        [ -b "$TEST_DEV" ] || return 0
 
        # Config file may specify base fs type, but we obay -overlay flag
-       export OVL_BASE_FSTYP="$FSTYP"
+       [ "$FSTYP" == overlay ] || export OVL_BASE_FSTYP="$FSTYP"
        export FSTYP=overlay
 
        # Store original base fs vars
@@ -655,6 +657,20 @@ get_next_config() {
        # set default RESULT_BASE
        if [ -z "$RESULT_BASE" ]; then
                export RESULT_BASE="$here/results/"
+               mkdir -p ${RESULT_BASE}
+               if [ ! -d ${RESULT_BASE} ]; then
+                       echo "failed to create results directory $RESULT_BASE"
+                       exit 1
+               fi
+       fi
+
+       if [ "$FSTYP" == "tmpfs" ]; then
+               if [ -z "TEST_DEV" ]; then
+                       export TEST_DEV=tmpfs_test
+               fi
+               if [ -z "SCRATCH_DEV" ]; then
+                       export TEST_DEV=tmpfs_scratch
+               fi
        fi
 
        #  Mandatory Config values.