diff options
author | Tony Asleson <tasleson@redhat.com> | 2022-11-29 09:57:20 -0600 |
---|---|---|
committer | Tony Asleson <tasleson@redhat.com> | 2022-11-29 12:56:55 -0600 |
commit | 61917fbac2302e1f0c56aa75437e6ea72834b30d (patch) | |
tree | 2c20ee3948ff8c1c068ba0fca87b505aa860c493 | |
parent | a02268e93800c0390650cbf12061b705acfc2196 (diff) | |
download | lvm2-61917fbac2302e1f0c56aa75437e6ea72834b30d.tar.gz |
lvmdbustest: Add test to ensure error collection
Recreates https://bugzilla.redhat.com/show_bug.cgi?id=2145114
-rwxr-xr-x | test/dbus/lvmdbustest.py | 21 |
1 files changed, 21 insertions, 0 deletions
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): |