From 0783c661b9eb407b0b436559b6950deefc906b4f Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 24 Mar 2021 15:52:14 +0100 Subject: [PATCH] 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. --- test/lib/aux.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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}*