From 17c3c946026ee28eee2e8a18f0fdad44a5c31dea Mon Sep 17 00:00:00 2001 From: zhangjiao Date: Wed, 11 Dec 2019 16:15:27 +0800 Subject: [PATCH] test/pybind: test aio_cmpext() Signed-off-by: Zhang Jiao --- src/test/pybind/test_rados.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/test/pybind/test_rados.py b/src/test/pybind/test_rados.py index 46630d8f8a7dd..7507b29b64077 100644 --- a/src/test/pybind/test_rados.py +++ b/src/test/pybind/test_rados.py @@ -685,6 +685,23 @@ class TestIoctx(object): eq(contents, b"bar") [i.remove() for i in self.ioctx.list_objects()] + def test_aio_cmpext(self): + lock = threading.Condition() + count = [0] + def cb(blah): + with lock: + count[0] += 1 + lock.notify() + return 0 + + self.ioctx.write('test_object', b'abcdefghi') + comp = self.ioctx.aio_cmpext('test_object', b'abcdefghi', 0, cb) + comp.wait_for_complete() + with lock: + while count[0] < 1: + lock.wait() + eq(comp.get_return_value(), 0) + def test_aio_write_no_comp_ref(self): lock = threading.Condition() count = [0] -- 2.47.3