From: Tony Asleson Date: Tue, 18 Dec 2018 18:43:57 +0000 (-0600) Subject: tests/dbus: Re-enable nesting and pvcreate via symlink X-Git-Tag: v2_03_03~211 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=a7034fa4200d63207daa45290150159dd02cf01f;p=lvm2.git tests/dbus: Re-enable nesting and pvcreate via symlink If we are running the test where the device is /dev/* we will will run the unit tests 'test_nesting' and 'test_pv_symlinks'. Otherwise we will skip them. --- diff --git a/test/dbus/lvmdbustest.py b/test/dbus/lvmdbustest.py index d633aa38a..9bc168334 100755 --- a/test/dbus/lvmdbustest.py +++ b/test/dbus/lvmdbustest.py @@ -1873,14 +1873,13 @@ class TestDbusService(unittest.TestCase): # when run from lvm2 testsuite. See dbustest.sh. pv_object_path = self.objs[PV_INT][0].object_path - if not pv_object_path.startswith("/dev"): - std_err_print('Skipping test not running in /dev') - return + if not self.objs[PV_INT][0].Pv.Name.startswith("/dev"): + raise unittest.SkipTest('test not running in /dev') for i in range(0, 5): pv_object_path = self._create_nested(pv_object_path) - def DISABLED_test_pv_symlinks(self): + def test_pv_symlinks(self): # Lets take one of our test PVs, pvremove it, find a symlink to it # and re-create using the symlink to ensure we return an object # path to it. Additionally, we will take the symlink and do a lookup @@ -1891,6 +1890,9 @@ class TestDbusService(unittest.TestCase): pv = self.objs[PV_INT][0] pv_device_path = pv.Pv.Name + if not pv_device_path.startswith("/dev"): + raise unittest.SkipTest('test not running in /dev') + self._pv_remove(pv) # Make sure we no longer find the pv