summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Asleson <tasleson@redhat.com>2022-08-10 13:59:11 -0500
committerTony Asleson <tasleson@redhat.com>2022-09-16 10:49:36 -0500
commitcef3c75dd496961cf7f2d2509fd694b9edf28421 (patch)
tree85757893567a0052a89a5c43bcd82ce7910ad3ff
parent6b9cc7432ec70461217c081b5d38065236aec887 (diff)
downloadlvm2-cef3c75dd496961cf7f2d2509fd694b9edf28421.tar.gz
lvmdbustest: nesting improvements
-rwxr-xr-xtest/dbus/lvmdbustest.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/dbus/lvmdbustest.py b/test/dbus/lvmdbustest.py
index e7df238ce..4977021b1 100755
--- a/test/dbus/lvmdbustest.py
+++ b/test/dbus/lvmdbustest.py
@@ -1827,8 +1827,8 @@ class TestDbusService(unittest.TestCase):
cmd = ['pvcreate', target.Pv.Name]
self._verify_existence(cmd, cmd[0], target.Pv.Name)
- def _create_nested(self, pv_object_path):
- vg = self._vg_create([pv_object_path])
+ def _create_nested(self, pv_object_path, vg_suffix):
+ vg = self._vg_create([pv_object_path], vg_suffix)
pv = ClientProxy(self.bus, pv_object_path, interfaces=(PV_INT,))
self.assertEqual(pv.Pv.Vg, vg.object_path)
@@ -1838,8 +1838,12 @@ class TestDbusService(unittest.TestCase):
lv = self._create_lv(
vg=vg.Vg, size=vg.Vg.FreeBytes, suffix="_pv0")
device_path = '/dev/%s/%s' % (vg.Vg.Name, lv.LvCommon.Name)
+ dev_info = os.stat(device_path)
+ major = os.major(dev_info.st_rdev)
+ minor = os.minor(dev_info.st_rdev)
+ sysfs = "/sys/dev/block/%d:%d" % (major, minor)
+ self.assertTrue(os.path.exists(sysfs))
new_pv_object_path = self._pv_create(device_path)
-
vg.update()
self.assertEqual(lv.LvCommon.Vg, vg.object_path)
@@ -1870,7 +1874,7 @@ class TestDbusService(unittest.TestCase):
raise unittest.SkipTest('test not running in /dev')
for i in range(0, 5):
- pv_object_path = self._create_nested(pv_object_path)
+ pv_object_path = self._create_nested(pv_object_path, "nest_%d_" % i)
def test_pv_symlinks(self):
# Let's take one of our test PVs, pvremove it, find a symlink to it