ut/bdev/raid: Move create_construct_req() to clarify it is for RPC
create_construct_req() had been located just above raid_bdev_init(). However this location was not intuitive. Hence move create_construct_req() to just above spdk_rpc_construct_raid_bdev(). Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: Ia5998146ce7b4b9a3c3bdeb38b6dbc8dd21fa276 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464481 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
2c35c8fbea
commit
c0329efef3
@ -1165,11 +1165,11 @@ test_construct_raid(void)
|
||||
struct rpc_destroy_raid_bdev destroy_req;
|
||||
|
||||
set_globals();
|
||||
create_construct_req(&req, "raid1", 0, true, 0);
|
||||
CU_ASSERT(raid_bdev_init() == 0);
|
||||
|
||||
verify_raid_config_present("raid1", false);
|
||||
verify_raid_bdev_present("raid1", false);
|
||||
create_construct_req(&req, "raid1", 0, true, 0);
|
||||
spdk_rpc_construct_raid_bdev(NULL, NULL);
|
||||
CU_ASSERT(g_rpc_err == 0);
|
||||
verify_raid_config(&req, true);
|
||||
@ -1191,10 +1191,11 @@ test_destroy_raid(void)
|
||||
struct rpc_destroy_raid_bdev destroy_req;
|
||||
|
||||
set_globals();
|
||||
create_construct_req(&construct_req, "raid1", 0, true, 0);
|
||||
CU_ASSERT(raid_bdev_init() == 0);
|
||||
|
||||
verify_raid_config_present("raid1", false);
|
||||
verify_raid_bdev_present("raid1", false);
|
||||
create_construct_req(&construct_req, "raid1", 0, true, 0);
|
||||
spdk_rpc_construct_raid_bdev(NULL, NULL);
|
||||
CU_ASSERT(g_rpc_err == 0);
|
||||
verify_raid_config(&construct_req, true);
|
||||
@ -1222,9 +1223,9 @@ test_construct_raid_invalid_args(void)
|
||||
set_globals();
|
||||
CU_ASSERT(raid_bdev_init() == 0);
|
||||
|
||||
create_construct_req(&req, "raid1", 0, true, 0);
|
||||
verify_raid_config_present("raid1", false);
|
||||
verify_raid_bdev_present("raid1", false);
|
||||
create_construct_req(&req, "raid1", 0, true, 0);
|
||||
req.raid_level = 1;
|
||||
spdk_rpc_construct_raid_bdev(NULL, NULL);
|
||||
CU_ASSERT(g_rpc_err == 1);
|
||||
@ -1233,8 +1234,6 @@ test_construct_raid_invalid_args(void)
|
||||
verify_raid_bdev_present("raid1", false);
|
||||
|
||||
create_construct_req(&req, "raid1", 0, false, 1);
|
||||
verify_raid_config_present("raid1", false);
|
||||
verify_raid_bdev_present("raid1", false);
|
||||
spdk_rpc_construct_raid_bdev(NULL, NULL);
|
||||
CU_ASSERT(g_rpc_err == 1);
|
||||
free_test_req(&req);
|
||||
@ -1317,10 +1316,11 @@ test_destroy_raid_invalid_args(void)
|
||||
struct rpc_destroy_raid_bdev destroy_req;
|
||||
|
||||
set_globals();
|
||||
create_construct_req(&construct_req, "raid1", 0, true, 0);
|
||||
CU_ASSERT(raid_bdev_init() == 0);
|
||||
|
||||
verify_raid_config_present("raid1", false);
|
||||
verify_raid_bdev_present("raid1", false);
|
||||
create_construct_req(&construct_req, "raid1", 0, true, 0);
|
||||
spdk_rpc_construct_raid_bdev(NULL, NULL);
|
||||
CU_ASSERT(g_rpc_err == 0);
|
||||
verify_raid_config(&construct_req, true);
|
||||
@ -1359,9 +1359,9 @@ test_io_channel(void)
|
||||
uint8_t i;
|
||||
|
||||
set_globals();
|
||||
create_construct_req(&req, "raid1", 0, true, 0);
|
||||
CU_ASSERT(raid_bdev_init() == 0);
|
||||
|
||||
create_construct_req(&req, "raid1", 0, true, 0);
|
||||
verify_raid_config_present("raid1", false);
|
||||
verify_raid_bdev_present("raid1", false);
|
||||
spdk_rpc_construct_raid_bdev(NULL, NULL);
|
||||
@ -1412,8 +1412,9 @@ test_write_io(void)
|
||||
uint64_t lba = 0;
|
||||
|
||||
set_globals();
|
||||
create_construct_req(&req, "raid1", 0, true, 0);
|
||||
CU_ASSERT(raid_bdev_init() == 0);
|
||||
|
||||
create_construct_req(&req, "raid1", 0, true, 0);
|
||||
verify_raid_config_present("raid1", false);
|
||||
verify_raid_bdev_present("raid1", false);
|
||||
spdk_rpc_construct_raid_bdev(NULL, NULL);
|
||||
@ -1480,10 +1481,11 @@ test_read_io(void)
|
||||
uint64_t lba;
|
||||
|
||||
set_globals();
|
||||
create_construct_req(&req, "raid1", 0, true, 0);
|
||||
CU_ASSERT(raid_bdev_init() == 0);
|
||||
|
||||
verify_raid_config_present("raid1", false);
|
||||
verify_raid_bdev_present("raid1", false);
|
||||
create_construct_req(&req, "raid1", 0, true, 0);
|
||||
spdk_rpc_construct_raid_bdev(NULL, NULL);
|
||||
CU_ASSERT(g_rpc_err == 0);
|
||||
verify_raid_config(&req, true);
|
||||
@ -1624,10 +1626,11 @@ test_unmap_io(void)
|
||||
uint64_t lba;
|
||||
|
||||
set_globals();
|
||||
create_construct_req(&req, "raid1", 0, true, 0);
|
||||
CU_ASSERT(raid_bdev_init() == 0);
|
||||
|
||||
verify_raid_config_present("raid1", false);
|
||||
verify_raid_bdev_present("raid1", false);
|
||||
create_construct_req(&req, "raid1", 0, true, 0);
|
||||
spdk_rpc_construct_raid_bdev(NULL, NULL);
|
||||
CU_ASSERT(g_rpc_err == 0);
|
||||
verify_raid_config(&req, true);
|
||||
@ -1697,10 +1700,11 @@ test_io_failure(void)
|
||||
uint64_t lba;
|
||||
|
||||
set_globals();
|
||||
create_construct_req(&req, "raid1", 0, true, 0);
|
||||
CU_ASSERT(raid_bdev_init() == 0);
|
||||
|
||||
verify_raid_config_present("raid1", false);
|
||||
verify_raid_bdev_present("raid1", false);
|
||||
create_construct_req(&req, "raid1", 0, true, 0);
|
||||
spdk_rpc_construct_raid_bdev(NULL, NULL);
|
||||
CU_ASSERT(g_rpc_err == 0);
|
||||
verify_raid_config(&req, true);
|
||||
@ -1781,10 +1785,11 @@ test_reset_io(void)
|
||||
struct spdk_bdev_io *bdev_io;
|
||||
|
||||
set_globals();
|
||||
create_construct_req(&req, "raid1", 0, true, 0);
|
||||
CU_ASSERT(raid_bdev_init() == 0);
|
||||
|
||||
verify_raid_config_present("raid1", false);
|
||||
verify_raid_bdev_present("raid1", false);
|
||||
create_construct_req(&req, "raid1", 0, true, 0);
|
||||
spdk_rpc_construct_raid_bdev(NULL, NULL);
|
||||
CU_ASSERT(g_rpc_err == 0);
|
||||
verify_raid_config(&req, true);
|
||||
@ -1852,10 +1857,11 @@ test_io_waitq(void)
|
||||
TAILQ_HEAD(, spdk_bdev_io) head_io;
|
||||
|
||||
set_globals();
|
||||
create_construct_req(&req, "raid1", 0, true, 0);
|
||||
CU_ASSERT(raid_bdev_init() == 0);
|
||||
|
||||
verify_raid_config_present("raid1", false);
|
||||
verify_raid_bdev_present("raid1", false);
|
||||
create_construct_req(&req, "raid1", 0, true, 0);
|
||||
spdk_rpc_construct_raid_bdev(NULL, NULL);
|
||||
CU_ASSERT(g_rpc_err == 0);
|
||||
verify_raid_config(&req, true);
|
||||
@ -1934,9 +1940,9 @@ test_multi_raid_no_io(void)
|
||||
CU_ASSERT(raid_bdev_init() == 0);
|
||||
for (i = 0; i < g_max_raids; i++) {
|
||||
snprintf(name, 16, "%s%u", "raid", i);
|
||||
create_construct_req(&construct_req[i], name, bbdev_idx, true, 0);
|
||||
verify_raid_config_present(name, false);
|
||||
verify_raid_bdev_present(name, false);
|
||||
create_construct_req(&construct_req[i], name, bbdev_idx, true, 0);
|
||||
bbdev_idx += g_max_base_drives;
|
||||
spdk_rpc_construct_raid_bdev(NULL, NULL);
|
||||
CU_ASSERT(g_rpc_err == 0);
|
||||
@ -2032,9 +2038,9 @@ test_multi_raid_with_io(void)
|
||||
SPDK_CU_ASSERT_FATAL(ch != NULL);
|
||||
for (i = 0; i < g_max_raids; i++) {
|
||||
snprintf(name, 16, "%s%u", "raid", i);
|
||||
create_construct_req(&construct_req[i], name, bbdev_idx, true, 0);
|
||||
verify_raid_config_present(name, false);
|
||||
verify_raid_bdev_present(name, false);
|
||||
create_construct_req(&construct_req[i], name, bbdev_idx, true, 0);
|
||||
bbdev_idx += g_max_base_drives;
|
||||
spdk_rpc_construct_raid_bdev(NULL, NULL);
|
||||
CU_ASSERT(g_rpc_err == 0);
|
||||
@ -2228,11 +2234,11 @@ test_raid_json_dump_info(void)
|
||||
struct raid_bdev *pbdev;
|
||||
|
||||
set_globals();
|
||||
create_construct_req(&req, "raid1", 0, true, 0);
|
||||
CU_ASSERT(raid_bdev_init() == 0);
|
||||
|
||||
verify_raid_config_present("raid1", false);
|
||||
verify_raid_bdev_present("raid1", false);
|
||||
create_construct_req(&req, "raid1", 0, true, 0);
|
||||
spdk_rpc_construct_raid_bdev(NULL, NULL);
|
||||
CU_ASSERT(g_rpc_err == 0);
|
||||
verify_raid_bdev(&req, true, RAID_BDEV_STATE_ONLINE);
|
||||
|
Loading…
Reference in New Issue
Block a user