如何跳过FFDC

openbmc-test-automation中存在大量测试用例使用了FFDC,尤其是在test teardown中,其作用是当测试用例测试失败时收集当时的环境等信息,以便后续查找原因。但是在很多一些快速测试的场景中,测试失败时收集FFDC会浪费大量的测试时间。

如何解决?

OpenBMC自动化测试框架内置了一个环境变量 OVERRIDE_FFDC_ON_TEST_CASE_FAIL,专门用于控制测试失败时是否触发FFDC收集。

  • 设置为 1:完全禁用失败时的FFDC收集。这是冒烟测试最推荐的方式。

  • 设置为 0:默认状态,启用FFDC收集。

cat lib/openbmc_ffdc.robot

*** Settings ***

Documentation This module is for data collection on test case failure

... for openbmc systems. Collects data with default name

... ffdc_report.txt under directory logs/testSuite/testName/

... on failure.

... FFDC logging sample layout:

... logs

... ├── 20160909102538035251_TestWarmreset

... │ └── 20160909102538035251_TestWarmResetviaREST

... │ ├── 20160909102538035251_BMC_journalctl.txt

... │ ├── 20160909102538035251_BMC_proc_list.txt

... │ ├── 20160909102538035251_BMC_dmesg.txt

... │ ├── 20160909102538035251_BMC_inventory.txt

... │ ├── 20160909102538035251_BMC_led.txt

... │ ├── 20160909102538035251_BMC_record_log.txt

... │ ├── 20160909102538035251_BMC_sensor_list.txt

... │ ├── 20160909102538035251_BMC_general.txt

... │ ├── 20160909102538035251_OS_dmesg.txt

... │ ├── 20160909102538035251_OS_msglog.txt

... │ ├── 20160909102538035251_OS_cpufrequency.txt

... │ ├── 20160909102538035251_OS_boot.txt

... │ ├── 20160909102538035251_OS_isusb.txt

... │ ├── 20160909102538035251_OS_kern.txt

... │ ├── 20160909102538035251_OS_authlog.txt

... │ ├── 20160909102538035251_OS_syslog.txt

... │ ├── 20160909102538035251_OS_info.txt

... │ ├── 20160909102538035251_OS_rsct.txt

... │ ├── 20160909102538035251_OS_secure.txt

... │ └── 20160909102538035251_OS_esel

... └── test_history.txt

Resource openbmc_ffdc_methods.robot

Resource openbmc_ffdc_utils.robot

Resource dump_utils.robot

Library openbmc_ffdc.py

TODO:

telnetlib is remove in Python3.13 version.

#Library ffdc_cli_robot_script.py

*** Keywords ***

FFDC On Test Case Fail

Documentation Generic FFDC entry point. Place holder to hook in

... other data collection methods

... 1. Collect Logs if test fails or host reaches quiesced

... state.

... 2. Added test execution history logging.

... By default this will log Test status PASS/FAIL format

... EX: 20160822041250932049:Test:Test case 1:PASS

... 20160822041250969913:Test:Test case 2:FAIL

... 3. Delete error logs and BMC dumps post FFDC collection.

${OVERRIDE_FFDC_ON_TEST_CASE_FAIL}= Get Environment Variable OVERRIDE_FFDC_ON_TEST_CASE_FAIL 0

{OVERRIDE_FFDC_ON_TEST_CASE_FAIL}= Convert To Integer {OVERRIDE_FFDC_ON_TEST_CASE_FAIL}

IF ${OVERRIDE_FFDC_ON_TEST_CASE_FAIL} RETURN

IF '${TEST_STATUS}' == 'FAIL' Launch FFDC

Log Test Case Status

Launch FFDC

Documentation Call point to call FFDC robot or FFDC script.

... FFDC_DEFAULT set to 1, by default, in resource.robot

... FFDC_DEFAULT:1 use legacy ffdc collector

... FFDC_DEFAULT:0 use new ffdc collector.

IF {FFDC_DEFAULT} == {1} FFDC # Keyword from openbmc_ffdc.py

TODO: Python 3.13 compatibility changes needed

... ELSE ffdc_robot_script_cli # Keyword from ffdc_cli_robot_script.py

相关推荐
硅基手札21 分钟前
【linux内核专栏 08】时间与定时器
linux·运维·服务器
想做小南娘,发现自己是女生喵39 分钟前
Linux之Ubuntu入门篇知识总结
linux·运维·服务器
life码农1 小时前
Nginx 配置允许指定 IP 段访问:从 192.168.1.1 到 192.168.1.124 及 /24 详解
网络·tcp/ip·nginx
javaDocker1 小时前
16.5 小时,我打掉了两只「SSL 握手失败」的怪
网络·网络协议·ssl
CHEEVEN_QY1 小时前
搅拌摩擦焊FSW工艺参数对焊缝成形影响的实验研究10.1
linux·服务器·数据库
帷幕落秋2 小时前
Redis哨兵模式
运维·数据库
蜗牛互联网2 小时前
Python接入Gemini 3.8 Flash实现票据视觉抽取与规则校验
java·javascript·网络·人工智能·python
H.莓飛2 小时前
【数据结构】链表_OJ题
linux·数据结构·算法·链表
我就是不信2 小时前
TCP 原理详解:从三次握手到拥塞控制
网络·网络协议·tcp/ip
木白CPP2 小时前
USB(一): USB 概述&&介绍
linux·网络·嵌入式硬件