From 37368624f302195f70bed876ff6481b2dad3ccff Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Fri, 14 Sep 2018 11:32:30 +0900 Subject: [PATCH] ut/bdev_raid: Fix the failure for single base bdev case For single base bdev case, IO is changed not to be split. However UT code was not changed together. Change-Id: I81e66b256892b7bee7a42c72bb0bce6d3320b617 Signed-off-by: Shuhei Matsumoto Reviewed-on: https://review.gerrithub.io/425534 Tested-by: SPDK CI Jenkins Chandler-Test-Pool: SPDK Automated Test System Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- test/unit/lib/bdev/bdev_raid.c/bdev_raid_ut.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/unit/lib/bdev/bdev_raid.c/bdev_raid_ut.c b/test/unit/lib/bdev/bdev_raid.c/bdev_raid_ut.c index 7994ec5e2d..60c5c3abeb 100644 --- a/test/unit/lib/bdev/bdev_raid.c/bdev_raid_ut.c +++ b/test/unit/lib/bdev/bdev_raid.c/bdev_raid_ut.c @@ -881,8 +881,13 @@ verify_raid_bdev(struct rpc_construct_raid_bdev *r, bool presence, uint32_t raid CU_ASSERT(strcmp(pbdev->bdev.product_name, "Pooled Device") == 0); CU_ASSERT(pbdev->bdev.write_cache == 0); CU_ASSERT(pbdev->bdev.blocklen == g_block_len); - CU_ASSERT(pbdev->bdev.optimal_io_boundary == pbdev->strip_size); - CU_ASSERT(pbdev->bdev.split_on_optimal_io_boundary == true); + if (pbdev->num_base_bdevs > 1) { + CU_ASSERT(pbdev->bdev.optimal_io_boundary == pbdev->strip_size); + CU_ASSERT(pbdev->bdev.split_on_optimal_io_boundary == true); + } else { + CU_ASSERT(pbdev->bdev.optimal_io_boundary == 0); + CU_ASSERT(pbdev->bdev.split_on_optimal_io_boundary == false); + } CU_ASSERT(pbdev->bdev.ctxt == pbdev); CU_ASSERT(pbdev->bdev.fn_table == &g_raid_bdev_fn_table); CU_ASSERT(pbdev->bdev.module == &g_raid_if);