]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/pybind/test_rados.py: add test for reversed arguments offset,length in WriteOp...
authorWang Chao <sean10reborn@gmail.com>
Tue, 13 Aug 2024 13:34:12 +0000 (21:34 +0800)
committerWang Chao <sean10reborn@gmail.com>
Tue, 5 Nov 2024 16:17:19 +0000 (00:17 +0800)
Before the fix, zero(0, 2) would have no effect, and read would get '12345' instead of the expected '\x00\x00345'.

Signed-off-by: Wang Chao <sean10reborn@gmail.com>
src/test/pybind/test_rados.py

index cb2a4f9610109f71fe19d8c3aada034da51c0d4e..0288527c4f95ccfb88c69cd88c91b4c8139025cb 100644 (file)
@@ -515,6 +515,11 @@ class TestIoctx(object):
             self.ioctx.operate_write_op(write_op, "write_ops")
             eq(self.ioctx.read('write_ops'), b'12\x00\x005')
 
+            write_op.write_full(b'12345')
+            write_op.zero(0, 2)
+            self.ioctx.operate_write_op(write_op, "write_ops")
+            eq(self.ioctx.read('write_ops'), b'\x00\x00345')
+
             write_op.write_full(b'12345')
             write_op.truncate(2)
             self.ioctx.operate_write_op(write_op, "write_ops")