Modified cases in suite test_bmc_network_conf
- Let user to specify Ethernet Interface name by channel number while
running, if not, the channel number default is 1.
- Fixed typo from ${multicaste_ip} to ${multicast_ip}.
Change-Id: Ic626aa1c7b32c36289ff28a01b4a785f5e5500fc
Signed-off-by: Tony Lee <tony.lee@quantatw.com>
diff --git a/lib/bmc_network_utils.robot b/lib/bmc_network_utils.robot
index 15d80ce..096cd5e 100644
--- a/lib/bmc_network_utils.robot
+++ b/lib/bmc_network_utils.robot
@@ -55,8 +55,10 @@
# link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
# inet xx.xx.xx.xx/24 brd xx.xx.xx.xx scope global eth0
+ ${active_channel_config}= Get Active Channel Config
+ ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
${cmd_output} ${stderr} ${rc}= BMC Execute Command
- ... /sbin/ip addr | grep eth0
+ ... /sbin/ip addr | grep ${ethernet_interface}
# Get line having IP address details.
${lines}= Get Lines Containing String ${cmd_output} inet
@@ -353,8 +355,11 @@
# "VLANEnable": false,
# "VLANId": 0
# }
+
+
${active_channel_config}= Get Active Channel Config
- ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}/${active_channel_config['${CHANNEL_NUMBER}']['name']}
+ ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${active_channel_config['${CHANNEL_NUMBER}']['name']}
+
@{network_configurations}= Get From Dictionary ${resp.dict} IPv4StaticAddresses
[Return] @{network_configurations}
@@ -389,7 +394,10 @@
Append To List ${patch_list} ${ip_data}
${data}= Create Dictionary IPv4StaticAddresses=${patch_list}
- Redfish.patch ${REDFISH_NW_ETH0_URI} body=&{data}
+ ${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=&{data}
... valid_status_codes=[${valid_status_codes}]
Return From Keyword If '${valid_status_codes}' != '${HTTP_OK}'
@@ -429,7 +437,10 @@
# 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}
+ ${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=&{data}
... valid_status_codes=[${valid_status_codes}]
# Note: Network restart takes around 15-18s after patch request processing