NTP additional test case added
Test case added as follows:
- Verify Enable NTP.
resolves openbmc/openbmc-test-automation#1847
Change-Id: Ia7d3f14067f7742b4ca7c94e816af804a5ba19fc
Signed-off-by: Sivas SRR <sivas.srr@in.ibm.com>
diff --git a/redfish/managers/test_managers_bmc_time.robot b/redfish/managers/test_managers_bmc_time.robot
index 79c37da..2e6409c 100644
--- a/redfish/managers/test_managers_bmc_time.robot
+++ b/redfish/managers/test_managers_bmc_time.robot
@@ -6,15 +6,18 @@
Resource ../../lib/openbmc_ffdc.robot
Resource ../../lib/utils.robot
Resource ../../lib/rest_client.robot
+Library ../../lib/gen_robot_valid.py
-Test Setup Run Keywords Printn AND redfish.Login
Test Teardown Test Teardown Execution
+Suite Setup Suite Setup Execution
+Suite Teardown Redfish.Logout
*** Variables ***
${max_time_diff_in_seconds} 6
${invalid_datetime} "2019-04-251T12:24:46+00:00"
${ntp_server_1} "9.9.9.9"
${ntp_server_2} "2.2.3.3"
+&{original_ntp} &{EMPTY}
*** Test Cases ***
@@ -98,13 +101,27 @@
Redfish.Logout
+Verify Enable NTP
+ [Documentation] Verify NTP protocol mode can be enabled.
+ [Teardown] Restore NTP Mode
+ [Tags] Verify_Enable_NTP
+
+ ${original_ntp}= Redfish.Get Attribute ${REDFISH_NW_PROTOCOL_URI} NTP
+ Set Suite Variable ${original_ntp}
+ Rprint Vars original_ntp fmt=terse
+ # The following patch command should set the ["NTP"]["ProtocolEnabled"] property to "True".
+ Redfish.Patch ${REDFISH_NW_PROTOCOL_URI} body={u'NTPEnabled': ${True}}
+ ${ntp}= Redfish.Get Attribute ${REDFISH_NW_PROTOCOL_URI} NTP
+ Rprint Vars ntp fmt=terse
+ Rvalid Value ntp["ProtocolEnabled"] valid_values=[True]
+
+
*** Keywords ***
Test Teardown Execution
[Documentation] Do the post test teardown.
FFDC On Test Case Fail
- redfish.Logout
Redfish Get DateTime
@@ -137,3 +154,20 @@
${data}= Create Dictionary data=${BMC_OWNER}
Write Attribute ${TIME_MANAGER_URI}owner TimeOwner data=${data} verify=${TRUE}
+Restore NTP Mode
+ [Documentation] Restore the original NTP mode.
+
+
+ Return From Keyword If &{original_ntp} == &{EMPTY}
+ Print Timen Restore NTP Mode.
+ Redfish.Patch ${REDFISH_NW_PROTOCOL_URI}
+ ... body={u'NTPEnabled': ${original_ntp["ProtocolEnabled"]}}
+
+
+Suite Setup Execution
+ [Documentation] Do the suite level setup.
+
+ Printn
+ Redfish.Login
+
+