DMTF Redfish-Service-Validator tool test
Changes:
- Added test to get Redfish-Service-Validator tool and run.
- Create dmtf lib utils file for other tooling aspect.
Test: On BMC with Master.
Change-Id: I718a475f4f15ebd1d0ade02bfaabf7e585ddc290
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
Signed-off-by: Maksym Yepaneshnikov <Maksym_Yepaneshnikov@jabil.com>
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/dmtf_tools_utils.robot b/lib/dmtf_tools_utils.robot
new file mode 100644
index 0000000..1a406d0
--- /dev/null
+++ b/lib/dmtf_tools_utils.robot
@@ -0,0 +1,39 @@
+*** Settings ***
+Documentation DMTF tools utility keywords.
+
+Resource resource.robot
+Library gen_cmd.py
+
+*** Variables ***
+
+# ignore_err controls Shell Cmd behavior.
+${ignore_err} ${0}
+
+*** Keywords ***
+
+Download DMTF Tool
+ [Documentation] Git clone tool.
+ [Arguments] ${rsv_dir_path} ${rsv_github_url}
+
+ # Description of arguments:
+ # rsv_dir_path Directory path for rsv tool (e.g. "Redfish-Service-Validator").
+ # rsv_github_url Github URL link(e.g "https://github.com/DMTF/Redfish-Service-Validator").
+
+ ${rc} ${output}= Shell Cmd rm -rf ${rsv_dir_path} ; git clone ${rsv_github_url} ${rsv_dir_path}
+ Log ${output}
+
+
+Run DMTF Tool
+ [Documentation] Execution of the command.
+ [Arguments] ${rsv_dir_path} ${command_string}
+
+ # Description of arguments:
+ # rsv_dir_path Directory path for rsv tool (e.g. "Redfish-Service-Validator").
+ # command_string The complete rsv command string to be run.
+
+ ${rc} ${output}= Shell Cmd ${command_string}
+ Log ${output}
+
+ # Example:
+ # Validation has failed: 9 problems found
+ Should Not Contain ${output} Validation has failed
diff --git a/redfish/dmtf_tools/Redfish-Service-Validator.robot b/redfish/dmtf_tools/Redfish-Service-Validator.robot
new file mode 100644
index 0000000..5d8e9f6
--- /dev/null
+++ b/redfish/dmtf_tools/Redfish-Service-Validator.robot
@@ -0,0 +1,25 @@
+*** Settings ***
+Documentation Test BMC using https://github.com/DMTF/Redfish-Service-Validator.
+... DMTF tool.
+
+Library OperatingSystem
+Resource ../../lib/dmtf_tools_utils.robot
+
+*** Variables ***
+
+${DEFAULT_PYTHON} python3
+${rsv_dir_path} Redfish-Service-Validator
+${rsv_github_url} https://github.com/DMTF/Redfish-Service-Validator.git
+${command_string} ${DEFAULT_PYTHON} ${rsv_dir_path}${/}RedfishServiceValidator.py
+... --ip ${OPENBMC_HOST} --nochkcert --forceauth -u ${OPENBMC_USERNAME}
+... -p ${OPENBMC_PASSWORD} --logdir ${EXECDIR}${/}logs${/} --debug_logging
+
+*** Test Case ***
+
+Test BMC Redfish Using Redfish Service Validator
+ [Documentation] Check conformance with a Redfish service interface.
+ [Tags] Test_BMC_Redfish_Using_Redfish_Service_Validator
+
+ Download DMTF Tool ${rsv_dir_path} ${rsv_github_url}
+
+ Run DMTF Tool ${rsv_dir_path} ${command_string}