Commit c72e3bfe authored by Pawel Kaminski's avatar Pawel Kaminski Committed by Darek Stojaczyk
Browse files

ut/raid: remove negative tests for spdk_jsonrpc_begin_result()



spdk_jsonrpc_begin_result() will be refactored to always
return non-null in subsequent patch and those raid tests
will no longer make sense, so we remove them now.

Change-Id: Ifd4570af4daab9c96cd8701440366e292f879204
Signed-off-by: default avatarPawel Wodkowski <pawelx.wodkowski@intel.com>
Signed-off-by: default avatarPawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459659


Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent ade7d070
Loading
Loading
Loading
Loading
+6 −12
Original line number Diff line number Diff line
@@ -81,7 +81,6 @@ uint8_t g_ignore_io_output;
uint8_t g_rpc_err;
char *g_get_raids_output[MAX_RAIDS];
uint32_t g_get_raids_count;
uint8_t g_json_beg_res_ret_err;
uint8_t g_json_decode_obj_err;
uint8_t g_json_decode_obj_construct;
uint8_t g_config_level_create = 0;
@@ -179,7 +178,6 @@ set_globals(void)
	TAILQ_INIT(&g_io_waitq);
	rpc_req = NULL;
	rpc_req_size = 0;
	g_json_beg_res_ret_err = 0;
	g_json_decode_obj_err = 0;
	g_json_decode_obj_construct = 0;
	g_lba_offset = 0;
@@ -561,12 +559,8 @@ spdk_json_decode_object(const struct spdk_json_val *values,
struct spdk_json_write_ctx *
spdk_jsonrpc_begin_result(struct spdk_jsonrpc_request *request)
{
	if (g_json_beg_res_ret_err) {
		return NULL;
	} else {
	return (void *)1;
}
}

int
spdk_json_write_string(struct spdk_json_write_ctx *w, const char *val)
@@ -1282,7 +1276,6 @@ test_construct_raid_invalid_args(void)

	create_test_req(&req, "raid2", g_max_base_drives, false);
	g_rpc_err = 0;
	g_json_beg_res_ret_err = 1;
	g_json_decode_obj_construct = 1;
	spdk_rpc_construct_raid_bdev(NULL, NULL);
	CU_ASSERT(g_rpc_err == 0);
@@ -1291,7 +1284,6 @@ test_construct_raid_invalid_args(void)
	verify_raid_bdev_present("raid2", true);
	verify_raid_config_present("raid1", true);
	verify_raid_bdev_present("raid1", true);
	g_json_beg_res_ret_err = 0;

	destroy_req.name = strdup("raid1");
	rpc_req = &destroy_req;
@@ -2098,12 +2090,14 @@ test_multi_raid_no_io(void)
	rpc_req = &get_raids_req;
	rpc_req_size = sizeof(get_raids_req);
	g_rpc_err = 0;
	g_json_beg_res_ret_err = 1;
	g_json_decode_obj_construct = 0;
	spdk_rpc_get_raid_bdevs(NULL, NULL);
	CU_ASSERT(g_rpc_err == 0);
	g_json_beg_res_ret_err = 0;
	CU_ASSERT(g_get_raids_count == 0);
	CU_ASSERT(g_get_raids_count == g_max_raids);
	for (i = 0; i < g_get_raids_count; i++) {
		free(g_get_raids_output[i]);
	}
	g_get_raids_count = 0;

	for (i = 0; i < g_max_raids; i++) {
		SPDK_CU_ASSERT_FATAL(construct_req[i].name != NULL);