]> sourceware.org Git - lvm2.git/commitdiff
test: improve aux teardown 1002475168
authorZdenek Kabelac <zkabelac@redhat.com>
Tue, 12 Sep 2023 22:39:33 +0000 (00:39 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 13 Sep 2023 11:38:15 +0000 (13:38 +0200)
Handle the case of device teardown where the first pass
could have only a single, but opened device, for removal.
In such case we want to at least once go through
the udev_wait and retry removal again.

TODO: maybe a sleep .1  might be usable as well with udev_wait

test/lib/aux.sh

index 307150f2da4b6758ac976208b282cb41685e6169..166928d27bdb54d7e95019f8df40e21672d2b1dc 100644 (file)
@@ -239,8 +239,8 @@ prepare_lvmpolld() {
        echo $! > LOCAL_LVMPOLLD
        for i in {200..0} ; do
                test -e "$TESTDIR/lvmpolld.socket" && break
-               echo -n .;
-               sleep .1;
+               echo -n .
+               sleep .1
        done # wait for the socket
        test "$i" -gt 0 || die "Startup of lvmpolld is too slow."
        echo ok
@@ -401,10 +401,10 @@ teardown_devs_prefixed() {
        # 2nd. loop is trying --force removal which can possibly 'unstuck' some bloked operations
        for i in 0 1; do
                test "$i" = 1 && test "$stray" = 0 && break  # no stray device removal
+               local progress=1
 
                while :; do
                        local sortby="name"
-                       local progress=0
 
                        # HACK: sort also by minors - so we try to close 'possibly later' created device first
                        test "$i" = 0 || sortby="-minor"
@@ -432,6 +432,7 @@ teardown_devs_prefixed() {
 
                        udev_wait
                        wait
+                       progress=0
                done # looping till there are some removed devices
        done
 }
This page took 0.03956 seconds and 5 git commands to generate.