From 28754145d8cdad50bfa003fb13fc46af1cbadae8 Mon Sep 17 00:00:00 2001 From: Tony Asleson Date: Wed, 8 Mar 2017 15:52:48 -0600 Subject: [PATCH] lvmdbustest.py: Add unit test for external PV create Ensure a PV created outside of the dbus service is immediately found by service user. --- test/dbus/lvmdbustest.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/dbus/lvmdbustest.py b/test/dbus/lvmdbustest.py index c2ac7dffe..2a65466b9 100755 --- a/test/dbus/lvmdbustest.py +++ b/test/dbus/lvmdbustest.py @@ -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): -- 2.43.5