Commit 0cbd0529 authored by paul luse's avatar paul luse Committed by Jim Harris
Browse files

bdev/raid: remove randomness from test_write_io()



Test 2 fixed IO sizes instead.

Change-Id: Idc909a6054d99cef74dd2ddad5680ef371d6f649
Signed-off-by: default avatarpaul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454512


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 3a1f7cb9
Loading
Loading
Loading
Loading
+17 −14
Original line number Diff line number Diff line
@@ -1442,7 +1442,7 @@ test_write_io(void)
	uint32_t i;
	struct spdk_bdev_io *bdev_io;
	uint64_t io_len;
	uint64_t lba;
	uint64_t lba = 0;

	set_globals();
	create_test_req(&req, "raid1", 0, true);
@@ -1473,11 +1473,13 @@ test_write_io(void)
		CU_ASSERT(ch_ctx->base_channel && ch_ctx->base_channel[i] == (void *)0x1);
	}

	lba = 0;
	/* test 2 IO sizes based on global strip size set earlier */
	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 = (rand() % g_strip_size) + 1;
		io_len = (g_strip_size / 2) << i;
		bdev_io_initialize(bdev_io, &pbdev->bdev, lba, io_len, SPDK_BDEV_IO_TYPE_WRITE);
		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);
@@ -1485,8 +1487,9 @@ test_write_io(void)
			  g_child_io_status_flag);
		bdev_io_cleanup(bdev_io);
		free(bdev_io);
	free_test_req(&req);
	}

	free_test_req(&req);
	raid_bdev_destroy_cb(pbdev, ch_ctx);
	CU_ASSERT(ch_ctx->base_channel == NULL);
	free(ch);