1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

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.
This commit is contained in:
Zdenek Kabelac 2021-03-24 15:52:14 +01:00
parent 2151b71819
commit 0783c661b9

View File

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