blob: 1f7caff45fc081939432f54042af737e044835e5 [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
Gunnar Mills7e2cda22016-10-11 15:37:34 -050017... │   ├── 20160909102538035251_OS_dmesg
18... │   ├── 20160909102538035251_OS_msglog
19... │   ├── 20160909102538035251_OS_cpufrequency
20... │   ├── 20160909102538035251_OS_boot
George Keishing69e6f712016-09-12 06:30:09 -050021... │   └── 20160909102538035251_ffdc_report.txt
22... └── test_history.txt
George Keishing4346a412016-07-19 11:26:49 -050023
George Keishing69e6f712016-09-12 06:30:09 -050024Resource openbmc_ffdc_methods.robot
25Resource openbmc_ffdc_utils.robot
George Keishing4346a412016-07-19 11:26:49 -050026
27*** Keywords ***
28
29Log FFDC
30 [Documentation] Generic FFDC entry point. Place holder to hook in
George Keishing69e6f712016-09-12 06:30:09 -050031 ... other data collection methods
32 ... 1. Collect Logs if test fails
33 ... 2. Added Test execution history logging
34 ... By default this will log Test status PASS/FAIL format
35 ... EX: 20160822041250932049:Test:Test case 1:PASS
36 ... 20160822041250969913:Test:Test case 2:FAIL
George Keishing4346a412016-07-19 11:26:49 -050037
George Keishing69e6f712016-09-12 06:30:09 -050038 Run Keyword If '${TEST_STATUS}' == 'FAIL'
39 ... Log FFDC If Test Case Failed
40
41 Log Test Case Status
George Keishing4346a412016-07-19 11:26:49 -050042
43
44Log FFDC If Test Case Failed
45 [Documentation] Main entry point to gather logs on Test case failure
George Keishing69e6f712016-09-12 06:30:09 -050046 ... 1. Set global FFDC time reference for a failure
47 ... 2. Create FFDC work space directory
48 ... 3. Write test info details
49 ... 4. Calls BMC methods to write/collect FFDC data
George Keishing4346a412016-07-19 11:26:49 -050050
George Keishing69e6f712016-09-12 06:30:09 -050051 ${cur_time}= Get Current Time Stamp
52 Set Global Variable ${FFDC_TIME} ${cur_time}
53 Log To Console ${\n}FFDC Collection Started \t: ${cur_time}
George Keishing4346a412016-07-19 11:26:49 -050054
George Keishing4346a412016-07-19 11:26:49 -050055 # Log directory setup
George Keishing69e6f712016-09-12 06:30:09 -050056 ${suitename} ${testname}= Get Test Dir and Name
George Keishing4346a412016-07-19 11:26:49 -050057
George Keishing69e6f712016-09-12 06:30:09 -050058 Set Global Variable
59 ... ${FFDC_DIR_PATH} ${FFDC_LOG_PATH}${suitename}${/}${testname}
George Keishing4346a412016-07-19 11:26:49 -050060
George Keishing69e6f712016-09-12 06:30:09 -050061 ${prefix}= Catenate SEPARATOR= ${FFDC_DIR_PATH}${/} ${FFDC_TIME}_
62 Set Global Variable ${LOG_PREFIX} ${prefix}
63
64 Create FFDC Directory
65 Header Message
George Keishing4346a412016-07-19 11:26:49 -050066
67 # -- FFDC processing entry point --
George Keishing69e6f712016-09-12 06:30:09 -050068 Call FFDC Methods
George Keishing4346a412016-07-19 11:26:49 -050069
George Keishing69e6f712016-09-12 06:30:09 -050070 ${cur_time}= Get Current Time Stamp
George Keishing4346a412016-07-19 11:26:49 -050071 Log To Console FFDC Collection Completed \t: ${cur_time}
72 Log ${\n}${FFDC_DIR_PATH}