All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - aux: use unused brd device for testing
Date: Mon, 24 Apr 2023 22:14:33 +0000 (GMT)	[thread overview]
Message-ID: <20230424221433.EE42F3858D3C@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a51b6d5e4269ba4a5b335a3894873c750c2e8384
Commit:        a51b6d5e4269ba4a5b335a3894873c750c2e8384
Parent:        5e4c0701d9d37eaa46468319c4df8f221acd38b3
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Mon Apr 24 23:46:50 2023 +0200
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Tue Apr 25 00:12:31 2023 +0200

aux: use unused brd device for testing

When 'brd' device can be removed (is unused AKA not opened),
remove such device and use again for testing.

Let's assume user has no unused brd device left in the system.

When the 'tests' sometimes fail to cleanup devices, with this
change futher cleanup from some next test may evenually release
brd device and make it available for testing.
---
 test/lib/aux.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 8b04e1d30..b2660b65c 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -675,6 +675,9 @@ prepare_loop() {
 prepare_ramdisk() {
 	local size=$1
 
+	# if brd is unused, remove and use for test
+	modprobe -r brd || return 0
+
 	echo -n "## preparing ramdisk device..."
 	modprobe brd rd_size=$((size * 1024)) || return
 


                 reply	other threads:[~2023-04-24 22:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230424221433.EE42F3858D3C@sourceware.org \
    --to=zkabelac@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.