blob: f2dfc8fb0b423cc055f34832fdc139956e09004d [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 Mills50070fa2016-11-14 11:17:30 -060010... │   ├── 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 Millsaca140d2016-10-26 13:05:10 -050017... │   ├── 20160909102538035251_BMC_general.txt
Gunnar Mills50070fa2016-11-14 11:17:30 -060018... │   ├── 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
Sweta Potthuri92e7b132017-03-17 06:02:32 -050028... │   ├── 20160909102538035251_OS_secure.txt
29... │   └── 20160909102538035251_OS_esel
George Keishing69e6f712016-09-12 06:30:09 -050030... └── test_history.txt
George Keishing4346a412016-07-19 11:26:49 -050031
George Keishing69e6f712016-09-12 06:30:09 -050032Resource openbmc_ffdc_methods.robot
33Resource openbmc_ffdc_utils.robot
George Keishing6a6e76d2017-09-14 08:19:17 -050034Resource dump_utils.robot
Michael Walsh769c2a12016-12-13 15:45:17 -060035Library openbmc_ffdc.py
Peter D Phan5e56f522021-12-20 13:19:41 -060036Library ffdc_cli_robot_script.py
George Keishing4346a412016-07-19 11:26:49 -050037
38*** Keywords ***
39
Gunnar Millseac1af22016-11-14 15:30:09 -060040FFDC On Test Case Fail
George Keishing4346a412016-07-19 11:26:49 -050041 [Documentation] Generic FFDC entry point. Place holder to hook in
George Keishing69e6f712016-09-12 06:30:09 -050042 ... other data collection methods
Rahul Maheshwari09439a22017-02-23 01:10:05 -060043 ... 1. Collect Logs if test fails or host reaches quiesced
44 ... state.
George Keishing6a6e76d2017-09-14 08:19:17 -050045 ... 2. Added test execution history logging.
George Keishing69e6f712016-09-12 06:30:09 -050046 ... By default this will log Test status PASS/FAIL format
47 ... EX: 20160822041250932049:Test:Test case 1:PASS
48 ... 20160822041250969913:Test:Test case 2:FAIL
George Keishing6a6e76d2017-09-14 08:19:17 -050049 ... 3. Delete error logs and BMC dumps post FFDC collection.
George Keishing4346a412016-07-19 11:26:49 -050050
George Keishing7f0dd252019-04-29 02:02:59 -050051 ${OVERRIDE_FFDC_ON_TEST_CASE_FAIL}= Get Environment Variable OVERRIDE_FFDC_ON_TEST_CASE_FAIL 0
Michael Walshfa84c8f2019-04-24 16:44:49 -050052 ${OVERRIDE_FFDC_ON_TEST_CASE_FAIL}= Convert To Integer ${OVERRIDE_FFDC_ON_TEST_CASE_FAIL}
George Keishing7f0dd252019-04-29 02:02:59 -050053 Return From Keyword If ${OVERRIDE_FFDC_ON_TEST_CASE_FAIL}
Michael Walshfa84c8f2019-04-24 16:44:49 -050054
Peter D Phan5e56f522021-12-20 13:19:41 -060055 Run Keyword If '${TEST_STATUS}' == 'FAIL' Launch FFDC
George Keishing69e6f712016-09-12 06:30:09 -050056
57 Log Test Case Status
Peter D Phan5e56f522021-12-20 13:19:41 -060058
59
60Launch FFDC
61 [Documentation] Call point to call FFDC robot or FFDC script.
62 ... FFDC_DEFAULT set to 1, by default, in resource.robot
63 ... FFDC_DEFAULT:1 use legacy ffdc collector
64 ... FFDC_DEFAULT:0 use new ffdc collector.
65
66 Run Keyword If ${FFDC_DEFAULT} == ${1} FFDC # Keyword from openbmc_ffdc.py
67 ... ELSE ffdc_robot_script_cli # Keyword from ffdc_cli_robot_script.py
68