如何跳过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

相关推荐
如夏倾城14 小时前
VRRP(虚拟路由器冗余协议Virtual Router Redundancy Protocol)
网络·python·网络协议·安全·智能路由器·负载均衡·信息与通信
Eyfcom15 小时前
〖物流 SaaS 实战 02〗SaaS 租户的计费与订阅模型:从“一锤子买卖”到“按需订阅”
linux·服务器·数据库·快递系统·物流saas实战
瑞克-桑切斯17 小时前
Kubernetes 1.28 保姆级新手学习教程
运维·学习·docker·云原生·容器·kubernetes
数据库急诊室_阿哲17 小时前
一次割接后的性能复核记录:基线、样本、回滚点
运维·数据库·dba
忆挽篱笙歌17 小时前
systemV进程通信
linux·运维·服务器
张小姐的猫18 小时前
【基于 WebSocket 的多用户网页五子棋】—— 认识第三方库Websocketpp
网络·websocket·网络协议
LightBreeze200218 小时前
IS-IS 基本概念详解——报文类型、地址结构与网络拓扑
网络·lsp·路由协议·net·is-is
飞奔的瓜牛19 小时前
Wireshark 抓包实战:呼叫中心项目中的 SIP、DTMF 与 RTP 分析
运维·wireshark
Decay__20 小时前
SQLServer 监控体系构建 —— sql_exporter + Prometheus + Grafana 全栈实战
运维·数据库·sql·mysql·架构