From 24ffac411d2e686deec2b99923c9596949fcd4ae Mon Sep 17 00:00:00 2001 From: mipengwei Date: Thu, 14 Jul 2022 07:41:03 +0000 Subject: [PATCH] Signed-off-by:mipengwei --- README_zh.md | 1 + libs/fuzzlib/README_zh.md | 9 ++++++--- src/core/driver/drivers.py | 19 ++++++++++--------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/README_zh.md b/README_zh.md index 19d2597..092964e 100755 --- a/README_zh.md +++ b/README_zh.md @@ -7,6 +7,7 @@ OpenHarmony为开发者提供了一套全面的自测试框架,开发者可根 - [环境配置](https://gitee.com/openharmony/docs/tree/master/zh-cn/device-dev/subsystems/subsys-testguide-envbuild.md) - [源码获取](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md) +测试框架依赖于test_xdevice框架,在使用时两个框架放在同级目录,命名为xdevice ## 测试框架目录简介 以下是测试框架的目录层级架构,在使用测试框架过程中可在相应目录查找对应组件。 diff --git a/libs/fuzzlib/README_zh.md b/libs/fuzzlib/README_zh.md index 97f9c1f..e9509e6 100644 --- a/libs/fuzzlib/README_zh.md +++ b/libs/fuzzlib/README_zh.md @@ -140,6 +140,8 @@ Fuzzing测试框架使用了LLVM编译器框架中的[libFuzzer](https://llvm.or 基于[ohos_fuzztest]配置Fuzz模板,例如: + 需要注意的是fuzz_config_file, 使用gen命令生成的BUILD.GN文件中没有指明,需要写完测试套后加在BUILD.gn中 + ``` ohos_fuzztest("CalculatorFuzzTest") { #定义测试套名称CalculatorFuzzTest module_out_path = module_output_path @@ -169,7 +171,7 @@ Fuzzing测试框架使用了LLVM编译器框架中的[libFuzzer](https://llvm.or } ``` **注意:** - - 测试套名称采用大驼峰风格,并且以FuzzTest结尾,测试套前缀与fuzzer目录名相对应。 + - #### 测试套名称必须采用大驼峰风格,并且必须以FuzzTest结尾,测试套前缀与fuzzer目录名相对应(例如:calculator_fuzzer,只能有一个下划线)。 - module_out_path为测试套编译输出目录,内容为部件+模块名。 @@ -237,13 +239,14 @@ run -t FUZZ -ss developertest -tm calculator 1. 归档用例配置文件、语料以及用例可执行文件 - 新建目录,如: + 新建目录,如: + #### 注意:必须是\tests目录 ``` D:\test\tests ``` - 用例可执行文件为DTFuzz源文件编译产出文件,以二进制形式存储在out/release/package/phone/tests/fuzztest下。测试用例的配置文件均编译输出在out/release/package/phone/tests/res目录下对应的xxxx_fuzzer目录中。 + 用例可执行文件为DTFuzz源文件编译产出文件,以二进制形式存储在out/release/tests/fuzztest下。测试用例的配置文件均编译输出在out/release/tests/res目录下对应的xxxx_fuzzer目录中。 将fuzztest目录以及res目录直接拷贝到该路径下即可。 diff --git a/src/core/driver/drivers.py b/src/core/driver/drivers.py index 0c79595..524ca34 100755 --- a/src/core/driver/drivers.py +++ b/src/core/driver/drivers.py @@ -351,14 +351,15 @@ class ResultManager(object): remote_json_result_file = os.path.join(self.device_testpath, "%s.json" % self.testsuite_name) - if self.device.is_file_exist(remote_result_file): - self.device.pull_file(remote_result_file, result_file_path) - elif self.device.is_file_exist(remote_json_result_file): - self.device.pull_file(remote_json_result_file, - result_josn_file_path) - result_file_path = result_josn_file_path - else: - LOG.info("%s not exist", remote_result_file) + if self.config.testtype[0] != "fuzztest": + if self.device.is_file_exist(remote_result_file): + self.device.pull_file(remote_result_file, result_file_path) + elif self.device.is_file_exist(remote_json_result_file): + self.device.pull_file(remote_json_result_file, + result_josn_file_path) + result_file_path = result_josn_file_path + else: + LOG.info("%s not exist", remote_result_file) return result_file_path @@ -404,7 +405,7 @@ class ResultManager(object): if not os.path.exists(cxx_cov_path): os.makedirs(cxx_cov_path) src_file = os.path.join(DEFAULT_TEST_PATH, target_name) - self.device.pull_file(src_file, cxx_cov_path, is_create=True) + self.device.pull_file(src_file, cxx_cov_path, is_create=True, timeout=TIME_OUT) ############################################################################## -- Gitee