Modify library method and testcase for DMTF usercase
There two objectives with this change:
1.Test case executed python command file
'Redfish-Usecase-Checkers/account_management/account_management.py';
with unrecognized arguments. This is corrected.
2.When any use case/test case (inside the python command file 'account_management.py')
fails, just failure message comes without any information on failed test cases.
This is fixed now.
Change-Id: Ic99dc5b7a20af631d6459025029b6db5dea305bb
Signed-off-by: Manash Sarma <manashsarma@in.ibm.com>
diff --git a/lib/dmtf_tools_utils.robot b/lib/dmtf_tools_utils.robot
index 5b175ff..1fb538f 100644
--- a/lib/dmtf_tools_utils.robot
+++ b/lib/dmtf_tools_utils.robot
@@ -27,13 +27,14 @@
Run DMTF Tool
[Documentation] Execution of the command.
- [Arguments] ${rsv_dir_path} ${command_string}
+ [Arguments] ${rsv_dir_path} ${command_string} ${check_error}=0
# 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.
+ # check_error It decides if error information is to be checked.
- ${rc} ${output}= Shell Cmd ${command_string}
+ ${rc} ${output}= Shell Cmd ${command_string} ignore_err=${check_error}
Log ${output}
[Return] ${output}
diff --git a/redfish/dmtf_tools/Redfish_Usecase_Checkers.robot b/redfish/dmtf_tools/Redfish_Usecase_Checkers.robot
index 09620a6..0f85702 100644
--- a/redfish/dmtf_tools/Redfish_Usecase_Checkers.robot
+++ b/redfish/dmtf_tools/Redfish_Usecase_Checkers.robot
@@ -19,11 +19,11 @@
${command_account} ${DEFAULT_PYTHON} ${rsv_dir_path}${/}account_management/account_management.py
... -r ${OPENBMC_HOST} -u ${OPENBMC_USERNAME}
-... -p ${OPENBMC_PASSWORD} -S Always -d ${EXECDIR}${/}logs${/} -v
+... -p ${OPENBMC_PASSWORD} -S Always -d ${EXECDIR}${/}logs${/}
${command_power_control} ${DEFAULT_PYTHON} ${rsv_dir_path}${/}power_control/power_control.py
... -r ${OPENBMC_HOST} -u ${OPENBMC_USERNAME}
-... -p ${OPENBMC_PASSWORD} -S Always --F
+... -p ${OPENBMC_PASSWORD} -S Always
${power_on_timeout} 15 mins
${power_off_timeout} 15 mins
@@ -35,11 +35,27 @@
[Documentation] Check Account Management with a Redfish interface.
[Tags] Test_BMC_Redfish_Account_Management
- ${output}= Run DMTF Tool ${rsv_dir_path} ${command_account}
+ ${output}= Run DMTF Tool ${rsv_dir_path} ${command_account} check_error=1
${output}= Shell Cmd cat ${EXECDIR}${/}logs${/}results.json
Log ${output}
+ ${json}= OperatingSystem.Get File ${EXECDIR}${/}logs${/}results.json
+
+ ${object}= Evaluate json.loads('''${json}''') json
+
+ ${result_list}= Set Variable ${object["TestResults"]}
+
+ @{failed_tc_list}= Create List
+
+ FOR ${result} IN @{result_list}
+ ${rc}= evaluate 'ErrorMessages'=='${result}'
+ ${num}= Run Keyword If ${rc} == False Set Variable ${result_list["${result}"]["fail"]}
+ Run Keyword If ${num} != None and ${num} > 0 Append To List ${failed_tc_list} ${result}
+ END
+
+ Should Be Empty ${failed_tc_list} Failed test cases are ${failed_tc_list}
+
Test BMC Redfish Boot Host And ForceOff
[Documentation] Boot host and ForceOff.