]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/pybind/test_rados.py: test test_aio_remove 31003/head
authorzhangjiao <zhangjiao@cmss.chinamobile.com>
Sun, 20 Oct 2019 15:01:32 +0000 (23:01 +0800)
committerzhangjiao <zhangjiao@cmss.chinamobile.com>
Tue, 22 Oct 2019 09:43:13 +0000 (17:43 +0800)
Signed-off-by: Zhang Jiao <zhangjiao@cmss.chinamobile.com>
src/test/pybind/test_rados.py

index 8d65942f4a8da8dd1431d165ed1b027871f514a1..60dc2deefa24c9fc1077a6e1f30360ebf2005719 100644 (file)
@@ -701,6 +701,24 @@ class TestIoctx(object):
 
         [i.remove() for i in self.ioctx.list_objects()]
 
+    def test_aio_remove(self):
+        lock = threading.Condition()
+        count = [0]
+        def cb(blah):
+            with lock:
+                count[0] += 1
+                lock.notify()
+            return 0
+        self.ioctx.write('foo', b'wrx')
+        eq(self.ioctx.read('foo'), b'wrx')
+        comp = self.ioctx.aio_remove('foo', cb, cb)
+        comp.wait_for_complete()
+        with lock:
+            while count[0] < 2:
+                lock.wait()
+        eq(comp.get_return_value(), 0)
+        eq(list(self.ioctx.list_objects()), [])
+
     def _take_down_acting_set(self, pool, objectname):
         # find acting_set for pool:objectname and take it down; used to
         # verify that async reads don't complete while acting set is missing