Remote logging API values combination test
Changes:
- Test to verify valid combinations.
- Test to verify invalid combinations.
Change-Id: Ice09c7ddfb295cba915b23d45378751dd3d54a06
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/remote_logging/test_remote_logging.robot b/remote_logging/test_remote_logging.robot
index 7acf8d9..1f0c4ac 100644
--- a/remote_logging/test_remote_logging.robot
+++ b/remote_logging/test_remote_logging.robot
@@ -96,6 +96,34 @@
... msg=${bmc_journald} doesn't contains REST entries.
+Test Remote API Valid Config Combination
+ [Documentation] Verify valid combination of address and port.
+ [Tags] Test_Remote_API_Valid_Config_Combination
+ [Template] Verify Configure Remote Logging Server
+ # Forego normal test setup:
+ [Setup] No Operation
+
+ # Address Port Expected result
+ ${EMPTY} ${REMOTE_LOG_SERVER_PORT} ${True}
+ ${REMOTE_LOG_SERVER_HOST} ${REMOTE_LOG_SERVER_PORT} ${True}
+ remotelog.xzy.com ${REMOTE_LOG_SERVER_PORT} ${True}
+ ${REMOTE_LOG_SERVER_HOST} ${0} ${True}
+
+
+Test Remote API Invalid Config Combination
+ [Documentation] Verify invalid combination of address and port.
+ [Tags] Test_Remote_API_Invalid_Config_Combination
+ [Template] Verify Configure Remote Logging Server
+ # Forego normal test setup:
+ [Setup] No Operation
+
+ # Address Port Expected result
+ ${0} ${REMOTE_LOG_SERVER_PORT} ${False}
+ "0" ${REMOTE_LOG_SERVER_PORT} ${False}
+ ${REMOTE_LOG_SERVER_HOST} ${EMPTY} ${False}
+ ${REMOTE_LOG_SERVER_HOST} "0" ${False}
+
+
Test Remote Logging REST Interface And Verify Config
[Documentation] Test remote logging interface and configuration.
[Tags] Test_Remote_Logging_REST_Interface_And_Verify_Config
@@ -297,3 +325,21 @@
${resp}= OpenBMC Get Request ${REMOTE_LOGGING_URI}
Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
+
+
+Verify Configure Remote Logging Server
+ [Documentation] Configure the remote logging REST interface on BMC.
+ [Arguments] ${remote_host} ${remote_port} ${expectation}
+
+ # Description of argument(s):
+ # remote_host The host name or IP address of the remote logging server
+ # (e.g. "xx.xx.xx.xx").
+ # remote_port Remote ryslog server port number (e.g. "514").
+ # expectation Expect boolean True/False.
+
+
+ ${status}= Run Keyword And Return Status
+ ... Configure Remote Logging Server remote_host=${remote_host} remote_port=${remote_port}
+
+ Should Be Equal ${status} ${expectation}
+ ... msg=Test result ${status} and expectation ${expectation} do not match.