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