From: Ruediger Meier Date: Thu, 15 May 2014 14:27:28 +0000 (+0200) Subject: tests: ts_mount validates error message X-Git-Tag: v2.25-rc1~127^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a23c435ea263f26b07a2274116253a31aa802a1e;p=thirdparty%2Futil-linux.git tests: ts_mount validates error message Skip only if mount reports a non-empty fs which is not available in /proc/filesystems. Signed-off-by: Ruediger Meier --- diff --git a/tests/functions.sh b/tests/functions.sh index a1ed3ad221..cc3dc054aa 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -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 }