blob: b8dc73be0fc5387b02bfeb2d7d31c859eab53bbf [file] [log] [blame]
George Keishing4346a412016-07-19 11:26:49 -05001*** Settings ***
George Keishing69e6f712016-09-12 06:30:09 -05002Documentation 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 Millsaca140d2016-10-26 13:05:10 -050010... │   ├── 20160909102538035251_BMC_journalctl
George Keishing69e6f712016-09-12 06:30:09 -050011... │   ├── 20160909102538035251_BMC_proc_list
Gunnar Millsa812e0f2016-09-29 20:30:03 -050012... │   ├── 20160909102538035251_BMC_dmesg
13... │   ├── 20160909102538035251_BMC_inventory
14... │   ├── 20160909102538035251_BMC_led
15... │   ├── 20160909102538035251_BMC_record_log
16... │   ├── 20160909102538035251_BMC_sensor_list
Gunnar Millsaca140d2016-10-26 13:05:10 -050017... │   ├── 20160909102538035251_BMC_general.txt
Gunnar Mills7e2cda22016-10-11 15:37:34 -050018... │   ├── 20160909102538035251_OS_dmesg
19... │   ├── 20160909102538035251_OS_msglog
20... │   ├── 20160909102538035251_OS_cpufrequency
21... │   ├── 20160909102538035251_OS_boot
Gunnar Millscce185d2016-10-17 17:04:15 -050022... │   ├── 20160909102538035251_OS_isusb
23... │   ├── 20160909102538035251_OS_kern
24... │   ├── 20160909102538035251_OS_authlog
25... │   ├── 20160909102538035251_OS_syslog
26... │   ├── 20160909102538035251_OS_info
27... │   ├── 20160909102538035251_OS_rsct
Gunnar Millsaca140d2016-10-26 13:05:10 -050028... │   └── 20160909102538035251_OS_secure
George Keishing69e6f712016-09-12 06:30:09 -050029... └── test_history.txt
George Keishing4346a412016-07-19 11:26:49 -050030
George Keishing69e6f712016-09-12 06:30:09 -050031Resource openbmc_ffdc_methods.robot
32Resource openbmc_ffdc_utils.robot
George Keishing4346a412016-07-19 11:26:49 -050033
34*** Keywords ***
35
36Log FFDC
37 [Documentation] Generic FFDC entry point. Place holder to hook in
George Keishing69e6f712016-09-12 06:30:09 -050038 ... 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 Keishing4346a412016-07-19 11:26:49 -050044
George Keishing69e6f712016-09-12 06:30:09 -050045 Run Keyword If '${TEST_STATUS}' == 'FAIL'
46 ... Log FFDC If Test Case Failed
47
48 Log Test Case Status
George Keishing4346a412016-07-19 11:26:49 -050049
50
51Log FFDC If Test Case Failed
52 [Documentation] Main entry point to gather logs on Test case failure
George Keishing69e6f712016-09-12 06:30:09 -050053 ... 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 Keishing4346a412016-07-19 11:26:49 -050057
George Keishing69e6f712016-09-12 06:30:09 -050058 ${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 Keishing4346a412016-07-19 11:26:49 -050061
George Keishing4346a412016-07-19 11:26:49 -050062 # Log directory setup
George Keishing69e6f712016-09-12 06:30:09 -050063 ${suitename} ${testname}= Get Test Dir and Name
George Keishing4346a412016-07-19 11:26:49 -050064
George Keishing69e6f712016-09-12 06:30:09 -050065 Set Global Variable
66 ... ${FFDC_DIR_PATH} ${FFDC_LOG_PATH}${suitename}${/}${testname}
George Keishing4346a412016-07-19 11:26:49 -050067
George Keishing69e6f712016-09-12 06:30:09 -050068 ${prefix}= Catenate SEPARATOR= ${FFDC_DIR_PATH}${/} ${FFDC_TIME}_
69 Set Global Variable ${LOG_PREFIX} ${prefix}
70
71 Create FFDC Directory
72 Header Message
George Keishing4346a412016-07-19 11:26:49 -050073
74 # -- FFDC processing entry point --
George Keishing69e6f712016-09-12 06:30:09 -050075 Call FFDC Methods
George Keishing4346a412016-07-19 11:26:49 -050076
George Keishing69e6f712016-09-12 06:30:09 -050077 ${cur_time}= Get Current Time Stamp
George Keishing4346a412016-07-19 11:26:49 -050078 Log To Console FFDC Collection Completed \t: ${cur_time}
79 Log ${\n}${FFDC_DIR_PATH}