From: Karel Zak Date: Tue, 26 Jan 2021 09:30:01 +0000 (+0100) Subject: tests: dump more information about CFS and block devices X-Git-Tag: v2.37-rc1~160 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf7e7d5c84d951cdfa183c597153db916c053547;p=thirdparty%2Futil-linux.git tests: dump more information about CFS and block devices Signed-off-by: Karel Zak --- diff --git a/tests/functions.sh b/tests/functions.sh index 3206ebf738..148496a584 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()