【OpenHarmony】TDD-FUZZ环境配置

零、参考

1、AttributeError: 'ElementTree' object has no attribute 'getiterator':https://blog.csdn.net/suhao0911/article/details/110950742

一、创建工作目录

1、新建工作目录如:D:\0000_TDD_FUZZ\0000_ohos_tdd_fuzz。

2、gitee上下载 testfwk_developer_test-master、testfwk_xdevice-master。

3、将developer_test、xdevice压缩包解压到 D:\0000_TDD_FUZZ\0000_ohos_tdd_fuzz,并且目录重命名为developer_test、xdevice(必须重命名为xdevice)

https://gitee.com/openharmony/testfwk_xdevice/blob/master/config/user_config.xml

二、创建测试套目录 tests

在工作目录D:\0000_TDD_FUZZ\0000_ohos_tdd_fuzz下创建目录 tests用于存放 tdd、fuzz用例。

配置D:\0000_TDD_FUZZ\0000_ohos_tdd_fuzz\developer_test\config\usr_config.xml(指定test_cases为D:\0000_TDD_FUZZ\0000_ohos_tdd_fuzz\tests

三、下载TDD、FUZZ测试套

tdd、fuzz用例从版本里取构建详情 (openharmony.cn) :http://ci.openharmony.cn/workbench/cicd/dailybuild/detail/component

四、执行TDD、FUZZ测试

常用TDD测试命令

run -t UT -ts screen_capture_capi_unit_test

run -t UT -ts screen_capture_native_unit_test

run -t UT -ts screen_capture_capi_unit_test -tc ScreenCaptureUnitTest.screen_capture_save_file_02

run -t UT -ts screen_capture_capi_unit_test -tc ScreenCaptureUnitTest.screen_capture_specified_window_cb_01

run -t UT -ts screen_capture_capi_unit_test -tc ScreenCaptureUnitTest.screen_capture_save_file_cb_01

run -t UT -ts screen_capture_capi_unit_test -tc ScreenCaptureUnitTest.screen_capture_save_file_04

run -t UT -ts screen_capture_native_unit_test -tc ScreenCaptureUnitTest.screen_capture_specified_window_cb_01

run -t UT -ts screen_capture_native_unit_test -tc ScreenCaptureUnitTest.screen_capture_save_file_cb_01

run -t UT -ts screen_capture_native_unit_test -tc ScreenCaptureUnitTest.screen_capture_specified_window

TDD执行

run -t UT

run -t UT -ts screen_capture_capi_unit_test

run -t UT -ts screen_capture_capi_unit_test -tc ScreenCaptureUnitTest.screen_capture_specified_window_cb_01

FUZZ执行

run -t FUZZ

run -t FUZZ -ts PlayerStubFuzzTest

run -t FUZZ -ts PlayerStubFuzzTest -tc xxxxx.xxxx

问题1、exception: 'xml.etree.ElementTree.Element' object has no attribute 'getiterator'

Python版本问题(3.9 删除了getiterator接口,变成了iter):

[2023-08-31 10:14:01,189] [196804] [Concurrent] [ERROR] [Device: 150100424a************834bfb4900, exception: 'xml.etree.ElementTree.Element' object has no attribute 'getiterator'] [ErrorNo=00000]

[2023-08-31 10:14:01,190] [196804] [Concurrent] [INFO] [Executed: D:\0000_TDD_FUZZ\0000_ohos_tdd_fuzz\tests\fuzztest\player_framework\recorder\RecorderSetVideoSizeFuzzTest, Execution Time: 2sec]

全局搜索getiterator:grep -rns getiterator。将存在getiterator 的py文件里的getiterator替换为 iter。

developer_test/src/core/config/resource_manager.py:100: targets = root.getiterator("target")

Binary file developer_test/src/core/config/pycache/resource_manager.cpython-311.pyc matches

Binary file developer_test/src/core/config/pycache/resource_manager.cpython-39.pyc matches

xdevice/src/xdevice/_core/config/resource_manager.py:83: targets = root.getiterator("target")

Binary file xdevice/src/xdevice/_core/config/pycache/resource_manager.cpython-311.pyc matches

Binary file xdevice/src/xdevice/_core/config/pycache/resource_manager.cpython-39.pyc matches

全局搜索getiterator:grep -rns getiterator。将存在getiterator 的py文件里的getiterator替换为 iter。

developer_test/src/core/config/resource_manager.py:100: targets = root.getiterator("target")

Binary file developer_test/src/core/config/pycache/resource_manager.cpython-311.pyc matches

Binary file developer_test/src/core/config/pycache/resource_manager.cpython-39.pyc matches

xdevice/src/xdevice/_core/config/resource_manager.py:83: targets = root.getiterator("target")

Binary file xdevice/src/xdevice/_core/config/pycache/resource_manager.cpython-311.pyc matches

Binary file xdevice/src/xdevice/_core/config/pycache/resource_manager.cpython-39.pyc matches

相关推荐
Industio_触觉智能13 小时前
如何在开源鸿蒙OpenHarmony开启SELinux模式?RK3566鸿蒙开发板演示
openharmony·selinux·开源鸿蒙·鸿蒙开发板·rk3566开发板
xiaolaoshuXD6 天前
深入解析 OpenHarmony 构建系统-4-OHOSLoader类
编译·openharmony·build·构建·hb
雪域迷影6 天前
OpenHarmony的公共事件
openharmony·ces公共事件·资源调度服务
伊二6 天前
鸿蒙next ui安全区域适配(刘海屏、摄像头挖空等)
华为·harmonyos·鸿蒙·openharmony·团结引擎·huamony next
Industio_触觉智能15 天前
OpenHarmony4.1蓝牙芯片如何适配?触觉智能RK3568主板SBC3568演示
openharmony·rk3568·开源鸿蒙·鸿蒙开发板·触觉智能
ssslar16 天前
Harmony OS 如何实现 C++ NATIVE YUV420(其他数据格式如BGRA等)自渲染
华为·harmonyos·鸿蒙·openharmony
Industio_触觉智能18 天前
【鸿蒙新闻】10月29日警用鸿蒙开发者大会在北京胜利召开,开启智慧应用新时代!
鸿蒙系统·openharmony·开源鸿蒙·纯血鸿蒙·警用鸿蒙
Dylanioucn22 天前
《解锁 TDD 魔法:高效软件开发的利器》
后端·功能测试·测试·测试驱动开发·tdd
Industio_触觉智能1 个月前
触觉智能Purple Pi OH鸿蒙开发板成功适配OpenHarmony5.0 Release,开启新征程!
harmonyos·openharmony·开源鸿蒙·鸿蒙开发板·触觉智能·原生鸿蒙
码匠许师傅1 个月前
【开源鸿蒙】OpenHarmony 5.0轻量系统最小开发环境搭建
python·pip·risc-v·openharmony·gcc·1024程序员节·hi3861