From 620e7e155916a0246399b10b56e5f004e3145be8 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Mon, 3 Mar 2025 17:59:35 +0100 Subject: [PATCH] test/pybind/rbd: fix read offset in write zeroes tests Random data is written and write zeroes is invoked on 0~256, but the read is done on 256~256. This means that if write zeroes malfunctions the test wouldn't catch it (especially in the thick provision case). Signed-off-by: Ilya Dryomov (cherry picked from commit d41f0fa01f59a8d056dc28934b92212c78a05a62) --- src/test/pybind/test_rbd.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/pybind/test_rbd.py b/src/test/pybind/test_rbd.py index 0ae389d2354b1..d3fbb4415532f 100644 --- a/src/test/pybind/test_rbd.py +++ b/src/test/pybind/test_rbd.py @@ -692,14 +692,14 @@ class TestImage(object): data = rand_data(256) self.image.write(data, 0) self.image.write_zeroes(0, 256) - eq(self.image.read(256, 256), b'\0' * 256) + eq(self.image.read(0, 256), b'\0' * 256) check_diff(self.image, 0, IMG_SIZE, None, 0, []) def test_write_zeroes_thick_provision(self): data = rand_data(256) self.image.write(data, 0) self.image.write_zeroes(0, 256, RBD_WRITE_ZEROES_FLAG_THICK_PROVISION) - eq(self.image.read(256, 256), b'\0' * 256) + eq(self.image.read(0, 256), b'\0' * 256) check_diff(self.image, 0, IMG_SIZE, None, 0, [(0, 256, True)]) def test_read(self): @@ -1602,7 +1602,7 @@ class TestImage(object): eq(retval[0], 0) eq(comp.get_return_value(), 0) eq(sys.getrefcount(comp), 2) - eq(self.image.read(256, 256), b'\0' * 256) + eq(self.image.read(0, 256), b'\0' * 256) def test_aio_flush(self): retval = [None] -- 2.39.5