blob: 4cd031c400f4ff327181152f6648a8793672149d [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
Sweta Potthuri5db43e42017-06-15 05:36:44 -050014Force Tags Full_Suite_Regression
15
Sivas SRR35b0f002016-07-20 07:49:41 -050016*** Variables ***
Sridevi Ramesh3be03bc2017-01-24 05:03:42 -060017${ITERATION} 10
18${RESULT_DIR_NAME} logsdir
19${LOOP_TEST_COMMAND} tests
Sivas SRR35b0f002016-07-20 07:49:41 -050020
21*** Test Cases ***
Sivas SRR8254db62017-02-07 09:39:46 -060022Validate BMC Model
23 [Documentation] Check that OPENBMC_MODEL is correct.
24 [Tags] Validate_BMC_Model
25 ${bmc_model}= Get BMC System Model
26 ${status}= Verify BMC System Model ${bmc_model}
27 Run Keyword If '${status}'=='False' Fatal Error Wrong System
28
Sivas SRR35b0f002016-07-20 07:49:41 -050029Run Entire Test Suite Multiple Time
30 [Documentation] Multiple iterations of Full Suite
31
32 Should Be True 0<${ITERATION}
Sridevi Ramesh3be03bc2017-01-24 05:03:42 -060033
34 ${timestamp}= Get Current Date result_format=%Y%m%d%H%M%S
35 ${tmp_result_dir_path}= Catenate ${RESULT_DIR_NAME}${timestamp}
36 Set Suite Variable ${RESULT_DIR_PATH} ${tmp_result_dir_path}
37 Log To Console ${RESULT_DIR_PATH}
38 Create Directory ${RESULT_DIR_PATH}
39
Sivas SRR35b0f002016-07-20 07:49:41 -050040 : FOR ${INDEX} IN RANGE 0 ${ITERATION}
Sridevi Ramesh3be03bc2017-01-24 05:03:42 -060041 \ Log To Console \n Iteration: no_newline=True
42 \ Log To Console ${INDEX}
Sivas SRR594a6c92016-10-31 01:40:32 -050043 \ Run OPENBMC_HOST=${OPENBMC_HOST} tox -e ${OPENBMC_SYSTEMMODEL} -- ${LOOP_TEST_COMMAND}
44 \ Run sed -i 's/'${OPENBMC_HOST}'/DUMMYIP/g' output.xml
Sridevi Ramesh3be03bc2017-01-24 05:03:42 -060045 \ Copy File output.xml ${RESULT_DIR_PATH}/output${INDEX}.xml
46 \ Copy File log.html ${RESULT_DIR_PATH}/log${INDEX}.html
Sivas SRR35b0f002016-07-20 07:49:41 -050047
48Create Combined Report
Sridevi Ramesh3be03bc2017-01-24 05:03:42 -060049 [Documentation] Using output[?].xml and create combined log.html
Sivas SRR451d8422017-02-26 22:32:40 -060050 [Tags] Create_Combined_Report
Sivas SRR35b0f002016-07-20 07:49:41 -050051
Sridevi Ramesh3be03bc2017-01-24 05:03:42 -060052 Run rebot --name ${OPENBMC_SYSTEMMODEL}CombinedReport ${RESULT_DIR_PATH}/output*.xml
Sivas SRR451d8422017-02-26 22:32:40 -060053
54 ${combined_report_file}= Catenate SEPARATOR= ${RESULT_DIR_PATH}
55 ... /log${OPENBMC_SYSTEMMODEL}CombinedIterations ${ITERATION}Report.html
56 Copy File log.html ${combined_report_file}
57
58 Convert HTML To PDF ${combined_report_file}
59
60*** Keywords ***
61
62Convert HTML To PDF
63 [Documentation] Convert HTML to PDF in order to support GitHub
64 ... attachment.
65 [Arguments] ${combined_report_html_file_path}
66 # Description of arguments:
67 # combined_report_html_file_path Combined report file in HTML format.
68
69 Log To Console \n ${combined_report_html_file_path}
70 ${combined_report_pdf_file_path}=
71 ... Fetch From Left ${combined_report_html_file_path} .
72 # Compose combined_report_pdf_file_path.
73 ${combined_report_pdf_file_path}= Catenate SEPARATOR=
74 ... ${combined_report_pdf_file_path} .pdf
75 # wkhtmltopdf tool is to convert HTML to PDF
76 ${output}= Run which wkhtmltopdf
77 Should Not Be Empty ${output}
78 ... msg=wkhtmltopdf not installed, Install from http://wkhtmltopdf.org
79 ${output}=
80 ... Run wkhtmltopdf ./${combined_report_html_file_path} ./${combined_report_pdf_file_path}
81 Should Not Be Empty ${output}
82 OperatingSystem.File Should Exist ${combined_report_pdf_file_path}
83
84