From bf7e7d5c84d951cdfa183c597153db916c053547 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 26 Jan 2021 10:30:01 +0100 Subject: [PATCH] tests: dump more information about CFS and block devices Signed-off-by: Karel Zak --- tests/functions.sh | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/tests/functions.sh b/tests/functions.sh index 3206ebf73..148496a58 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -691,15 +691,41 @@ function ts_fstype_by_devname { return $? } +function ts_vfs_dump { + if [ "$TS_SHOWDIFF" == "yes" -a "$TS_KNOWN_FAIL" != "yes" ]; then + echo + echo "{{{{ VFS dump:" + findmnt + echo "}}}}" + fi +} + +function ts_blk_dump { + if [ "$TS_SHOWDIFF" == "yes" -a "$TS_KNOWN_FAIL" != "yes" ]; then + echo + echo "{{{{ blkdevs dump:" + lsblk -o+FSTYPE + echo "}}}}" + fi +} + function ts_device_has { local TAG="$1" local VAL="$2" local DEV="$3" local vl="" + local res="" vl=$(ts_blkidtag_by_devname "$TAG" "$DEV") test $? = 0 -a "$vl" = "$VAL" - return $? + res=$? + + if [ "$res" != 0 ]; then + ts_vfs_dump + ts_blk_dump + fi + + return $res } function ts_is_uuid()