From ffa3eff4f1335853b908815cdca3ced8f214714d Mon Sep 17 00:00:00 2001 From: zhangyicheng5 Date: Wed, 19 Jan 2022 02:11:48 +0000 Subject: [PATCH] =?UTF-8?q?Signed-off-by:=20=E5=BC=A0=E7=9B=8A=E8=AF=9A=20?= =?UTF-8?q??= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- applications/kitframework_ipcamera/Test.json | 25 +++++++++ .../kitfwk_oem_api_test.cpp | 49 ++++++++++++++++ applications/kitframework_ipcamera/readme.md | 56 +++++++++++++++++++ 3 files changed, 130 insertions(+) create mode 100644 applications/kitframework_ipcamera/Test.json create mode 100644 applications/kitframework_ipcamera/kitfwk_oem_api_test.cpp create mode 100644 applications/kitframework_ipcamera/readme.md diff --git a/applications/kitframework_ipcamera/Test.json b/applications/kitframework_ipcamera/Test.json new file mode 100644 index 000000000..619d094c2 --- /dev/null +++ b/applications/kitframework_ipcamera/Test.json @@ -0,0 +1,25 @@ +{ + "description": "Config for kernel_lite test cases", + "environment": [ + { + "type": "device", + "label": "ipcamera" + } + ], + "kits": [ + { + "type": "MountKit", + "server": "NfsServer", + "mount": [ + { + "source": "testcases/small_device", + "target": "/test_root/small_device" + } + ] + } + ], + "driver": { + "type": "CppTestLite", + "execute": "/test_root/small_device/ActsKitFwkApiTest.bin" + } +} \ No newline at end of file diff --git a/applications/kitframework_ipcamera/kitfwk_oem_api_test.cpp b/applications/kitframework_ipcamera/kitfwk_oem_api_test.cpp new file mode 100644 index 000000000..51a8ce4e6 --- /dev/null +++ b/applications/kitframework_ipcamera/kitfwk_oem_api_test.cpp @@ -0,0 +1,49 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/lite/config/component/lite_component.gni") +import("//build/lite/config/hap_pack.gni") +import("//build/lite/config/subsystem/aafwk/config.gni") +import("//test/xts/tools/lite/build/suite_lite.gni") + +executable("ActsKitFwkApiTest") { + sources = [ "kitfwk_oem_api_test.cpp" ] + + include_dirs = [ + "//third_party/googletest/googletest/include", + "//third_party/cJSON", + "//third_party/mbedtls/include/", + "//third_party/bounds_checking_function/include/", + "//base/startup/syspara_lite/interfaces/kits/", + + # dir for oem_auth_config.h and oem_auth_result_storage.h + "//vendor/ingenic/smartpen/adapter/kitframework/include/", + ] + + deps = [ + "//base/startup/syspara_lite/frameworks/token:token_shared", + "//build/lite/config/component/cJSON:cjson_shared", + "//test/xts/tools/lite/hcpptest:hcpptest_main", + "//third_party/bounds_checking_function:libsec_shared", + "//third_party/mbedtls:mbedtls_shared", + + # dir for oem_auth_config.a and oem_auth_result_storage.a + "//vendor/ingenic/smartpen/adapter/kitframework:oem_auth_config", + "//vendor/ingenic/smartpen/adapter/kitframework:oem_auth_result_storage", + ] + + output_extension = "bin" + + # un-comment this Macro for token-persist-test + # defines = [ "TOKEN_PERSIST_TEST" ] +} diff --git a/applications/kitframework_ipcamera/readme.md b/applications/kitframework_ipcamera/readme.md new file mode 100644 index 000000000..81a08bf0a --- /dev/null +++ b/applications/kitframework_ipcamera/readme.md @@ -0,0 +1,56 @@ +# 使用说明 + +## 测试代码说明 +> 本套测试代码,提供了3个用例 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
标题用例名称测试步骤预期结果
用例1接口基本功能测试按默认条件编译出一个可执行文件,放入设备,检查日志用例全部通过。并检查是否可搜到关键字:this is the first run of test after flash
用例2数据重启可用测试用例1执行完后,重启设备,检查日志用例全部通过。并检查是否可搜到关键字:this is not the first run of test after flash
用例3token持久化测试打开 TOKEN_PERSIST_TEST 宏(去注释BUILD.gn里面倒数第二行defines)进行编译,放入设备,检查日志用例全部通过。并检查是否可搜到关键字:this is the first run of test after flash
+ + +## 编译说明 + +### 第一步 +当前路径BUILD.gn中修改include_dirs最后一行为oem_auth_config.h和oem_auth_result_storage.h 实际所在路径。 +默认为:"//vendor/kitframework/include/" +例如君正x2000的oem_auth_config.h和oem_auth_result_storage.h可能要修改为:"//vendor/ingenic/smartpen/adapter/kitframework/include" + +### 第二步 +BUILD.gn中修改deps最后两行为oem_auth_config.a和oem_auth_result_storage.a实际所在路径。 +例如君正x2000的oem_auth_config.h和oem_auth_result_storage.h可能要修改为: +"//vendor/ingenic/smartpen/adapter/kitframework:oem_auth_result_storage", +"//vendor/ingenic/smartpen/adapter/kitframework:oem_auth_config", + +### 第二步 +输入:hb build -f -T //test/xts/acts/applications/small_device:ActsKitFwkApiTest +编译完成后可在out/bin目录找到ActsKitFwkApiTest.bin文件 + +### 第三步 +放入设备,运行看日志 \ No newline at end of file -- GitLab