Skip to contentSkip to conversation

test: dbus: make stripe size page-size aware

PATCH New Yunye Zhao 1 participant 1 message Nov 19

lore
Share & tools
lore

Yunye Zhao

author
#0 lore raw

PATCH 1/1 test: dbus: make stripe size page-size aware

From: YunyeZhao <[email protected]>

The hardcoded 8 KiB stripe size is rejected by lvcreate on 64K page kernels (aarch64+64k, ppc64le), failing test_lv_create_striped and
test_lv_create_raid: STRIPE_SIZE_MIN is the page size, and MD RAID 4/5/6/10 requires chunk >= PAGE_SIZE. Use max(8, page_size_kib) so the tests work on all page sizes.

---
 test/dbus/lvmdbustest.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
test/dbus/lvmdbustest.py +4 -2
index facd4877b..b29372348 100755
@@ -32,6 +32,8 @@ g_lvm_shell = False
 # Approx. min size
 VDO_MIN_SIZE = mib(8192)
 
+STRIPE_SIZE_KB = max(8, os.sysconf('SC_PAGE_SIZE') // 1024)
+
 VG_TEST_SUFFIX = "_vg_LvMdBuS_TEST"
 
 EXE_NAME = "/lvmdbusd"
@@ -1008,7 +1010,7 @@ class TestDbusService(unittest.TestCase):
 		lv = self._test_lv_create(
 			vg.LvCreateStriped,
 			(dbus.String(lv_name), dbus.UInt64(mib(4)),
-				dbus.UInt32(2), dbus.UInt32(8), dbus.Boolean(False),
+				dbus.UInt32(2), dbus.UInt32(STRIPE_SIZE_KB), dbus.Boolean(False),
 				dbus.Int32(g_tmo), EOD), vg, LV_BASE_INT)
 		self._validate_lookup("%s/%s" % (vg.Name, lv_name), lv.object_path)
 
@@ -1027,7 +1029,7 @@ class TestDbusService(unittest.TestCase):
 		lv = self._test_lv_create(
 			vg.LvCreateRaid,
 			(dbus.String(lv_name), dbus.String('raid5'), dbus.UInt64(mib(16)),
-				dbus.UInt32(2), dbus.UInt32(8), dbus.Int32(g_tmo), EOD),
+				dbus.UInt32(2), dbus.UInt32(STRIPE_SIZE_KB), dbus.Int32(g_tmo), EOD),
 			vg, LV_BASE_INT)
 		self._validate_lookup("%s/%s" % (vg.Name, lv_name), lv.object_path)
 
Signature · 1 line
2.19.1.6.gb485710b