From: Tony Asleson <tasleson@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - lvmdbustest: Skip test_nesting if scan_lvs is not enabled
Date: Mon, 19 Sep 2022 15:58:24 +0000 (GMT) [thread overview]
Message-ID: <20220919155824.01EC63858281@sourceware.org> (raw)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f5876a1f3fb729d255ea0bc3974d2891381620b3
Commit: f5876a1f3fb729d255ea0bc3974d2891381620b3
Parent: e5c41b94b841abe1ce3c23c814f7f7c31048b6e8
Author: Tony Asleson <tasleson@redhat.com>
AuthorDate: Tue Aug 30 12:47:14 2022 -0500
Committer: Tony Asleson <tasleson@redhat.com>
CommitterDate: Fri Sep 16 10:49:37 2022 -0500
lvmdbustest: Skip test_nesting if scan_lvs is not enabled
---
test/dbus/lvmdbustest.py | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/test/dbus/lvmdbustest.py b/test/dbus/lvmdbustest.py
index 772313246..c932d0830 100755
--- a/test/dbus/lvmdbustest.py
+++ b/test/dbus/lvmdbustest.py
@@ -2040,6 +2040,17 @@ class TestDbusService(unittest.TestCase):
return new_pv_object_path
+ @staticmethod
+ def _scan_lvs_enabled():
+ cmd = ['lvmconfig', '--typeconfig', 'full', 'devices/scan_lvs']
+ config = Popen(cmd, stdout=PIPE, stderr=PIPE, close_fds=True, env=os.environ)
+ out = config.communicate()
+ if config.returncode != 0:
+ return False
+ if "scan_lvs=1" == out[0].decode("utf-8").strip():
+ return True
+ return False
+
def test_nesting(self):
# check to see if we handle an LV becoming a PV which has it's own
# LV
@@ -2053,6 +2064,8 @@ class TestDbusService(unittest.TestCase):
if dm_dev_dir != '/dev':
raise unittest.SkipTest('test not running in real /dev')
+ if not TestDbusService._scan_lvs_enabled():
+ raise unittest.SkipTest('scan_lvs=0 in config, unit test requires scan_lvs=1')
pv_object_path = self.objs[PV_INT][0].object_path
if not self.objs[PV_INT][0].Pv.Name.startswith("/dev"):
raise unittest.SkipTest('test not running in /dev')
reply other threads:[~2022-09-19 15:58 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=20220919155824.01EC63858281@sourceware.org \
--to=tasleson@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.