summaryrefslogtreecommitdiffstats
path: root/tests/functions.sh
diff options
context:
space:
mode:
authorRuediger Meier2014-05-15 16:27:28 +0200
committerRuediger Meier2014-05-16 12:07:03 +0200
commita23c435ea263f26b07a2274116253a31aa802a1e (patch)
tree10392d4648304c146b804f321a8b975be180eb07 /tests/functions.sh
parenttests, add function ts_mount (diff)
downloadkernel-qcow2-util-linux-a23c435ea263f26b07a2274116253a31aa802a1e.tar.gz
kernel-qcow2-util-linux-a23c435ea263f26b07a2274116253a31aa802a1e.tar.xz
kernel-qcow2-util-linux-a23c435ea263f26b07a2274116253a31aa802a1e.zip
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 <ruediger.meier@ga-group.nl>
Diffstat (limited to 'tests/functions.sh')
-rw-r--r--tests/functions.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/functions.sh b/tests/functions.sh
index a1ed3ad22..cc3dc054a 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
}