iscsi: Fix two bugs of JSON config dump
Missed to add object_begin to dump for portal group. key of lun in luns is different between dump and load. Change-Id: I16b95596478e0e4430c7186aa077bd107e375a93 Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-on: https://review.gerrithub.io/410863 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
19354d966c
commit
718440bc6b
@ -676,6 +676,8 @@ static void
|
||||
spdk_iscsi_portal_grp_config_json(struct spdk_iscsi_portal_grp *pg,
|
||||
struct spdk_json_write_ctx *w)
|
||||
{
|
||||
spdk_json_write_object_begin(w);
|
||||
|
||||
spdk_json_write_named_string(w, "method", "add_portal_group");
|
||||
|
||||
spdk_json_write_name(w, "params");
|
||||
|
@ -1464,7 +1464,7 @@ spdk_iscsi_tgt_node_info_json(struct spdk_iscsi_tgt_node *target,
|
||||
if (lun) {
|
||||
spdk_json_write_object_begin(w);
|
||||
spdk_json_write_named_string(w, "bdev_name", spdk_scsi_lun_get_bdev_name(lun));
|
||||
spdk_json_write_named_int32(w, "id", spdk_scsi_lun_get_id(lun));
|
||||
spdk_json_write_named_int32(w, "lun_id", spdk_scsi_lun_get_id(lun));
|
||||
spdk_json_write_object_end(w);
|
||||
}
|
||||
}
|
||||
|
@ -351,8 +351,8 @@ def verify_target_nodes_rpc_methods(rpc_py, rpc_param):
|
||||
"target name value is {}, expected {}".format(name, nodebase + ":" + rpc_param['target_name']))
|
||||
verify(jsonvalues[0]['alias_name'] == rpc_param['alias_name'], 1,
|
||||
"target alias_name value is {}, expected {}".format(jsonvalues[0]['alias_name'], rpc_param['alias_name']))
|
||||
verify(jsonvalues[0]['luns'][0]['id'] == 0, 1,
|
||||
"lun id value is {}, expected 0".format(jsonvalues[0]['luns'][0]['id']))
|
||||
verify(jsonvalues[0]['luns'][0]['lun_id'] == 0, 1,
|
||||
"lun id value is {}, expected 0".format(jsonvalues[0]['luns'][0]['lun_id']))
|
||||
verify(jsonvalues[0]['pg_ig_maps'][0]['ig_tag'] == int(initiator_tag), 1,
|
||||
"initiator group tag value is {}, expected {}".format(jsonvalues[0]['pg_ig_maps'][0]['ig_tag'], initiator_tag))
|
||||
verify(jsonvalues[0]['queue_depth'] == rpc_param['queue_depth'], 1,
|
||||
@ -377,8 +377,8 @@ def verify_target_nodes_rpc_methods(rpc_py, rpc_param):
|
||||
jsonvalues = json.loads(output)
|
||||
verify(jsonvalues[0]['luns'][1]['bdev_name'] == "Malloc" + str(rpc_param['lun_total']), 1,
|
||||
"bdev_name value is {}, expected Malloc{}".format(jsonvalues[0]['luns'][0]['bdev_name'], str(rpc_param['lun_total'])))
|
||||
verify(jsonvalues[0]['luns'][1]['id'] == 1, 1,
|
||||
"lun id value is {}, expected 1".format(jsonvalues[0]['luns'][1]['id']))
|
||||
verify(jsonvalues[0]['luns'][1]['lun_id'] == 1, 1,
|
||||
"lun id value is {}, expected 1".format(jsonvalues[0]['luns'][1]['lun_id']))
|
||||
|
||||
rpc.delete_target_node(name)
|
||||
output = rpc.get_target_nodes()
|
||||
|
Loading…
Reference in New Issue
Block a user