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

tests: try to retry remove of scsi_debug

Not quite sure if this helps anything, some of testing
machines can't reliably remove scsi_debug, reporting
they are in use - but it's not easily reproducible...
This commit is contained in:
Zdenek Kabelac 2023-04-24 15:26:40 +02:00
parent b8aea8ae7d
commit e42b56c31b

View File

@ -457,7 +457,12 @@ teardown_devs() {
# prepare_scsi_debug_dev() also sets LOOP to short-circuit prepare_loop()
if test -f SCSI_DEBUG_DEV; then
udev_wait
test "${LVM_TEST_PARALLEL:-0}" -eq 1 || modprobe -r scsi_debug
test "${LVM_TEST_PARALLEL:-0}" -eq 1 || {
if ! modprobe -r scsi_debug ; then
sleep 1
modprobe -r scsi_debug || true
fi
}
else
test ! -f LOOP || losetup -d "$(< LOOP)" || true
test ! -f LOOPFILE || rm -f "$(< LOOPFILE)"