1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

lvmdbustest.py: Add unit test for external PV create

Ensure a PV created outside of the dbus service is immediately found by
service user.
This commit is contained in:
Tony Asleson 2017-03-08 15:52:48 -06:00
parent e06e4d9355
commit 28754145d8

View File

@ -1760,6 +1760,24 @@ class TestDbusService(unittest.TestCase):
cmd = ['lvcreate', '-L4M', '-n', lv_name, vg.Name]
self._verify_existence(cmd, cmd[0], full_name)
def test_external_pv_create(self):
# Lets create a PV outside of service and see if we correctly handle
# it's inclusion
target = self.objs[PV_INT][0]
# Remove the PV
rc = self._pv_remove(target)
self.assertTrue(rc == '/')
self._check_consistency()
# Make sure the PV we removed no longer exists
self.assertTrue(self._lookup(target.Pv.Name) == '/')
# Add it back with external command line
cmd = ['pvcreate', target.Pv.Name]
self._verify_existence(cmd, cmd[0], target.Pv.Name)
class AggregateResults(object):
def __init__(self):