]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/pybind/test_rados.py: test test_operate_aio_write_op() 31158/head
authorzhangjiao <zhangjiao@cmss.chinamobile.com>
Fri, 25 Oct 2019 10:28:13 +0000 (18:28 +0800)
committerzhangjiao <zhangjiao@cmss.chinamobile.com>
Tue, 12 Nov 2019 06:04:41 +0000 (14:04 +0800)
Signed-off-by: Zhang Jiao <zhangjiao@cmss.chinamobile.com>
src/test/pybind/test_rados.py

index 60dc2deefa24c9fc1077a6e1f30360ebf2005719..5c4162894227c3d8a50e8f423f898a1e2efe5070 100644 (file)
@@ -598,6 +598,24 @@ class TestIoctx(object):
         eq(objects, [])
         self.ioctx.set_locator_key("")
 
+    def test_operate_aio_write_op(self):
+        lock = threading.Condition()
+        count = [0]
+        def cb(blah):
+            with lock:
+                count[0] += 1
+                lock.notify()
+            return 0
+        with WriteOpCtx() as write_op:
+            write_op.write(b'rzx')
+            comp = self.ioctx.operate_aio_write_op(write_op, "object", cb, cb)
+            comp.wait_for_complete()
+            with lock:
+                while count[0] < 2:
+                    lock.wait()
+            eq(comp.get_return_value(), 0)
+            eq(self.ioctx.read('object'), b'rzx')
+
     def test_aio_write(self):
         lock = threading.Condition()
         count = [0]