Updated uses of "Execute Command On BMC" in lib folder.
Change-Id: I5358f01e93deb4f3df7c147fb8fe50924c4cd774
Signed-off-by: Joy Onyerikwu <onyekachukwu.joy.onyerikwu@ibm.com>
diff --git a/lib/bmc_network_utils.robot b/lib/bmc_network_utils.robot
index 07521dd..231eb0e 100644
--- a/lib/bmc_network_utils.robot
+++ b/lib/bmc_network_utils.robot
@@ -21,7 +21,8 @@
Should Not Be Empty ${mac_address}
Open Connection And Log In
- ${bmc_mac_addr}= Execute Command On BMC cat /sys/class/net/eth0/address
+ ${bmc_mac_addr} ${stderr} ${rc}= BMC Execute Command
+ ... cat /sys/class/net/eth0/address
Run Keyword If '${mac_address.lower()}' != '${bmc_mac_addr.lower()}'
... Set MAC Address
@@ -38,14 +39,14 @@
# Take SSH session post BMC reboot.
Open Connection And Log In
- ${bmc_mac_addr}= Execute Command On BMC cat /sys/class/net/eth0/address
+ ${bmc_mac_addr} ${stderr} ${rc}= BMC Execute Command
+ ... cat /sys/class/net/eth0/address
Should Be Equal ${bmc_mac_addr} ${mac_address} ignore_case=True
Get BMC IP Info
[Documentation] Get system IP address and prefix length.
- Open Connection And Login
# Get system IP address and prefix length details using "ip addr"
# Sample Output of "ip addr":
@@ -53,7 +54,8 @@
# 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
- ${cmd_output}= Execute Command On BMC /sbin/ip addr | grep eth0
+ ${cmd_output} ${stderr} ${rc}= BMC Execute Command
+ ... /sbin/ip addr | grep eth0
# Get line having IP address details.
${lines}= Get Lines Containing String ${cmd_output} inet
@@ -74,14 +76,14 @@
Get BMC Route Info
[Documentation] Get system route info.
- Open Connection And Login
# Sample output of "ip route":
# default via xx.xx.xx.x dev eth0
# xx.xx.xx.0/23 dev eth0 src xx.xx.xx.xx
# xx.xx.xx.0/24 dev eth0 src xx.xx.xx.xx
- ${cmd_output}= Execute Command On BMC /sbin/ip route
+ ${cmd_output} ${stderr} ${rc}= BMC Execute Command
+ ... /sbin/ip route
[Return] ${cmd_output}
@@ -89,12 +91,12 @@
Get BMC MAC Address
[Documentation] Get system MAC address.
- Open Connection And Login
# Sample output of "ip addr | grep ether":
# link/ether xx.xx.xx.xx.xx.xx brd ff:ff:ff:ff:ff:ff
- ${cmd_output}= Execute Command On BMC /sbin/ip addr | grep ether
+ ${cmd_output} ${stderr} ${rc}= BMC Execute Command
+ ... /sbin/ip addr | grep ether
# Split the line and return MAC address.
# Split list data:
@@ -111,7 +113,8 @@
# Sample output of "ip addr | grep ether":
# link/ether xx.xx.xx.xx.xx.xx brd ff:ff:ff:ff:ff:ff
- ${cmd_output}= BMC Execute Command /sbin/ip addr | grep ether
+ ${cmd_output} ${stderr} ${rc}= BMC Execute Command
+ ... /sbin/ip addr | grep ether
# Split the line and return MAC address.
# Split list data:
@@ -119,7 +122,7 @@
# link/ether | xx:xx:xx:xx:xx:xx | brd | ff:ff:ff:ff:ff:ff
${mac_list}= Create List
- @{lines}= Split To Lines ${cmd_output[0]}
+ @{lines}= Split To Lines ${cmd_output}
:FOR ${line} IN @{lines}
\ @{words}= Split String ${line}
\ Append To List ${mac_list} ${words[1]}
@@ -138,7 +141,8 @@
# Kernel: Linux 4.10.17-d6ae40dc4c4dff3265cc254d404ed6b03fcc2206
# Architecture: arm
- ${output}= Execute Command on BMC hostnamectl | grep hostname
+ ${output} ${stderr} ${rc}= BMC Execute Command
+ ... hostnamectl | grep hostname
[Return] ${output}