blob: 021523452b78c953b12ee7f7d3f57e4d729cb034 [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
12... │   └── 20160909102538035251_ffdc_report.txt
13... └── test_history.txt
George Keishing4346a412016-07-19 11:26:49 -050014
George Keishing69e6f712016-09-12 06:30:09 -050015Resource openbmc_ffdc_methods.robot
16Resource openbmc_ffdc_utils.robot
George Keishing4346a412016-07-19 11:26:49 -050017
18*** Keywords ***
19
20Log FFDC
21 [Documentation] Generic FFDC entry point. Place holder to hook in
George Keishing69e6f712016-09-12 06:30:09 -050022 ... 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 Keishing4346a412016-07-19 11:26:49 -050028
George Keishing69e6f712016-09-12 06:30:09 -050029 Run Keyword If '${TEST_STATUS}' == 'FAIL'
30 ... Log FFDC If Test Case Failed
31
32 Log Test Case Status
George Keishing4346a412016-07-19 11:26:49 -050033
34
35Log FFDC If Test Case Failed
36 [Documentation] Main entry point to gather logs on Test case failure
George Keishing69e6f712016-09-12 06:30:09 -050037 ... 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 Keishing4346a412016-07-19 11:26:49 -050041
George Keishing69e6f712016-09-12 06:30:09 -050042 ${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 Keishing4346a412016-07-19 11:26:49 -050045
George Keishing4346a412016-07-19 11:26:49 -050046 # Log directory setup
George Keishing69e6f712016-09-12 06:30:09 -050047 ${suitename} ${testname}= Get Test Dir and Name
George Keishing4346a412016-07-19 11:26:49 -050048
George Keishing69e6f712016-09-12 06:30:09 -050049 Set Global Variable
50 ... ${FFDC_DIR_PATH} ${FFDC_LOG_PATH}${suitename}${/}${testname}
George Keishing4346a412016-07-19 11:26:49 -050051
George Keishing69e6f712016-09-12 06:30:09 -050052 ${prefix}= Catenate SEPARATOR= ${FFDC_DIR_PATH}${/} ${FFDC_TIME}_
53 Set Global Variable ${LOG_PREFIX} ${prefix}
54
55 Create FFDC Directory
56 Header Message
George Keishing4346a412016-07-19 11:26:49 -050057
58 # -- FFDC processing entry point --
George Keishing69e6f712016-09-12 06:30:09 -050059 Call FFDC Methods
George Keishing4346a412016-07-19 11:26:49 -050060
George Keishing69e6f712016-09-12 06:30:09 -050061 ${cur_time}= Get Current Time Stamp
George Keishing4346a412016-07-19 11:26:49 -050062 Log To Console FFDC Collection Completed \t: ${cur_time}
63 Log ${\n}${FFDC_DIR_PATH}