From: zhangjiao Date: Sun, 20 Oct 2019 15:01:32 +0000 (+0800) Subject: test/pybind/test_rados.py: test test_aio_remove X-Git-Tag: v15.1.0~1194^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F31003%2Fhead;p=ceph.git test/pybind/test_rados.py: test test_aio_remove Signed-off-by: Zhang Jiao --- diff --git a/src/test/pybind/test_rados.py b/src/test/pybind/test_rados.py index 8d65942f4a8d..60dc2deefa24 100644 --- a/src/test/pybind/test_rados.py +++ b/src/test/pybind/test_rados.py @@ -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