All of lore.kernel.org
 help / color / mirror / Atom feed
* main - tests: handle case of missing /dev/disk
@ 2021-03-24 15:41 Zdenek Kabelac
  0 siblings, 0 replies; only message in thread
From: Zdenek Kabelac @ 2021-03-24 15:41 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=0783c661b9eb407b0b436559b6950deefc906b4f
Commit:        0783c661b9eb407b0b436559b6950deefc906b4f
Parent:        2151b71819ffd45e71f2565aa2c0d2cb9685e2c0
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Wed Mar 24 15:52:14 2021 +0100
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Wed Mar 24 16:38:12 2021 +0100

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}*



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-24 15:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-24 15:41 main - tests: handle case of missing /dev/disk Zdenek Kabelac

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.