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