From ba313ac84a7bc27ce69d225dec1bfc80bcb20988 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 8 Nov 2019 13:12:31 +0100 Subject: [PATCH] tests: skip unneeded status check If 'remove' was succesful - we can break loop immediatelly. --- test/shell/pvmove-restart.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/shell/pvmove-restart.sh b/test/shell/pvmove-restart.sh index 115ce1499..16691878a 100644 --- a/test/shell/pvmove-restart.sh +++ b/test/shell/pvmove-restart.sh @@ -51,12 +51,11 @@ wait # First take down $lv1 then it's pvmove0 j=0 for i in $lv1 pvmove0 pvmove0_mimage_0 pvmove0_mimage_1 ; do - while dmsetup status "$vg-$i"; do - dmsetup remove "$vg-$i" || { - j=$(( j + 1 )) - test $j -le 100 || die "Cannot take down devices." - sleep .1; - } + while dmsetup status "$vg-$i" ; do + dmsetup remove "$vg-$i" && break + j=$(( j + 1 )) + test $j -le 100 || die "Cannot take down devices." + sleep .1; done done dmsetup table | grep $PREFIX -- 2.43.5