mirror of
https://github.com/ceph/ceph
synced 2025-02-24 03:27:10 +00:00
Merge pull request #31158 from zjcmszh/test_remove
test/pybind/test_rados.py: test test_operate_aio_write_op() Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
commit
aa62a162a0
@ -596,6 +596,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]
|
||||
|
Loading…
Reference in New Issue
Block a user