]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: ts_mount validates error message
authorRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 15 May 2014 14:27:28 +0000 (16:27 +0200)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Fri, 16 May 2014 10:07:03 +0000 (12:07 +0200)
Skip only if mount reports a non-empty fs which is not available
in /proc/filesystems.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests/functions.sh

index a1ed3ad221f7fdc968ed8dd95e03f507871f849a..cc3dc054aacd50708f0773aae1d17937eac470f3 100644 (file)
@@ -495,14 +495,20 @@ function ts_mount {
        local out
        local result
        local msg
+       local fs
 
        out=$($TS_CMD_MOUNT "$@" 2>&1)
        result=$?
        echo -n "$out" >> $TS_OUTPUT
 
-       if [ $result != 0 ]; then
-               msg=$(echo "$out" | grep -m1 "unknown filesystem type") \
-                       && ts_skip "$msg"
+       if [ $result != 0 ] \
+               && msg=$(echo "$out" | grep -m1 "unknown filesystem type")
+       then
+               # skip only if reported fs correctly and if it's not available
+               fs=$(echo "$msg" | sed -n "s/.*type '\(.*\)'$/\1/p")
+               [ -n "$fs" ] \
+                && grep -qe "[[:space:]]${fs}$" /proc/filesystems &>/dev/null \
+                || ts_skip "$msg"
        fi
        return $result
 }