From 64353ff74b56c71b508fd040a45062facb395bae Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 7 Apr 2015 13:40:15 +0200 Subject: [PATCH] tests: when test fails collect more info In some case it might be worth to know some more surrouding info when command has crashed. So collect tables and some udev db content in this case. --- test/lib/utils.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/lib/utils.sh b/test/lib/utils.sh index 2f7dc65b3..401a86240 100644 --- a/test/lib/utils.sh +++ b/test/lib/utils.sh @@ -130,6 +130,21 @@ STACKTRACE() { test -z "$LVM_TEST_NODEBUG" -a -f debug.log && { sed -e "s,^,## DEBUG: ,;s,$top_srcdir/\?,," < debug.log test -e strace.log && sed -e "s,^,## STRACE: ,;s,$top_srcdir/\?,," < strace.log + echo "========= Info ===========" + dmsetup info -c | grep "$PREFIX" + echo "========= Active table ===========" + dmsetup table | grep "$PREFIX" + echo "======== Inactive table ==========" + dmsetup table --inactive | grep "$PREFIX" + echo "======== Status ==========" + dmsetup status | grep "$PREFIX" + echo "======== Tree ==========" + dmsetup ls --tree + echo "======== Recursive list of $DM_DEV_DIR ==========" + ls -Rla "$DM_DEV_DIR" + for i in "/sys/block/dm-* /sys/block/loop*" ; do + udevadm info --export-db "$i" || true + done } test -f SKIP_THIS_TEST && exit 200