George Keishing | 4346a41 | 2016-07-19 11:26:49 -0500 | [diff] [blame] | 1 | *** Settings *** |
George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 2 | Documentation This module is for data collection on test case failure |
| 3 | ... for openbmc systems. Collects data with default name |
| 4 | ... ffdc_report.txt under directory logs/testSuite/testName/ |
| 5 | ... on failure. |
| 6 | ... FFDC logging sample layout: |
| 7 | ... logs |
| 8 | ... ├── 20160909102538035251_TestWarmreset |
| 9 | ... │ └── 20160909102538035251_TestWarmResetviaREST |
| 10 | ... │ ├── 20160909102538035251_BMC_journalctl.log |
| 11 | ... │ ├── 20160909102538035251_BMC_proc_list |
| 12 | ... │ └── 20160909102538035251_ffdc_report.txt |
| 13 | ... └── test_history.txt |
George Keishing | 4346a41 | 2016-07-19 11:26:49 -0500 | [diff] [blame] | 14 | |
George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 15 | Resource openbmc_ffdc_methods.robot |
| 16 | Resource openbmc_ffdc_utils.robot |
George Keishing | 4346a41 | 2016-07-19 11:26:49 -0500 | [diff] [blame] | 17 | |
| 18 | *** Keywords *** |
| 19 | |
| 20 | Log FFDC |
| 21 | [Documentation] Generic FFDC entry point. Place holder to hook in |
George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 22 | ... other data collection methods |
| 23 | ... 1. Collect Logs if test fails |
| 24 | ... 2. Added Test execution history logging |
| 25 | ... By default this will log Test status PASS/FAIL format |
| 26 | ... EX: 20160822041250932049:Test:Test case 1:PASS |
| 27 | ... 20160822041250969913:Test:Test case 2:FAIL |
George Keishing | 4346a41 | 2016-07-19 11:26:49 -0500 | [diff] [blame] | 28 | |
George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 29 | Run Keyword If '${TEST_STATUS}' == 'FAIL' |
| 30 | ... Log FFDC If Test Case Failed |
| 31 | |
| 32 | Log Test Case Status |
George Keishing | 4346a41 | 2016-07-19 11:26:49 -0500 | [diff] [blame] | 33 | |
| 34 | |
| 35 | Log FFDC If Test Case Failed |
| 36 | [Documentation] Main entry point to gather logs on Test case failure |
George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 37 | ... 1. Set global FFDC time reference for a failure |
| 38 | ... 2. Create FFDC work space directory |
| 39 | ... 3. Write test info details |
| 40 | ... 4. Calls BMC methods to write/collect FFDC data |
George Keishing | 4346a41 | 2016-07-19 11:26:49 -0500 | [diff] [blame] | 41 | |
George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 42 | ${cur_time}= Get Current Time Stamp |
| 43 | Set Global Variable ${FFDC_TIME} ${cur_time} |
| 44 | Log To Console ${\n}FFDC Collection Started \t: ${cur_time} |
George Keishing | 4346a41 | 2016-07-19 11:26:49 -0500 | [diff] [blame] | 45 | |
George Keishing | 4346a41 | 2016-07-19 11:26:49 -0500 | [diff] [blame] | 46 | # Log directory setup |
George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 47 | ${suitename} ${testname}= Get Test Dir and Name |
George Keishing | 4346a41 | 2016-07-19 11:26:49 -0500 | [diff] [blame] | 48 | |
George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 49 | Set Global Variable |
| 50 | ... ${FFDC_DIR_PATH} ${FFDC_LOG_PATH}${suitename}${/}${testname} |
George Keishing | 4346a41 | 2016-07-19 11:26:49 -0500 | [diff] [blame] | 51 | |
George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 52 | ${prefix}= Catenate SEPARATOR= ${FFDC_DIR_PATH}${/} ${FFDC_TIME}_ |
| 53 | Set Global Variable ${LOG_PREFIX} ${prefix} |
| 54 | |
| 55 | Create FFDC Directory |
| 56 | Header Message |
George Keishing | 4346a41 | 2016-07-19 11:26:49 -0500 | [diff] [blame] | 57 | |
| 58 | # -- FFDC processing entry point -- |
George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 59 | Call FFDC Methods |
George Keishing | 4346a41 | 2016-07-19 11:26:49 -0500 | [diff] [blame] | 60 | |
George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 61 | ${cur_time}= Get Current Time Stamp |
George Keishing | 4346a41 | 2016-07-19 11:26:49 -0500 | [diff] [blame] | 62 | Log To Console FFDC Collection Completed \t: ${cur_time} |
| 63 | Log ${\n}${FFDC_DIR_PATH} |