ut/bdev_raid: Remove raid_bdev_send_passthru dependent test
Cleverly, UT for raid bdev sets number of base bdevs by using the random number generator. When the random number generator outputs 1, test code especially for single base bdev case failed. When removing raid_bdev_send_passthru from library, the corresponding test code was not removed. This patch removes the test code. Change-Id: I23be88358fe364bc757979a26398b80339e19910 Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-on: https://review.gerrithub.io/424159 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Kunal Sablok <kunal.sablok@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
9b47c7e7cf
commit
8c5c2c56b9
@ -704,42 +704,33 @@ verify_io(struct spdk_bdev_io *bdev_io, uint8_t num_base_drives,
|
||||
SPDK_CU_ASSERT_FATAL(raid_bdev != NULL);
|
||||
SPDK_CU_ASSERT_FATAL(num_base_drives != 0);
|
||||
|
||||
if (raid_bdev->num_base_bdevs > 1) {
|
||||
CU_ASSERT(splits_reqd == g_io_output_index);
|
||||
for (strip = start_strip; strip <= end_strip; strip++, index++) {
|
||||
pd_strip = strip / num_base_drives;
|
||||
pd_idx = strip % num_base_drives;
|
||||
if (strip == start_strip) {
|
||||
offset_in_strip = bdev_io->u.bdev.offset_blocks & (g_strip_size - 1);
|
||||
pd_lba = (pd_strip << strip_shift) + offset_in_strip;
|
||||
if (strip == end_strip) {
|
||||
pd_blocks = bdev_io->u.bdev.num_blocks;
|
||||
} else {
|
||||
pd_blocks = g_strip_size - offset_in_strip;
|
||||
}
|
||||
} else if (strip == end_strip) {
|
||||
pd_lba = pd_strip << strip_shift;
|
||||
pd_blocks = ((bdev_io->u.bdev.offset_blocks + bdev_io->u.bdev.num_blocks - 1) &
|
||||
(g_strip_size - 1)) + 1;
|
||||
CU_ASSERT(splits_reqd == g_io_output_index);
|
||||
for (strip = start_strip; strip <= end_strip; strip++, index++) {
|
||||
pd_strip = strip / num_base_drives;
|
||||
pd_idx = strip % num_base_drives;
|
||||
if (strip == start_strip) {
|
||||
offset_in_strip = bdev_io->u.bdev.offset_blocks & (g_strip_size - 1);
|
||||
pd_lba = (pd_strip << strip_shift) + offset_in_strip;
|
||||
if (strip == end_strip) {
|
||||
pd_blocks = bdev_io->u.bdev.num_blocks;
|
||||
} else {
|
||||
pd_lba = pd_strip << raid_bdev->strip_size_shift;
|
||||
pd_blocks = raid_bdev->strip_size;
|
||||
pd_blocks = g_strip_size - offset_in_strip;
|
||||
}
|
||||
CU_ASSERT(pd_lba == g_io_output[index].offset_blocks);
|
||||
CU_ASSERT(pd_blocks == g_io_output[index].num_blocks);
|
||||
CU_ASSERT(ch_ctx->base_channel[pd_idx] == g_io_output[index].ch);
|
||||
CU_ASSERT(raid_bdev->base_bdev_info[pd_idx].desc == g_io_output[index].desc);
|
||||
CU_ASSERT(buf == g_io_output[index].buf);
|
||||
CU_ASSERT(bdev_io->type == g_io_output[index].iotype);
|
||||
buf += (pd_blocks << spdk_u32log2(g_block_len));
|
||||
} else if (strip == end_strip) {
|
||||
pd_lba = pd_strip << strip_shift;
|
||||
pd_blocks = ((bdev_io->u.bdev.offset_blocks + bdev_io->u.bdev.num_blocks - 1) &
|
||||
(g_strip_size - 1)) + 1;
|
||||
} else {
|
||||
pd_lba = pd_strip << raid_bdev->strip_size_shift;
|
||||
pd_blocks = raid_bdev->strip_size;
|
||||
}
|
||||
} else {
|
||||
CU_ASSERT(g_io_output_index == 1);
|
||||
CU_ASSERT(bdev_io->u.bdev.offset_blocks == g_io_output[0].offset_blocks);
|
||||
CU_ASSERT(bdev_io->u.bdev.num_blocks == g_io_output[0].num_blocks);
|
||||
CU_ASSERT(ch_ctx->base_channel[0] == g_io_output[0].ch);
|
||||
CU_ASSERT(raid_bdev->base_bdev_info[0].desc == g_io_output[0].desc);
|
||||
CU_ASSERT(pd_lba == g_io_output[index].offset_blocks);
|
||||
CU_ASSERT(pd_blocks == g_io_output[index].num_blocks);
|
||||
CU_ASSERT(ch_ctx->base_channel[pd_idx] == g_io_output[index].ch);
|
||||
CU_ASSERT(raid_bdev->base_bdev_info[pd_idx].desc == g_io_output[index].desc);
|
||||
CU_ASSERT(buf == g_io_output[index].buf);
|
||||
CU_ASSERT(bdev_io->type == g_io_output[index].iotype);
|
||||
buf += (pd_blocks << spdk_u32log2(g_block_len));
|
||||
}
|
||||
CU_ASSERT(g_io_comp_status == io_status);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user