From 61917fbac2302e1f0c56aa75437e6ea72834b30d Mon Sep 17 00:00:00 2001 From: Tony Asleson Date: Tue, 29 Nov 2022 09:57:20 -0600 Subject: [PATCH] lvmdbustest: Add test to ensure error collection Recreates https://bugzilla.redhat.com/show_bug.cgi?id=2145114 --- test/dbus/lvmdbustest.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/dbus/lvmdbustest.py b/test/dbus/lvmdbustest.py index 9582fe674..c07963525 100755 --- a/test/dbus/lvmdbustest.py +++ b/test/dbus/lvmdbustest.py @@ -2468,6 +2468,27 @@ class TestDbusService(unittest.TestCase): if rc == "/": self._pv_create(pv_device_path) + def test_stderr_collection(self): + lv_name = lv_n() + vg = self._vg_create().Vg + (object_path, job_path) = vg.LvCreate( + dbus.String(lv_name), dbus.UInt64(vg.SizeBytes * 2), + dbus.Array([], signature='(ott)'), dbus.Int32(0), + EOD) + + self.assertTrue(object_path == '/') + self.assertTrue(job_path != '/') + + j = ClientProxy(self.bus, job_path, interfaces=(JOB_INT,)).Job + while True: + j.update() + if j.Complete: + (ec, error_msg) = j.GetError + self.assertTrue("insufficient free space" in error_msg, error_msg) + break + else: + time.sleep(0.1) + class AggregateResults(object): -- 2.43.5