[prev in list] [next in list] [prev in thread] [next in thread]
List: lvm2-commits
Subject: =?utf-8?q?=5Blvm2-commits=5D?= main - tests: add aux remove_dm_devs
From: Zdenek Kabelac <zkabelac () sourceware ! org>
Date: 2021-03-28 12:23:20
Message-ID: 20210328122320.5F7B03858D33 () sourceware ! org
[Download RAW message or body]
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d9b97510324e7c16cf8ec61f511b6f5d71bff767
Commit: d9b97510324e7c16cf8ec61f511b6f5d71bff767
Parent: 0ddbc4c5cdbef0cc57b79c164b22b34c0bc6a27a
Author: Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate: Sun Mar 28 13:29:44 2021 +0200
Committer: Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Sun Mar 28 14:22:11 2021 +0200
tests: add aux remove_dm_devs
Add function to remove DM devices and dies
if some device can't be removed.
---
test/lib/aux.sh | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 38191842d..6177de4d4 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -1110,6 +1110,28 @@ enable_dev() {
finish_udev_transaction
}
+# Try to remove list of DM device from table
+remove_dm_devs() {
+ local remove=( "$@" )
+ local held
+ local i
+
+ for i in {1..50}; do
+ held=()
+ for d in "${remove[@]}" ; do
+ dmsetup remove "$d" 2>/dev/null || {
+ dmsetup info -c "$d" 2>/dev/null && {
+ held+=( "$d" )
+ dmsetup status "$d"
+ }
+ }
+ done
+ test ${#held[@]} -eq 0 && return
+ remove=( "${held[@]}" )
+ done
+ die "Can't remove device(s) ${held[@]}"
+}
+
# Throttle down performance of kcopyd when mirroring i.e. disk image
throttle_sys="/sys/module/dm_mirror/parameters/raid1_resync_throttle"
throttle_dm_mirror() {
_______________________________________________
lvm2-commits mailing list -- lvm2-commits@lists.fedorahosted.org
To unsubscribe send an email to lvm2-commits-leave@lists.fedorahosted.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedorahosted.org/archives/list/lvm2-commits@lists.fedorahosted.org
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic