From: zhangjiao Date: Wed, 11 Dec 2019 08:15:27 +0000 (+0800) Subject: test/pybind: test aio_cmpext() X-Git-Tag: v16.1.0~1132^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=17c3c946026ee28eee2e8a18f0fdad44a5c31dea;p=ceph.git test/pybind: test aio_cmpext() Signed-off-by: Zhang Jiao --- diff --git a/src/test/pybind/test_rados.py b/src/test/pybind/test_rados.py index 46630d8f8a7d..7507b29b6407 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]