blob: b3105add72ecb7f222675521cacf2f40e97b466a [file] [log] [blame]
Sivas SRR35b0f002016-07-20 07:49:41 -05001*** Settings ***
2Documentation This suite is for testing Open BMC full test suite.
3... Maintains log.html output.xml for each iteration and
4... generate combined report
5
Sivas SRR8254db62017-02-07 09:39:46 -06006Resource ../lib/utils.robot
7Resource ../lib/connection_client.robot
Sridevi Ramesh3be03bc2017-01-24 05:03:42 -06008Library OperatingSystem
9Library DateTime
Sivas SRR35b0f002016-07-20 07:49:41 -050010
Sivas SRR8254db62017-02-07 09:39:46 -060011Suite Setup Open Connection And Log In
12Suite Teardown Close All Connections
13
Sivas SRR35b0f002016-07-20 07:49:41 -050014*** Variables ***
Sridevi Ramesh3be03bc2017-01-24 05:03:42 -060015${ITERATION} 10
16${RESULT_DIR_NAME} logsdir
17${LOOP_TEST_COMMAND} tests
Sivas SRR35b0f002016-07-20 07:49:41 -050018
19*** Test Cases ***
Sivas SRR8254db62017-02-07 09:39:46 -060020Validate BMC Model
21 [Documentation] Check that OPENBMC_MODEL is correct.
22 [Tags] Validate_BMC_Model
23 ${bmc_model}= Get BMC System Model
24 ${status}= Verify BMC System Model ${bmc_model}
25 Run Keyword If '${status}'=='False' Fatal Error Wrong System
26
Sivas SRR35b0f002016-07-20 07:49:41 -050027Run Entire Test Suite Multiple Time
28 [Documentation] Multiple iterations of Full Suite
29
30 Should Be True 0<${ITERATION}
Sridevi Ramesh3be03bc2017-01-24 05:03:42 -060031
32 ${timestamp}= Get Current Date result_format=%Y%m%d%H%M%S
33 ${tmp_result_dir_path}= Catenate ${RESULT_DIR_NAME}${timestamp}
34 Set Suite Variable ${RESULT_DIR_PATH} ${tmp_result_dir_path}
35 Log To Console ${RESULT_DIR_PATH}
36 Create Directory ${RESULT_DIR_PATH}
37
Sivas SRR35b0f002016-07-20 07:49:41 -050038 : FOR ${INDEX} IN RANGE 0 ${ITERATION}
Sridevi Ramesh3be03bc2017-01-24 05:03:42 -060039 \ Log To Console \n Iteration: no_newline=True
40 \ Log To Console ${INDEX}
Sivas SRR594a6c92016-10-31 01:40:32 -050041 \ Run OPENBMC_HOST=${OPENBMC_HOST} tox -e ${OPENBMC_SYSTEMMODEL} -- ${LOOP_TEST_COMMAND}
42 \ Run sed -i 's/'${OPENBMC_HOST}'/DUMMYIP/g' output.xml
Sridevi Ramesh3be03bc2017-01-24 05:03:42 -060043 \ Copy File output.xml ${RESULT_DIR_PATH}/output${INDEX}.xml
44 \ Copy File log.html ${RESULT_DIR_PATH}/log${INDEX}.html
Sivas SRR35b0f002016-07-20 07:49:41 -050045
46Create Combined Report
Sridevi Ramesh3be03bc2017-01-24 05:03:42 -060047 [Documentation] Using output[?].xml and create combined log.html
Sivas SRR451d8422017-02-26 22:32:40 -060048 [Tags] Create_Combined_Report
Sivas SRR35b0f002016-07-20 07:49:41 -050049
Sridevi Ramesh3be03bc2017-01-24 05:03:42 -060050 Run rebot --name ${OPENBMC_SYSTEMMODEL}CombinedReport ${RESULT_DIR_PATH}/output*.xml
Sivas SRR451d8422017-02-26 22:32:40 -060051
52 ${combined_report_file}= Catenate SEPARATOR= ${RESULT_DIR_PATH}
53 ... /log${OPENBMC_SYSTEMMODEL}CombinedIterations ${ITERATION}Report.html
54 Copy File log.html ${combined_report_file}
55
56 Convert HTML To PDF ${combined_report_file}
57
58*** Keywords ***
59
60Convert HTML To PDF
61 [Documentation] Convert HTML to PDF in order to support GitHub
62 ... attachment.
63 [Arguments] ${combined_report_html_file_path}
64 # Description of arguments:
65 # combined_report_html_file_path Combined report file in HTML format.
66
67 Log To Console \n ${combined_report_html_file_path}
68 ${combined_report_pdf_file_path}=
69 ... Fetch From Left ${combined_report_html_file_path} .
70 # Compose combined_report_pdf_file_path.
71 ${combined_report_pdf_file_path}= Catenate SEPARATOR=
72 ... ${combined_report_pdf_file_path} .pdf
73 # wkhtmltopdf tool is to convert HTML to PDF
74 ${output}= Run which wkhtmltopdf
75 Should Not Be Empty ${output}
76 ... msg=wkhtmltopdf not installed, Install from http://wkhtmltopdf.org
77 ${output}=
78 ... Run wkhtmltopdf ./${combined_report_html_file_path} ./${combined_report_pdf_file_path}
79 Should Not Be Empty ${output}
80 OperatingSystem.File Should Exist ${combined_report_pdf_file_path}
81
82