Add MAC and NTP to Openbmctool Network tests.
Resolve openbmc/openbmc-test-automation#1930
Change-Id: If561d332e3b45e8ee7e07bff15099db964649449
Signed-off-by: Naman Navin Hegde <nhegde89@in.ibm.com>
diff --git a/lib/bmc_network_utils.robot b/lib/bmc_network_utils.robot
index 9b3605f..337aef6 100644
--- a/lib/bmc_network_utils.robot
+++ b/lib/bmc_network_utils.robot
@@ -314,4 +314,3 @@
${nameservers}= Split String ${stdout}
[Return] ${nameservers}
-
diff --git a/openpower/tests_openbmctool/test_openbmctool_network.robot b/openpower/tests_openbmctool/test_openbmctool_network.robot
old mode 100644
new mode 100755
index 427f42c..28d4b4e
--- a/openpower/tests_openbmctool/test_openbmctool_network.robot
+++ b/openpower/tests_openbmctool/test_openbmctool_network.robot
@@ -24,94 +24,127 @@
${ip} 10.5.5.5
${dns_ip} 10.10.10.10
${domain_name} randomName.com
+${mac_address} 76:e2:84:14:87:91
+${ntp_server} pool.ntp.org
${parser} |grep "ipv4"|awk -F/ 'NR==1{print$5}'
+${eth0_resource_path} /xyz/openbmc_project/network/eth0
${ignore_err} ${0}
*** Test Cases ***
Verify GetIP
- [Documentation] Verify that openbmctool.py can run the getIP command.
+ [Documentation] Verify that openbmctool can run the getIP command.
[Tags] Verify_GetIP
${ip_records}= Network getIP I=eth0
${addresses}= Nested Get Address ${ip_records}
-
Verify IP On BMC ${addresses}[${0}]
Verify AddIP
- [Documentation] Verify that openbmctool.py can run the addIP command.
+ [Documentation] Verify that openbmctool can run the addIP command.
[Tags] Verify_AddIP
Network addIP I=${interface} a=${ip} l=24 p=ipv4
-
Wait And Verify IP On BMC ${ip}
Verify GetDefaultGW
- [Documentation] Verify that openbmctool.py can run the getDefaultGW command.
+ [Documentation] Verify that openbmctool can run the getDefaultGW command.
[Tags] Verify_GetDefaultGW
${default_gw}= Network getDefaultGW
-
Verify Gateway On BMC ${default_gw}
Verify RemoveIP
- [Documentation] Verify that openbmctool.py can run the rmIP command.
+ [Documentation] Verify that openbmctool can run the rmIP command.
[Tags] Verify_RemoveIP
Network addIP I=${interface} a=${ip} l=24 p=ipv4
Wait And Verify IP On BMC ${ip}
-
Network rmIP I=${interface} a=${ip}
-
${status}= Run Keyword And Return Status Wait And Verify IP On BMC ${ip}
Should Be Equal ${status} ${False}
Verify SetDNS
- [Documentation] Verify that openbmctool.py can run the setDNS command.
+ [Documentation] Verify that openbmctool can run the setDNS command.
[Tags] Verify_SetDNS
Network setDNS I=eth0 d=${dns_ip}
${dns_config}= CLI Get Nameservers
-
Should Contain ${dns_config} ${dns_ip}
Verify GetDNS
- [Documentation] Verify that openbmctool.py can run the getDNS command.
+ [Documentation] Verify that openbmctool can run the getDNS command.
[Tags] Verify_GetDNS
Network setDNS I=eth0 d=${dns_ip}
${dns_data}= Network getDNS I=eth0
${dns_config}= CLI Get Nameservers
-
Should Contain ${dns_config} ${dns_data}[${0}]
Verify SetHostName
- [Documentation] Verify that openbmctool.py can run the setHostName command.
+ [Documentation] Verify that openbmctool can run the setHostName command.
[Tags] Verify_SetHostName
Network setHostName H=randomName
${bmc_hostname}= Get BMC Hostname
-
Should Be Equal As Strings ${bmc_hostname} randomName
Verify GetHostName
- [Documentation] Verify that openbmctool.py can run the getHostName command.
+ [Documentation] Verify that openbmctool can run the getHostName command.
[Tags] Verify_GetHostName
${tool_hostname}= Network getHostName
${bmc_hostname}= Get BMC Hostname
-
Should Be Equal As Strings ${bmc_hostname} ${tool_hostname}
+Verify SetMACAddress
+ [Documentation] Verify that openbmctool can set a new MAC address.
+ [Tags] Verify_SetMACAddress
+
+ Network setMACAddress I=eth0 MA=${mac_address}
+ Validate MAC On BMC ${mac_address}
+
+
+Verify GetMACAddress
+ [Documentation] Verify that openbmctool can get the MAC address.
+ [Tags] Verify_GetMACAddress
+
+ ${mac_addr}= Network getMACAddress I=eth0
+ Validate MAC On BMC ${mac_addr}
+
+
+Verify SetNTP
+ [Documentation] Verify that openbmctool can run the setNTP command.
+ [Tags] Verify_SetNTP
+
+ Network setNTP I=eth0 N=${ntp_server}
+ # Get NTP server details via REST.
+ ${eth0}= Read Properties ${eth0_resource_path} quiet=1
+ Rprint Vars eth0
+ Valid Value eth0['NTPServers'][0] ['${ntp_server}']
+
+
+Verify GetNTP
+ [Documentation] Verify that openbmctool can run the getNTP command.
+ [Tags] Verify_GetNTP
+
+ Network setNTP I=eth0 N=${ntp_server}
+ # Get NTP server details via REST method.
+ ${eth0}= Read Properties ${eth0_resource_path} quiet=1
+ Rprint Vars eth0
+ ${tool_ntp}= Network getNTP I=eth0
+ Valid Value eth0['NTPServers'][0] ['${tool_ntp}']
+
+
*** Keywords ***
Suite Setup Execution