提交 01fecdfb 编写于 作者: L li-zipei 提交者: 李子沛

fixed 03e4aff9 from https://gitee.com/li-zipei/xts_acts/pulls/867

deviceauth
Signed-off-by: Nli-zipei <lizipei@huawei.com>
Change-Id: I834509ebaca7aaba6b6066986e52b753056a1ddf
上级 ad1955a2
...@@ -49,13 +49,12 @@ ohos_moduletest_suite("DeviceAuthFunctionTest") { ...@@ -49,13 +49,12 @@ ohos_moduletest_suite("DeviceAuthFunctionTest") {
"//base/security/deviceauth/services/common/inc/broadcast_manager", "//base/security/deviceauth/services/common/inc/broadcast_manager",
"//base/security/deviceauth/hals/inc/common", "//base/security/deviceauth/hals/inc/common",
"//base/security/deviceauth/hals/inc/linux", "//base/security/deviceauth/hals/inc/linux",
"//base/security/deviceauth/hals/inc/liteos",
"//base/security/deviceauth/hals/inc/dev_info/3516", "//base/security/deviceauth/hals/inc/dev_info/3516",
"//base/security/deviceauth/frameworks/inc",
] ]
deps = [ deps = [
"//base/security/deviceauth/services:deviceauth_sdk", "//base/security/deviceauth/services:deviceauth",
"//base/security/deviceauth/services:deviceauth_service",
"//base/security/huks/interfaces/innerkits/huks_standard/main:libhukssdk", "//base/security/huks/interfaces/innerkits/huks_standard/main:libhukssdk",
"//third_party/bounds_checking_function:libsec_static", "//third_party/bounds_checking_function:libsec_static",
"//third_party/cJSON:cjson_static", "//third_party/cJSON:cjson_static",
......
{ {
"description": "Config for hcpptest demo test cases",
"environment": [
{
"type": "device",
"label": "ipcamera"
}
],
"kits": [ "kits": [
{ {
"type": "MountKit", "push": [
"server": "NfsServer", "DeviceAuthFunctionTest->/data/local/tmp/DeviceAuthFunctionTest"
"mount": [ ],
{ "type": "PushKit"
"source": "testcases/security",
"target": "/test_root/security"
}
]
} }
], ],
"driver": { "driver": {
"type": "CppTestLite", "native-test-timeout": "120000",
"execute": "/test_root/security/ActsDeviceAuthFunctionTest.bin" "type": "CppTest",
} "module-name": "DeviceAuthFunctionTest",
"runtime-hint": "1s",
"native-test-device-path": "/data/local/tmp"
},
"description": "Configuration for DeviceAuthFunctionTest Tests"
} }
...@@ -16,9 +16,7 @@ ...@@ -16,9 +16,7 @@
#ifndef DEVICEAUTH_STANDARD_TEST_H #ifndef DEVICEAUTH_STANDARD_TEST_H
#define DEVICEAUTH_STANDARD_TEST_H #define DEVICEAUTH_STANDARD_TEST_H
#include <cstdint> #include <cstdint>
#include "gtest/gtest.h"
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "device_auth.h"
const char *TEST_APP_NAME = "TestApp"; const char *TEST_APP_NAME = "TestApp";
......
...@@ -21,5 +21,6 @@ ...@@ -21,5 +21,6 @@
#include "hc_dev_info.h" #include "hc_dev_info.h"
void SetClient(bool tag); void SetClient(bool tag);
bool GetClient();
#endif #endif
...@@ -24,4 +24,24 @@ void SetClient(bool tag) ...@@ -24,4 +24,24 @@ void SetClient(bool tag)
g_testForClient = tag; g_testForClient = tag;
} }
bool GetClient()
{
return g_testForClient;
}
int32_t HcGetUdid(uint8_t *udid, int32_t udidLen)
{
const char *clientUdid = "D6350E39AD8F11963C181BEEDC11AC85158E04466B68F1F4E6D895237E0FE81C";
const char *serverUdid = "ABCDEF00ABCDEF00ABCDEF00ABCDEF00ABCDEF00ABCDEF00ABCDEF00ABCDEF00";
if (g_testForClient) {
(void)memcpy_s(udid, udidLen - 1, clientUdid, strlen(clientUdid));
return 0;
}
(void)memcpy_s(udid, udidLen - 1, serverUdid, strlen(serverUdid));
return 0;
}
const char *GetStoragePath()
{
return "/data/data/deviceauth/hcgroup.dat";
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册