bdev/raid: remove randomness from test_read_io()

Use 2 fixed IO sizes instead.

Change-Id: I4f82108393703860c62fcde2f7d822a97cf2bb40
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454513
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
paul luse 2019-05-14 16:04:22 -04:00 committed by Jim Harris
parent 3ac37f5db0
commit 3a1f7cb923

View File

@ -1548,18 +1548,22 @@ test_read_io(void)
}
free_test_req(&req);
/* test 2 IO sizes based on global strip size set earlier */
lba = 0;
bdev_io = calloc(1, sizeof(struct spdk_bdev_io) + sizeof(struct raid_bdev_io));
SPDK_CU_ASSERT_FATAL(bdev_io != NULL);
io_len = (rand() % g_strip_size) + 1;
bdev_io_initialize(bdev_io, &pbdev->bdev, lba, io_len, SPDK_BDEV_IO_TYPE_READ);
memset(g_io_output, 0, (g_max_io_size / g_strip_size) + 1 * sizeof(struct io_output));
g_io_output_index = 0;
raid_bdev_submit_request(ch, bdev_io);
verify_io(bdev_io, req.base_bdevs.num_base_bdevs, ch_ctx, pbdev,
g_child_io_status_flag);
bdev_io_cleanup(bdev_io);
free(bdev_io);
for (i = 0; i < 2; i++) {
bdev_io = calloc(1, sizeof(struct spdk_bdev_io) + sizeof(struct raid_bdev_io));
SPDK_CU_ASSERT_FATAL(bdev_io != NULL);
io_len = (g_strip_size / 2) << i;
bdev_io_initialize(bdev_io, &pbdev->bdev, lba, io_len, SPDK_BDEV_IO_TYPE_READ);
lba += g_strip_size;
memset(g_io_output, 0, (g_max_io_size / g_strip_size) + 1 * sizeof(struct io_output));
g_io_output_index = 0;
raid_bdev_submit_request(ch, bdev_io);
verify_io(bdev_io, req.base_bdevs.num_base_bdevs, ch_ctx, pbdev,
g_child_io_status_flag);
bdev_io_cleanup(bdev_io);
free(bdev_io);
}
raid_bdev_destroy_cb(pbdev, ch_ctx);
CU_ASSERT(ch_ctx->base_channel == NULL);