Fixed network ipv4 CT issues
Reason:
While configure and update IP address changed to 204 code.
Changes:
While configure and update IP address changed code to HTTP_NO_CONTENT.
Change-Id: Id19cca8ab03e3223d64a8355967e3dc634583649
Signed-off-by: Anves Kumar rayankula <anvesr77@in.ibm.com>
diff --git a/lib/bmc_network_utils.robot b/lib/bmc_network_utils.robot
index 4a7d7ea..dbcac25 100644
--- a/lib/bmc_network_utils.robot
+++ b/lib/bmc_network_utils.robot
@@ -470,6 +470,10 @@
Append To List ${patch_list} ${empty_dict}
END
+ ${valid_status_codes}= Run Keyword If '${valid_status_codes}' == '${HTTP_OK}'
+ ... Set Variable ${HTTP_OK},${HTTP_NO_CONTENT}
+ ... ELSE Set Variable ${valid_status_codes}
+
# We need not check for existence of IP on BMC while adding.
Append To List ${patch_list} ${ip_data}
${data}= Create Dictionary IPv4StaticAddresses=${patch_list}
@@ -480,7 +484,7 @@
Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{data}
... valid_status_codes=[${valid_status_codes}]
- Return From Keyword If '${valid_status_codes}' != '${HTTP_OK}'
+ Return From Keyword If '${valid_status_codes}' != '${HTTP_OK},${HTTP_NO_CONTENT}'
# Note: Network restart takes around 15-18s after patch request processing.
Sleep ${NETWORK_TIMEOUT}s
diff --git a/redfish/managers/test_bmc_network_conf.robot b/redfish/managers/test_bmc_network_conf.robot
index 9c94f77..4231042 100644
--- a/redfish/managers/test_bmc_network_conf.robot
+++ b/redfish/managers/test_bmc_network_conf.robot
@@ -568,6 +568,7 @@
${active_channel_config}= Get Active Channel Config
${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
Redfish.patch ${REDFISH_NW_ETH_IFACE}${ethernet_interface} body=&{payload}
+ ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
# Note: Network restart takes around 15-18s after patch request processing.
Sleep ${NETWORK_TIMEOUT}s
@@ -771,7 +772,8 @@
Update IP Address
[Documentation] Update IP address of BMC.
- [Arguments] ${ip} ${new_ip} ${netmask} ${gw_ip} ${valid_status_codes}=${HTTP_OK}
+ [Arguments] ${ip} ${new_ip} ${netmask} ${gw_ip}
+ ... ${valid_status_codes}=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
# Description of argument(s):
# ip IP address to be replaced (e.g. "10.7.7.7").
@@ -801,7 +803,7 @@
# Run patch command only if given IP is found on BMC
${data}= Create Dictionary IPv4StaticAddresses=${patch_list}
- Redfish.patch ${REDFISH_NW_ETH0_URI} body=&{data} valid_status_codes=[${valid_status_codes}]
+ Redfish.patch ${REDFISH_NW_ETH0_URI} body=&{data} valid_status_codes=${valid_status_codes}
# Note: Network restart takes around 15-18s after patch request processing.
Sleep ${NETWORK_TIMEOUT}s