Skip to contentSkip to conversation

stable-2.02 - tests: add settle wait before issue remove

PATCH Zdenek Kabelac 1 participant 1 message Jul 5, 2019

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2f846697fcb16b2e0954a051577bd47c8cf6721c
Commit:        2f846697fcb16b2e0954a051577bd47c8cf6721c
Parent:        cff9bff0afc21d9593dd6585bbd375384fdf47be
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Thu Jul 4 16:58:27 2019 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Sat Jul 6 01:24:28 2019 +0200

tests: add settle wait before issue remove

Some older BB with older cryptsetup tool do not 'retry' on remove and when remove is issued right after 'fsck' - it might be rejected with:

Device @PREFIX at -tcrypt2 is busy.

Try to use udevadm settle.

---
 test/shell/fsadm-crypt.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
test/shell/fsadm-crypt.sh +1 -0
index 9377e89..4b8fc4e 100644
@@ -83,6 +83,7 @@ export LVM_BINARY
 test ! -d "$mount_dir" && mkdir "$mount_dir"
 
 crypt_close() {
+	aux udev_wait
 	cryptsetup remove "$1"
 	if [ "$?" -eq 0 -a -n "$DROP_SYMLINK" ]; then
 		rm -f "$DM_DEV_DIR/mapper/$1"