]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: dump more information about CFS and block devices
authorKarel Zak <kzak@redhat.com>
Tue, 26 Jan 2021 09:30:01 +0000 (10:30 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 26 Jan 2021 09:30:01 +0000 (10:30 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/functions.sh

index 3206ebf7381b49060c1817c5bfb1a2458665b6c0..148496a5842defcd15159c27f9fb470787893329 100644 (file)
@@ -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()