summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2021-03-24 15:52:14 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2021-03-24 16:38:12 +0100
commit0783c661b9eb407b0b436559b6950deefc906b4f (patch)
tree3509fd638c24f8e4ce9a46b7d7c212d063139b1c
parent2151b71819ffd45e71f2565aa2c0d2cb9685e2c0 (diff)
downloadlvm2-0783c661b9eb407b0b436559b6950deefc906b4f.tar.gz
tests: handle case of missing /dev/disk
In case there is no symlink - udev can optimize /dev/disk away, thus find would fail in teardown.
-rw-r--r--test/lib/aux.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index f81d03e88..6c43790b7 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -581,7 +581,9 @@ teardown() {
}
# Remove any dangling symlink in /dev/disk (our tests can confuse udev)
- find /dev/disk -type l ! -exec test -e {} \; -print | xargs rm -f
+ test -d /dev/disk && {
+ find /dev/disk -type l ! -exec test -e {} \; -print | xargs rm -f || true
+ }
# Remove any metadata archives and backups from this test on system
rm -f /etc/lvm/archive/${PREFIX}* /etc/lvm/backup/${PREFIX}*