From 8d09e9a0d0220b98af753e120c1f40bb89464bff Mon Sep 17 00:00:00 2001 From: zhangjiao Date: Sun, 20 Oct 2019 23:01:32 +0800 Subject: [PATCH] test/pybind/test_rados.py: test test_aio_remove Signed-off-by: Zhang Jiao --- src/test/pybind/test_rados.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/test/pybind/test_rados.py b/src/test/pybind/test_rados.py index 8d65942f4a8..60dc2deefa2 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 -- 2.47.3