]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/pybind: test aio_cmpext() 32169/head
authorzhangjiao <zhangjiao@cmss.chinamobile.com>
Wed, 11 Dec 2019 08:15:27 +0000 (16:15 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 29 Aug 2020 13:43:27 +0000 (21:43 +0800)
Signed-off-by: Zhang Jiao <zhangjiao@cmss.chinamobile.com>
src/test/pybind/test_rados.py

index 46630d8f8a7dd7afbd8d26ed494f613f2d69d1e4..7507b29b6407759c712691e99515b1f03c9f4931 100644 (file)
@@ -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]