blob: c9440b8f8cd6371154ecfe3d95f8bdf91a52fd9f [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
10... │   ├── 20160909102538035251_BMC_journalctl.log
11... │   ├── 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
George Keishing69e6f712016-09-12 06:30:09 -050017... │   └── 20160909102538035251_ffdc_report.txt
18... └── test_history.txt
George Keishing4346a412016-07-19 11:26:49 -050019
George Keishing69e6f712016-09-12 06:30:09 -050020Resource openbmc_ffdc_methods.robot
21Resource openbmc_ffdc_utils.robot
George Keishing4346a412016-07-19 11:26:49 -050022
23*** Keywords ***
24
25Log FFDC
26 [Documentation] Generic FFDC entry point. Place holder to hook in
George Keishing69e6f712016-09-12 06:30:09 -050027 ... 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 Keishing4346a412016-07-19 11:26:49 -050033
George Keishing69e6f712016-09-12 06:30:09 -050034 Run Keyword If '${TEST_STATUS}' == 'FAIL'
35 ... Log FFDC If Test Case Failed
36
37 Log Test Case Status
George Keishing4346a412016-07-19 11:26:49 -050038
39
40Log FFDC If Test Case Failed
41 [Documentation] Main entry point to gather logs on Test case failure
George Keishing69e6f712016-09-12 06:30:09 -050042 ... 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 Keishing4346a412016-07-19 11:26:49 -050046
George Keishing69e6f712016-09-12 06:30:09 -050047 ${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 Keishing4346a412016-07-19 11:26:49 -050050
George Keishing4346a412016-07-19 11:26:49 -050051 # Log directory setup
George Keishing69e6f712016-09-12 06:30:09 -050052 ${suitename} ${testname}= Get Test Dir and Name
George Keishing4346a412016-07-19 11:26:49 -050053
George Keishing69e6f712016-09-12 06:30:09 -050054 Set Global Variable
55 ... ${FFDC_DIR_PATH} ${FFDC_LOG_PATH}${suitename}${/}${testname}
George Keishing4346a412016-07-19 11:26:49 -050056
George Keishing69e6f712016-09-12 06:30:09 -050057 ${prefix}= Catenate SEPARATOR= ${FFDC_DIR_PATH}${/} ${FFDC_TIME}_
58 Set Global Variable ${LOG_PREFIX} ${prefix}
59
60 Create FFDC Directory
61 Header Message
George Keishing4346a412016-07-19 11:26:49 -050062
63 # -- FFDC processing entry point --
George Keishing69e6f712016-09-12 06:30:09 -050064 Call FFDC Methods
George Keishing4346a412016-07-19 11:26:49 -050065
George Keishing69e6f712016-09-12 06:30:09 -050066 ${cur_time}= Get Current Time Stamp
George Keishing4346a412016-07-19 11:26:49 -050067 Log To Console FFDC Collection Completed \t: ${cur_time}
68 Log ${\n}${FFDC_DIR_PATH}