spdk_iscsi_init_grp_create_from_configfile() returns 0 even if creating an initiator group (IG) is failed due to empty netmask or initiator name. This will be unexpected behavior for end users. Hence change the return code from 0 to -ENVAL for this failure. Besides do the following. Change other error return codes in the function by using errno too. Current IG don't have any UT code in repository. UT code to confirm this fix is also submitted. Change-Id: Ic918feb5c6a3e772b325664d881b2673b553a217 Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-on: https://review.gerrithub.io/384408 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
32 lines
660 B
Plaintext
32 lines
660 B
Plaintext
[IG_Valid0]
|
|
# Success is expected.
|
|
InitiatorName iqn.2017-10.spdk.io:0001
|
|
Netmask 192.168.2.0
|
|
|
|
[IG_Valid1]
|
|
# Success is expected.
|
|
InitiatorName iqn.2017-10.spdk.io:0001
|
|
Netmask 192.168.2.0
|
|
Netmask 192.168.2.1
|
|
|
|
[IG_Valid2]
|
|
# Success is expected.
|
|
InitiatorName iqn.2017-10.spdk.io:0001
|
|
InitiatorName iqn.2017-10.spdk.io:0002
|
|
Netmask 192.168.2.0
|
|
|
|
[IG_Valid3]
|
|
# Success is expected.
|
|
InitiatorName iqn.2017-10.spdk.io:0001
|
|
InitiatorName iqn.2017-10.spdk.io:0002
|
|
Netmask 192.168.2.0
|
|
Netmask 192.168.2.1
|
|
|
|
[IG_Invalid0]
|
|
# Failure is expected.
|
|
InitiatorName iqn.2017-10.spdk.io:0001
|
|
|
|
[IG_Invalid1]
|
|
# Failure is expected.
|
|
Netmask 192.168.2.0
|