From 0b11b08b6e9cd15eeaf1f591c2a3ddd2b8d2d98e Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 13 Oct 2023 14:59:42 +0200 Subject: [PATCH] tests: handle empty table better --- test/lib/inittest.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/lib/inittest.sh b/test/lib/inittest.sh index 4dbbb35de..dca20e1ac 100644 --- a/test/lib/inittest.sh +++ b/test/lib/inittest.sh @@ -82,9 +82,11 @@ PREFIX="${COMMON_PREFIX}$$" # Check we are not conflickting with some exiting setup if test -z "$SKIP_ROOT_DM_CHECK" ; then d=$(dmsetup info -c -o name --noheadings --rows -S "suspended=Suspended||name=~${PREFIX}[^0-9]") - test "$d" = "No devices found" || { - die "DM table already has either suspended or $PREFIX prefixed devices: $d" - } + case "$d" in + "No devices found") ;; + "") ;; + *) die "DM table already has either suspended or $PREFIX prefixed devices: $d" ;; + esac fi test -n "$LVM_TEST_DIR" || LVM_TEST_DIR=${TMPDIR:-/tmp}