mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
lvmdbustest: Add optional option to _create_num_lvs
This allows us to create the LVs async., thus queuing them up in daemon.
This commit is contained in:
parent
d05d2328e0
commit
52415b5708
@ -1288,24 +1288,28 @@ class TestDbusService(unittest.TestCase):
|
|||||||
vg_path = self._wait_for_job(vg_job)
|
vg_path = self._wait_for_job(vg_job)
|
||||||
self._validate_lookup(vg_name, vg_path)
|
self._validate_lookup(vg_name, vg_path)
|
||||||
|
|
||||||
def _create_num_lvs(self, num_lvs):
|
def _create_num_lvs(self, num_lvs, no_wait=False):
|
||||||
vg_proxy = self._vg_create(self._all_pv_object_paths())
|
vg_proxy = self._vg_create(self._all_pv_object_paths())
|
||||||
|
if no_wait:
|
||||||
|
tmo = 0
|
||||||
|
else:
|
||||||
|
tmo = g_tmo
|
||||||
|
|
||||||
for i in range(0, num_lvs):
|
for i in range(0, num_lvs):
|
||||||
lv_name = lv_n()
|
lv_name = lv_n()
|
||||||
vg_proxy.update()
|
vg_proxy.update()
|
||||||
if vg_proxy.Vg.FreeCount > 0:
|
if vg_proxy.Vg.FreeCount > 0:
|
||||||
lv_path = self.handle_return(
|
create_result = vg_proxy.Vg.LvCreateLinear(
|
||||||
vg_proxy.Vg.LvCreateLinear(
|
|
||||||
dbus.String(lv_name),
|
dbus.String(lv_name),
|
||||||
dbus.UInt64(mib(4)),
|
dbus.UInt64(mib(4)),
|
||||||
dbus.Boolean(False),
|
dbus.Boolean(False),
|
||||||
dbus.Int32(g_tmo),
|
dbus.Int32(tmo),
|
||||||
EOD))
|
EOD)
|
||||||
self.assertTrue(lv_path != '/')
|
|
||||||
self._validate_lookup(
|
|
||||||
"%s/%s" % (vg_proxy.Vg.Name, lv_name), lv_path)
|
|
||||||
|
|
||||||
|
if not no_wait:
|
||||||
|
lv_path = self.handle_return(create_result)
|
||||||
|
self.assertTrue(lv_path != '/')
|
||||||
|
self._validate_lookup("%s/%s" % (vg_proxy.Vg.Name, lv_name), lv_path)
|
||||||
else:
|
else:
|
||||||
# We ran out of space, test(s) may fail
|
# We ran out of space, test(s) may fail
|
||||||
break
|
break
|
||||||
|
Loading…
x
Reference in New Issue
Block a user