Sivas SRR | 35b0f00 | 2016-07-20 07:49:41 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation 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 SRR | 8254db6 | 2017-02-07 09:39:46 -0600 | [diff] [blame] | 6 | Resource ../lib/utils.robot |
| 7 | Resource ../lib/connection_client.robot |
Sridevi Ramesh | 3be03bc | 2017-01-24 05:03:42 -0600 | [diff] [blame] | 8 | Library OperatingSystem |
| 9 | Library DateTime |
Sivas SRR | 35b0f00 | 2016-07-20 07:49:41 -0500 | [diff] [blame] | 10 | |
Sivas SRR | 8254db6 | 2017-02-07 09:39:46 -0600 | [diff] [blame] | 11 | Suite Setup Open Connection And Log In |
| 12 | Suite Teardown Close All Connections |
| 13 | |
Sweta Potthuri | 5db43e4 | 2017-06-15 05:36:44 -0500 | [diff] [blame] | 14 | Force Tags Full_Suite_Regression |
| 15 | |
Sivas SRR | 35b0f00 | 2016-07-20 07:49:41 -0500 | [diff] [blame] | 16 | *** Variables *** |
Sridevi Ramesh | 3be03bc | 2017-01-24 05:03:42 -0600 | [diff] [blame] | 17 | ${ITERATION} 10 |
| 18 | ${RESULT_DIR_NAME} logsdir |
| 19 | ${LOOP_TEST_COMMAND} tests |
Sivas SRR | 35b0f00 | 2016-07-20 07:49:41 -0500 | [diff] [blame] | 20 | |
| 21 | *** Test Cases *** |
Sivas SRR | 8254db6 | 2017-02-07 09:39:46 -0600 | [diff] [blame] | 22 | Validate 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 SRR | 35b0f00 | 2016-07-20 07:49:41 -0500 | [diff] [blame] | 29 | Run Entire Test Suite Multiple Time |
| 30 | [Documentation] Multiple iterations of Full Suite |
| 31 | |
| 32 | Should Be True 0<${ITERATION} |
Sridevi Ramesh | 3be03bc | 2017-01-24 05:03:42 -0600 | [diff] [blame] | 33 | |
| 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 | |
Sushil Singh | ab209cd | 2020-07-01 09:01:14 -0500 | [diff] [blame] | 40 | FOR ${INDEX} IN RANGE 0 ${ITERATION} |
| 41 | Log To Console \n Iteration: no_newline=True |
| 42 | Log To Console ${INDEX} |
| 43 | Run OPENBMC_HOST=${OPENBMC_HOST} tox -e ${OPENBMC_SYSTEMMODEL} -- ${LOOP_TEST_COMMAND} |
| 44 | Run sed -i 's/'${OPENBMC_HOST}'/DUMMYIP/g' output.xml |
| 45 | Copy File output.xml ${RESULT_DIR_PATH}/output${INDEX}.xml |
| 46 | Copy File log.html ${RESULT_DIR_PATH}/log${INDEX}.html |
| 47 | END |
| 48 | |
Sivas SRR | 35b0f00 | 2016-07-20 07:49:41 -0500 | [diff] [blame] | 49 | |
| 50 | Create Combined Report |
Sridevi Ramesh | 3be03bc | 2017-01-24 05:03:42 -0600 | [diff] [blame] | 51 | [Documentation] Using output[?].xml and create combined log.html |
Sivas SRR | 451d842 | 2017-02-26 22:32:40 -0600 | [diff] [blame] | 52 | [Tags] Create_Combined_Report |
Sivas SRR | 35b0f00 | 2016-07-20 07:49:41 -0500 | [diff] [blame] | 53 | |
Sridevi Ramesh | 3be03bc | 2017-01-24 05:03:42 -0600 | [diff] [blame] | 54 | Run rebot --name ${OPENBMC_SYSTEMMODEL}CombinedReport ${RESULT_DIR_PATH}/output*.xml |
Sivas SRR | 451d842 | 2017-02-26 22:32:40 -0600 | [diff] [blame] | 55 | |
Rahul Maheshwari | 195c0a1 | 2017-06-22 05:40:14 -0500 | [diff] [blame] | 56 | ${current_time}= Get Current Date result_format=%Y%m%d%H%M%S |
| 57 | ${combined_report_file}= Catenate SEPARATOR= ${EXECDIR} |
| 58 | ... /logs/CombinedLogReport${current_time}.html |
| 59 | |
Sivas SRR | 451d842 | 2017-02-26 22:32:40 -0600 | [diff] [blame] | 60 | Copy File log.html ${combined_report_file} |
| 61 | |
Rahul Maheshwari | 195c0a1 | 2017-06-22 05:40:14 -0500 | [diff] [blame] | 62 | Run Keyword And Ignore Error Convert HTML To PDF ${combined_report_file} |
Sivas SRR | 451d842 | 2017-02-26 22:32:40 -0600 | [diff] [blame] | 63 | |
| 64 | *** Keywords *** |
| 65 | |
| 66 | Convert HTML To PDF |
| 67 | [Documentation] Convert HTML to PDF in order to support GitHub |
| 68 | ... attachment. |
| 69 | [Arguments] ${combined_report_html_file_path} |
| 70 | # Description of arguments: |
| 71 | # combined_report_html_file_path Combined report file in HTML format. |
| 72 | |
| 73 | Log To Console \n ${combined_report_html_file_path} |
| 74 | ${combined_report_pdf_file_path}= |
| 75 | ... Fetch From Left ${combined_report_html_file_path} . |
| 76 | # Compose combined_report_pdf_file_path. |
| 77 | ${combined_report_pdf_file_path}= Catenate SEPARATOR= |
| 78 | ... ${combined_report_pdf_file_path} .pdf |
| 79 | # wkhtmltopdf tool is to convert HTML to PDF |
| 80 | ${output}= Run which wkhtmltopdf |
| 81 | Should Not Be Empty ${output} |
| 82 | ... msg=wkhtmltopdf not installed, Install from http://wkhtmltopdf.org |
| 83 | ${output}= |
| 84 | ... Run wkhtmltopdf ./${combined_report_html_file_path} ./${combined_report_pdf_file_path} |
| 85 | Should Not Be Empty ${output} |
Sushil Singh | ab209cd | 2020-07-01 09:01:14 -0500 | [diff] [blame] | 86 | OperatingSystem.File Should Exist ${combined_report_pdf_file_path} |