提交 4095268d 编写于 作者: O openharmony_ci 提交者: Gitee

!752 修改了huks L0执行任务栈满的问题

Merge pull request !752 from aaronwangjun/dev7
......@@ -41,7 +41,7 @@ lite_component("acts_component") {
#"//test/xts/acts/kernel_lite/kernelcmsis_hal:ActsCMSISTest",
"//test/xts/acts/utils_lite/kv_store_hal:ActsKvStoreTest",
"//test/xts/acts/security_lite/huks/liteos_m_adapter:ActsHuksHalFunctionTest",
"//test/xts/acts/security_lite:securitytest",
"//test/xts/acts/hiviewdfx_lite/hilog_hal:ActsDfxFuncTest",
"//test/xts/acts/hiviewdfx_lite/hievent_hal:ActsHieventLiteTest",
......@@ -66,7 +66,6 @@ lite_component("acts_component") {
"//test/xts/acts/distributed_schedule_lite/system_ability_manager_posix:ActsSamgrTest",
#"//test/xts/acts/distributedschedule_lite/distributed_schedule_posix:ActsDMSTest",
"//test/xts/acts/security_lite/permission_posix/pms:ActsPMSTest",
"//test/xts/acts/hiviewdfx_lite/hilog_posix:ActsHilogTest",
"//test/xts/acts/multimedia_lite/media_lite_posix/recorder_native:ActsMediaRecorderTest",
......@@ -86,8 +85,7 @@ lite_component("acts_component") {
"//test/xts/acts/startup_lite/syspara_posix:ActsParameterTest",
"//test/xts/acts/startup_lite/bootstrap_posix:ActsBootstrapTest",
"//test/xts/acts/communication_lite/lwip_posix:ActsLwipTest",
"//test/xts/acts/security_lite/permission_posix/pms:ActsPMSTest",
"//test/xts/acts/security_lite:securitytest",
#"//test/xts/acts/multimedia_lite/camera_lite_posix/camera_native:ActsMediaCameraTest",
#"//test/xts/acts/multimedia_lite/media_lite_posix/player_native:ActsMediaPlayerTest",
......
......@@ -12,9 +12,16 @@
# limitations under the License.
group("securitytest") {
deps = [
"//test/xts/acts/security_lite/huks/liteos_a_adapter:Hukslitetest",
"//test/xts/acts/security_lite/permission_posix/capability:ActsCapabilityTest",
"//test/xts/acts/security_lite/permission_posix/dac:ActsDacTest",
]
if (ohos_kernel_type == "liteos_a") {
deps = [
"//test/xts/acts/security_lite/huks/liteos_a_adapter:Hukslitetest",
"//test/xts/acts/security_lite/permission_posix/capability:ActsCapabilityTest",
"//test/xts/acts/security_lite/permission_posix/dac:ActsDacTest",
"//test/xts/acts/security_lite/permission_posix/pms:ActsPMSTest",
]
} else if (ohos_kernel_type == "linux") {
deps = [ "//test/xts/acts/security_lite/permission_posix/pms:ActsPMSTest" ]
} else if (ohos_kernel_type == "liteos_m") {
deps = [ "//test/xts/acts/security_lite/huks/liteos_m_adapter:ActsHuksHalFunctionTest" ]
}
}
......@@ -20,6 +20,8 @@
#include "hks_param.h"
#include "hks_test_log.h"
#include "securec.h"
#define USEC_MINT 1000
#define USEC_UINT 1000000
......
......@@ -18,6 +18,7 @@
#include "hks_param.h"
#include "hks_test_log.h"
#include "hks_type.h"
#include "securec.h"
#define TEST_ALIAS_ED25519 "test_ed25519"
#define TEST_PLAIN_TEST_ED25519 "This is a plain text! Hello world and thanks for watching ED25519~"
......
......@@ -42,7 +42,6 @@ hcpptest_suite("ActsHuksLiteFunctionTest") {
include_dirs = [
"//utils/native/base/include",
"//third_party/bounds_checking_function/include",
"//base/security/huks/huawei_property/include",
"../common/include",
]
......
......@@ -21,6 +21,8 @@
#include "hks_param.h"
#include "hks_test_cipher.h"
#include "securec.h"
using namespace testing::ext;
namespace {
class HksCipherTest : public testing::Test {
......
......@@ -21,6 +21,8 @@
#include "hks_param.h"
#include "hks_test_curve25519.h"
#include "securec.h"
using namespace testing::ext;
namespace {
#ifndef _CUT_AUTHENTICATE_
......
......@@ -23,6 +23,8 @@
#include "hks_test_common.h"
#include "hks_test_log.h"
#include "securec.h"
using namespace testing::ext;
namespace {
class HksMacTest : public testing::Test {
......
......@@ -21,6 +21,8 @@
#include "hks_param.h"
#include "hks_type.h"
#include "securec.h"
using namespace testing::ext;
namespace {
#ifndef _CUT_AUTHENTICATE_
......
......@@ -23,6 +23,8 @@
#include "hks_test_file_operator.h"
#include "hks_test_mem.h"
#include "securec.h"
using namespace testing::ext;
namespace {
#ifndef _CUT_AUTHENTICATE_
......
......@@ -41,10 +41,7 @@ hctest_suite("ActsHuksHalFunctionTest") {
"../common/include",
]
deps = [
#"//base/security/huks/huawei_property/source:huks_new",
"//test/xts/acts/security_lite/huks/common:huks_test_common",
]
deps = [ "//test/xts/acts/security_lite/huks/common:huks_test_common" ]
cflags = [
"-D_CUT_ED25519_",
......
......@@ -21,6 +21,11 @@
#include "cmsis_os2.h"
#include "ohos_types.h"
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
/*
* @tc.register: register a test suit named "CalcMultiTest"
* @param: test subsystem name
......@@ -29,6 +34,13 @@
*/
LITE_TEST_SUIT(security, securityData, HksAesTest);
static void ExecHksInitialize(void const *argument)
{
LiteTestPrint("HksInitialize Begin!\n");
TEST_ASSERT_TRUE(HksInitialize() == 0);
LiteTestPrint("HksInitialize End!\n");
osThreadExit();
}
/**
* @tc.setup: define a setup for test suit, format:"CalcMultiTest + SetUp"
* @return: true——setup success
......@@ -37,7 +49,19 @@ static BOOL HksAesTestSetUp()
{
LiteTestPrint("setup\n");
hi_watchdog_disable();
TEST_ASSERT_TRUE(HksInitialize() == 0);
osThreadId_t id;
osThreadAttr_t attr;
g_setPriority = osPriorityAboveNormal6;
attr.name = "test";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = TEST_TASK_STACK_SIZE;
attr.priority = g_setPriority;
id = osThreadNew((osThreadFunc_t)ExecHksInitialize, NULL, &attr);
sleep(WAIT_TO_TEST_DONE);
LiteTestPrint("HksAgreementTestSetUp End2!\n");
return TRUE;
}
......
......@@ -16,7 +16,6 @@
#include "hctest.h"
#include "hi_watchdog.h"
#include "hks_agreement_test.h"
#include "hks_api.h"
#include "hks_param.h"
#include "hks_test_api_performance.h"
......@@ -27,9 +26,14 @@
#include "cmsis_os2.h"
#include "ohos_types.h"
#define TMP_SIZE 512
#define X25519_KEY_SIZE 32
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
#ifndef _CUT_AUTHENTICATE_
static osPriority_t g_setPriority;
#ifndef _CUT_AUTHENTICATE_
/*
* @tc.register: register a test suit named "CalcMultiTest"
* @param: test subsystem name
......@@ -38,6 +42,14 @@
*/
LITE_TEST_SUIT(security, securityData, HksAgreementTest);
static void ExecHksInitialize(void const *argument)
{
LiteTestPrint("HksInitialize Begin!\n");
TEST_ASSERT_TRUE(HksInitialize() == 0);
LiteTestPrint("HksInitialize End!\n");
osThreadExit();
}
/**
* @tc.setup: define a setup for test suit, format:"CalcMultiTest + SetUp"
* @return: true——setup success
......@@ -45,9 +57,20 @@ LITE_TEST_SUIT(security, securityData, HksAgreementTest);
static BOOL HksAgreementTestSetUp()
{
LiteTestPrint("setup\n");
hi_watchdog_disable();
TEST_ASSERT_TRUE(HksInitialize() == 0);
osThreadId_t id;
osThreadAttr_t attr;
g_setPriority = osPriorityAboveNormal6;
attr.name = "test";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = TEST_TASK_STACK_SIZE;
attr.priority = g_setPriority;
id = osThreadNew((osThreadFunc_t)ExecHksInitialize, NULL, &attr);
sleep(WAIT_TO_TEST_DONE);
LiteTestPrint("HksAgreementTestSetUp End2!\n");
return TRUE;
}
......@@ -63,8 +86,6 @@ static BOOL HksAgreementTestTearDown()
return TRUE;
}
#define TMP_SIZE 512
#define X25519_KEY_SIZE 32
static const struct HksTestAgreeParams g_testAgreeParams[] = {
/* ree x25519 success */
{ 0, HKS_SUCCESS, { true, DEFAULT_KEY_ALIAS_SIZE, true, DEFAULT_KEY_ALIAS_SIZE },
......@@ -100,11 +121,6 @@ static int32_t AgreeKey(const struct HksTestAgreeParamSet *agreeParamSetParams,
return ret;
}
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
static void ExecHksAgreementTest001(void const *argument)
{
LiteTestPrint("HksAgreementTest001 Begin!\n");
......
......@@ -16,13 +16,19 @@
#include "hctest.h"
#include "hi_watchdog.h"
#include "hks_bn_exp_mod_test.h"
#include "hks_api.h"
#include "hks_param.h"
#include "hks_test_api_performance.h"
#include "hks_test_common.h"
#include "hks_test_log.h"
#include "hks_type.h"
#include "cmsis_os2.h"
#include "ohos_types.h"
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
/*
* @tc.register: register a test suit named "CalcMultiTest"
......@@ -32,6 +38,13 @@
*/
LITE_TEST_SUIT(security, securityData, HksBnExpModTest);
static void ExecHksInitialize(void const *argument)
{
LiteTestPrint("HksInitialize Begin!\n");
TEST_ASSERT_TRUE(HksInitialize() == 0);
LiteTestPrint("HksInitialize End!\n");
osThreadExit();
}
/**
* @tc.setup: define a setup for test suit, format:"CalcMultiTest + SetUp"
* @return: true——setup success
......@@ -40,7 +53,19 @@ static BOOL HksBnExpModTestSetUp()
{
LiteTestPrint("setup\n");
hi_watchdog_disable();
TEST_ASSERT_TRUE(HksInitialize() == 0);
osThreadId_t id;
osThreadAttr_t attr;
g_setPriority = osPriorityAboveNormal6;
attr.name = "test";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = TEST_TASK_STACK_SIZE;
attr.priority = g_setPriority;
id = osThreadNew((osThreadFunc_t)ExecHksInitialize, NULL, &attr);
sleep(WAIT_TO_TEST_DONE);
LiteTestPrint("HksBnExpModTestSetUp End2!\n");
return TRUE;
}
......
......@@ -29,6 +29,10 @@
#define TEST_INDEX_2 2
#define TEST_INDEX_3 3
#define TEST_INDEX_4 4
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
/*
* @tc.register: register a test suit named "CalcMultiTest"
......@@ -38,6 +42,14 @@
*/
LITE_TEST_SUIT(security, securityData, HksCipherTest);
static void ExecHksInitialize(void const *argument)
{
LiteTestPrint("HksInitialize Begin!\n");
TEST_ASSERT_TRUE(HksInitialize() == 0);
LiteTestPrint("HksInitialize End!\n");
osThreadExit();
}
/**
* @tc.setup: define a setup for test suit, format:"CalcMultiTest + SetUp"
* @return: true——setup success
......@@ -46,7 +58,19 @@ static BOOL HksCipherTestSetUp()
{
LiteTestPrint("setup\n");
hi_watchdog_disable();
TEST_ASSERT_TRUE(HksInitialize() == 0);
osThreadId_t id;
osThreadAttr_t attr;
g_setPriority = osPriorityAboveNormal6;
attr.name = "test";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = TEST_TASK_STACK_SIZE;
attr.priority = g_setPriority;
id = osThreadNew((osThreadFunc_t)ExecHksInitialize, NULL, &attr);
sleep(WAIT_TO_TEST_DONE);
LiteTestPrint("HksCipherTestSetUp End2!\n");
return TRUE;
}
......@@ -61,11 +85,6 @@ static BOOL HksCipherTestTearDown()
return TRUE;
}
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
static void ExecHksCipherTest001(void const *argument)
{
LiteTestPrint("HksCipherTest001 Begin!\n");
......
......@@ -26,6 +26,13 @@
#include "los_config.h"
#include "ohos_types.h"
#include "securec.h"
#include "cmsis_os2.h"
#include "ohos_types.h"
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
/*
* @tc.register: register a test suit named "CalcMultiTest"
......@@ -35,6 +42,13 @@
*/
LITE_TEST_SUIT(security, securityData, HksCurve25519Test);
static void ExecHksInitialize(void const *argument)
{
LiteTestPrint("HksInitialize Begin!\n");
TEST_ASSERT_TRUE(HksInitialize() == 0);
LiteTestPrint("HksInitialize End!\n");
osThreadExit();
}
/**
* @tc.setup: define a setup for test suit, format:"CalcMultiTest + SetUp"
* @return: true——setup success
......@@ -43,7 +57,19 @@ static BOOL HksCurve25519TestSetUp()
{
LiteTestPrint("setup\n");
hi_watchdog_disable();
TEST_ASSERT_TRUE(HksInitialize() == 0);
osThreadId_t id;
osThreadAttr_t attr;
g_setPriority = osPriorityAboveNormal6;
attr.name = "test";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = TEST_TASK_STACK_SIZE;
attr.priority = g_setPriority;
id = osThreadNew((osThreadFunc_t)ExecHksInitialize, NULL, &attr);
sleep(WAIT_TO_TEST_DONE);
LiteTestPrint("HksCurve25519TestSetUp End2!\n");
return TRUE;
}
......@@ -58,12 +84,6 @@ static BOOL HksCurve25519TestTearDown()
return TRUE;
}
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
static void LocalHksCurve25519Test001(void const *argument)
{
LiteTestPrint("HksCurve25519Test001 Begin!\n");
......
......@@ -18,14 +18,23 @@
#include "hctest.h"
#include "hi_watchdog.h"
#include "hks_delete_test.h"
#include "hks_api.h"
#include "hks_param.h"
#include "hks_test_api_performance.h"
#include "hks_test_common.h"
#include "hks_test_log.h"
#include "hks_type.h"
#include "cmsis_os2.h"
#include "ohos_types.h"
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
static const struct HksTestKeyExistParams g_testKeyExistParams[] = {
/* normal case */
{ 0, HKS_SUCCESS, true, { true, DEFAULT_KEY_ALIAS_SIZE, true, DEFAULT_KEY_ALIAS_SIZE } },
};
/*
* @tc.register: register a test suit named "CalcMultiTest"
* @param: test subsystem name
......@@ -34,6 +43,38 @@
*/
LITE_TEST_SUIT(security, securityData, HksDeleteTest);
static void ExecHksInitialize(void const *argument)
{
LiteTestPrint("HksInitialize Begin!\n");
TEST_ASSERT_TRUE(HksInitialize() == 0);
LiteTestPrint("HksInitialize End!\n");
osThreadExit();
}
static void ExecHksDeleteTest001(void const *argument)
{
LiteTestPrint("HksDeleteTest001 Begin!\n");
int32_t ret;
struct HksBlob *keyAlias = NULL;
if (g_testKeyExistParams[0].isGenKey) {
HKS_TEST_ASSERT(TestGenDefaultKeyAndGetAlias(&keyAlias) == 0);
} else {
ret = TestConstuctBlob(&keyAlias,
g_testKeyExistParams[0].keyAliasParams.blobExist,
g_testKeyExistParams[0].keyAliasParams.blobSize,
g_testKeyExistParams[0].keyAliasParams.blobDataExist,
g_testKeyExistParams[0].keyAliasParams.blobDataSize);
HKS_TEST_ASSERT(ret == 0);
}
ret = HksDeleteKeyRun(keyAlias, 1);
HKS_TEST_ASSERT(ret == g_testKeyExistParams[0].expectResult);
TestFreeBlob(&keyAlias);
TEST_ASSERT_TRUE(ret == 0);
LiteTestPrint("HksDeleteTest001 End!\n");
osThreadExit();
}
/**
* @tc.setup: define a setup for test suit, format:"CalcMultiTest + SetUp"
* @return: true——setup success
......@@ -42,7 +83,19 @@ static BOOL HksDeleteTestSetUp()
{
LiteTestPrint("setup\n");
hi_watchdog_disable();
TEST_ASSERT_TRUE(HksInitialize() == 0);
osThreadId_t id;
osThreadAttr_t attr;
g_setPriority = osPriorityAboveNormal6;
attr.name = "test";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = TEST_TASK_STACK_SIZE;
attr.priority = g_setPriority;
id = osThreadNew((osThreadFunc_t)ExecHksInitialize, NULL, &attr);
sleep(WAIT_TO_TEST_DONE);
LiteTestPrint("HksDeriveTestSetUp End2!\n");
return TRUE;
}
......@@ -57,11 +110,6 @@ static BOOL HksDeleteTestTearDown()
return TRUE;
}
static const struct HksTestKeyExistParams g_testKeyExistParams[] = {
/* normal case */
{ 0, HKS_SUCCESS, true, { true, DEFAULT_KEY_ALIAS_SIZE, true, DEFAULT_KEY_ALIAS_SIZE } },
};
/**
* @tc.name: HksDeleteTest.HksDeleteTest001
* @tc.desc: The static function will return true;
......@@ -69,24 +117,19 @@ static const struct HksTestKeyExistParams g_testKeyExistParams[] = {
*/
LITE_TEST_CASE(HksDeleteTest, HksDeleteTest001, Level1)
{
int32_t ret;
struct HksBlob *keyAlias = NULL;
if (g_testKeyExistParams[0].isGenKey) {
HKS_TEST_ASSERT(TestGenDefaultKeyAndGetAlias(&keyAlias) == 0);
} else {
ret = TestConstuctBlob(&keyAlias,
g_testKeyExistParams[0].keyAliasParams.blobExist,
g_testKeyExistParams[0].keyAliasParams.blobSize,
g_testKeyExistParams[0].keyAliasParams.blobDataExist,
g_testKeyExistParams[0].keyAliasParams.blobDataSize);
HKS_TEST_ASSERT(ret == 0);
}
ret = HksDeleteKeyRun(keyAlias, 1);
HKS_TEST_ASSERT(ret == g_testKeyExistParams[0].expectResult);
TestFreeBlob(&keyAlias);
TEST_ASSERT_TRUE(ret == 0);
osThreadId_t id;
osThreadAttr_t attr;
g_setPriority = osPriorityAboveNormal6;
attr.name = "test";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = TEST_TASK_STACK_SIZE;
attr.priority = g_setPriority;
id = osThreadNew((osThreadFunc_t)ExecHksDeleteTest001, NULL, &attr);
sleep(WAIT_TO_TEST_DONE);
LiteTestPrint("HksDeleteTest001 End2!\n");
}
RUN_TEST_SUITE(HksDeleteTest);
......
......@@ -22,10 +22,16 @@
#include "hks_test_api_performance.h"
#include "hks_test_common.h"
#include "hks_test_log.h"
#include "cmsis_os2.h"
#include "ohos_types.h"
#define DEFAULT_DERIVE_SIZE 32
#define DEFAULT_INFO_SIZE 55
#define DEFAULT_SALT_SIZE 16
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
/*
* @tc.register: register a test suit named "CalcMultiTest"
......@@ -35,6 +41,13 @@
*/
LITE_TEST_SUIT(security, securityData, HksDeriveTest);
static void ExecHksInitialize(void const *argument)
{
LiteTestPrint("HksInitialize Begin!\n");
TEST_ASSERT_TRUE(HksInitialize() == 0);
LiteTestPrint("HksInitialize End!\n");
osThreadExit();
}
/**
* @tc.setup: define a setup for test suit, format:"CalcMultiTest + SetUp"
* @return: true——setup success
......@@ -43,7 +56,19 @@ static BOOL HksDeriveTestSetUp()
{
LiteTestPrint("setup\n");
hi_watchdog_disable();
TEST_ASSERT_TRUE(HksInitialize() == 0);
osThreadId_t id;
osThreadAttr_t attr;
g_setPriority = osPriorityAboveNormal6;
attr.name = "test";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = TEST_TASK_STACK_SIZE;
attr.priority = g_setPriority;
id = osThreadNew((osThreadFunc_t)ExecHksInitialize, NULL, &attr);
sleep(WAIT_TO_TEST_DONE);
LiteTestPrint("HksDeriveTestSetUp End2!\n");
return TRUE;
}
......@@ -199,6 +224,24 @@ static int32_t BaseTestDerive(uint32_t index)
return ret;
}
static void ExecHksDeriveTest001(void const *argument)
{
LiteTestPrint("HksDeriveTest001 Begin!\n");
int32_t ret = BaseTestDerive(0);
TEST_ASSERT_TRUE(ret == 0);
LiteTestPrint("HksDeriveTest001 End!\n");
osThreadExit();
}
static void ExecHksDeriveTest002(void const *argument)
{
LiteTestPrint("HksDeriveTest002 Begin!\n");
int32_t ret = BaseTestDerive(1);
TEST_ASSERT_TRUE(ret == 0);
LiteTestPrint("HksDeriveTest002 End!\n");
osThreadExit();
}
#ifndef _CUT_AUTHENTICATE_
/**
* @tc.name: HksDeriveTest.HksDeriveTest001
......@@ -207,8 +250,19 @@ static int32_t BaseTestDerive(uint32_t index)
*/
LITE_TEST_CASE(HksDeriveTest, HksDeriveTest001, Level1)
{
int32_t ret = BaseTestDerive(0);
TEST_ASSERT_TRUE(ret == 0);
osThreadId_t id;
osThreadAttr_t attr;
g_setPriority = osPriorityAboveNormal6;
attr.name = "test";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = TEST_TASK_STACK_SIZE;
attr.priority = g_setPriority;
id = osThreadNew((osThreadFunc_t)ExecHksDeriveTest001, NULL, &attr);
sleep(WAIT_TO_TEST_DONE);
LiteTestPrint("HksDeriveTest001 End2!\n");
}
#endif /* _CUT_AUTHENTICATE_ */
......@@ -219,7 +273,18 @@ LITE_TEST_CASE(HksDeriveTest, HksDeriveTest001, Level1)
*/
LITE_TEST_CASE(HksDeriveTest, HksDeriveTest002, Level1)
{
int32_t ret = BaseTestDerive(1);
TEST_ASSERT_TRUE(ret == 0);
osThreadId_t id;
osThreadAttr_t attr;
g_setPriority = osPriorityAboveNormal6;
attr.name = "test";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = TEST_TASK_STACK_SIZE;
attr.priority = g_setPriority;
id = osThreadNew((osThreadFunc_t)ExecHksDeriveTest002, NULL, &attr);
sleep(WAIT_TO_TEST_DONE);
LiteTestPrint("HksDeriveTest002 End2!\n");
}
RUN_TEST_SUITE(HksDeriveTest);
......@@ -24,6 +24,18 @@
#include "hks_test_common.h"
#include "hks_test_log.h"
#include "hks_type.h"
#include "cmsis_os2.h"
#include "ohos_types.h"
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
static const struct HksTestKeyExistParams g_testKeyExistParams[] = {
/* normal case */
{ 0, HKS_SUCCESS, true, { true, DEFAULT_KEY_ALIAS_SIZE, true, DEFAULT_KEY_ALIAS_SIZE } },
};
/*
* @tc.register: register a test suit named "CalcMultiTest"
......@@ -33,6 +45,43 @@
*/
LITE_TEST_SUIT(security, securityData, HksExistTest);
static void ExecHksInitialize(void const *argument)
{
LiteTestPrint("HksInitialize Begin!\n");
TEST_ASSERT_TRUE(HksInitialize() == 0);
LiteTestPrint("HksInitialize End!\n");
osThreadExit();
}
static void ExecHksExistTest001(void const *argument)
{
int32_t ret;
LiteTestPrint("HksExistTest001 Begin!\n");
struct HksBlob *keyAlias = NULL;
if (g_testKeyExistParams[0].isGenKey) {
TEST_ASSERT_TRUE(TestGenDefaultKeyAndGetAlias(&keyAlias) == 0);
ret = HksKeyExistRun(keyAlias, 1);
TEST_ASSERT_TRUE(ret == g_testKeyExistParams[0].expectResult);
TEST_ASSERT_TRUE(HksDeleteKey(keyAlias, NULL) == HKS_SUCCESS);
} else {
ret = TestConstuctBlob(&keyAlias,
g_testKeyExistParams[0].keyAliasParams.blobExist,
g_testKeyExistParams[0].keyAliasParams.blobSize,
g_testKeyExistParams[0].keyAliasParams.blobDataExist,
g_testKeyExistParams[0].keyAliasParams.blobDataSize);
TEST_ASSERT_TRUE(ret == 0);
ret = HksKeyExistRun(keyAlias, 1);
if (ret != g_testKeyExistParams[0].expectResult) {
HKS_TEST_LOG_I("HksKeyExistRun 2 failed, ret[%u] = %d", g_testKeyExistParams[0].testId, ret);
}
TEST_ASSERT_TRUE(ret == g_testKeyExistParams[0].expectResult);
}
TestFreeBlob(&keyAlias);
TEST_ASSERT_TRUE(ret == 0);
LiteTestPrint("HksExistTest001 End!\n");
osThreadExit();
}
/**
* @tc.setup: define a setup for test suit, format:"CalcMultiTest + SetUp"
* @return: true——setup success
......@@ -41,7 +90,19 @@ static BOOL HksExistTestSetUp()
{
LiteTestPrint("setup\n");
hi_watchdog_disable();
TEST_ASSERT_TRUE(HksInitialize() == 0);
osThreadId_t id;
osThreadAttr_t attr;
g_setPriority = osPriorityAboveNormal6;
attr.name = "test";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = TEST_TASK_STACK_SIZE;
attr.priority = g_setPriority;
id = osThreadNew((osThreadFunc_t)ExecHksInitialize, NULL, &attr);
sleep(WAIT_TO_TEST_DONE);
LiteTestPrint("HksGenerateKeyTestSetUp End2!\n");
return TRUE;
}
......@@ -56,12 +117,6 @@ static BOOL HksExistTestTearDown()
return TRUE;
}
static const struct HksTestKeyExistParams g_testKeyExistParams[] = {
/* normal case */
{ 0, HKS_SUCCESS, true, { true, DEFAULT_KEY_ALIAS_SIZE, true, DEFAULT_KEY_ALIAS_SIZE } },
};
/**
* @tc.name: HksExistTest.HksExistTest001
* @tc.desc: The static function will return true;
......@@ -69,28 +124,19 @@ static const struct HksTestKeyExistParams g_testKeyExistParams[] = {
*/
LITE_TEST_CASE(HksExistTest, HksExistTest001, Level1)
{
int32_t ret;
struct HksBlob *keyAlias = NULL;
if (g_testKeyExistParams[0].isGenKey) {
TEST_ASSERT_TRUE(TestGenDefaultKeyAndGetAlias(&keyAlias) == 0);
ret = HksKeyExistRun(keyAlias, 1);
TEST_ASSERT_TRUE(ret == g_testKeyExistParams[0].expectResult);
TEST_ASSERT_TRUE(HksDeleteKey(keyAlias, NULL) == HKS_SUCCESS);
} else {
ret = TestConstuctBlob(&keyAlias,
g_testKeyExistParams[0].keyAliasParams.blobExist,
g_testKeyExistParams[0].keyAliasParams.blobSize,
g_testKeyExistParams[0].keyAliasParams.blobDataExist,
g_testKeyExistParams[0].keyAliasParams.blobDataSize);
TEST_ASSERT_TRUE(ret == 0);
ret = HksKeyExistRun(keyAlias, 1);
if (ret != g_testKeyExistParams[0].expectResult) {
HKS_TEST_LOG_I("HksKeyExistRun 2 failed, ret[%u] = %d", g_testKeyExistParams[0].testId, ret);
}
TEST_ASSERT_TRUE(ret == g_testKeyExistParams[0].expectResult);
}
TestFreeBlob(&keyAlias);
TEST_ASSERT_TRUE(ret == 0);
osThreadId_t id;
osThreadAttr_t attr;
g_setPriority = osPriorityAboveNormal6;
attr.name = "test";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = TEST_TASK_STACK_SIZE;
attr.priority = g_setPriority;
id = osThreadNew((osThreadFunc_t)ExecHksExistTest001, NULL, &attr);
sleep(WAIT_TO_TEST_DONE);
LiteTestPrint("HksExistTest001 End2!\n");
}
RUN_TEST_SUITE(HksExistTest);
#endif /* _CUT_AUTHENTICATE_ */
......
......@@ -28,7 +28,6 @@
#include "ohos_types.h"
#define DEFAULT_X25519_PARAM_SET_OUT 104
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
......@@ -42,6 +41,14 @@ static osPriority_t g_setPriority;
*/
LITE_TEST_SUIT(security, securityData, HksGenerateKeyTest);
static void ExecHksInitialize(void const *argument)
{
LiteTestPrint("HksInitialize Begin!\n");
TEST_ASSERT_TRUE(HksInitialize() == 0);
LiteTestPrint("HksInitialize End!\n");
osThreadExit();
}
/**
* @tc.setup: define a setup for test suit, format:"CalcMultiTest + SetUp"
* @return: true——setup success
......@@ -50,7 +57,19 @@ static BOOL HksGenerateKeyTestSetUp()
{
LiteTestPrint("setup\n");
hi_watchdog_disable();
TEST_ASSERT_TRUE(HksInitialize() == 0);
osThreadId_t id;
osThreadAttr_t attr;
g_setPriority = osPriorityAboveNormal6;
attr.name = "test";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = TEST_TASK_STACK_SIZE;
attr.priority = g_setPriority;
id = osThreadNew((osThreadFunc_t)ExecHksInitialize, NULL, &attr);
sleep(WAIT_TO_TEST_DONE);
LiteTestPrint("HksGenerateKeyTestSetUp End2!\n");
return TRUE;
}
......
......@@ -14,7 +14,6 @@
*/
#include "hks_generate_random_test.h"
#include "hctest.h"
#include "hi_watchdog.h"
#include "hks_api.h"
......@@ -27,6 +26,11 @@
#include "cmsis_os2.h"
#include "ohos_types.h"
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
/*
* @tc.register: register a test suit named "CalcMultiTest"
* @param: test subsystem name
......@@ -35,6 +39,14 @@
*/
LITE_TEST_SUIT(security, securityData, HksGenerateRandomTest);
static void ExecHksInitialize(void const *argument)
{
LiteTestPrint("HksInitialize Begin!\n");
TEST_ASSERT_TRUE(HksInitialize() == 0);
LiteTestPrint("HksInitialize End!\n");
osThreadExit();
}
/**
* @tc.setup: define a setup for test suit, format:"CalcMultiTest + SetUp"
* @return: true——setup success
......@@ -43,7 +55,19 @@ static BOOL HksGenerateRandomTestSetUp()
{
LiteTestPrint("setup\n");
hi_watchdog_disable();
TEST_ASSERT_TRUE(HksInitialize() == 0);
osThreadId_t id;
osThreadAttr_t attr;
g_setPriority = osPriorityAboveNormal6;
attr.name = "test";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = TEST_TASK_STACK_SIZE;
attr.priority = g_setPriority;
id = osThreadNew((osThreadFunc_t)ExecHksInitialize, NULL, &attr);
sleep(WAIT_TO_TEST_DONE);
LiteTestPrint("HksGenerateRandomTestSetUp End2!\n");
return TRUE;
}
......@@ -63,11 +87,6 @@ static const struct HksTestGenRandomParams g_testGenRandomParams[] = {
{ 0, HKS_SUCCESS, { true, HKS_MAX_RANDOM_LEN, true, HKS_MAX_RANDOM_LEN } },
};
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
static void ExecHksGenerateRandomTest001(void const *argument)
{
int32_t ret;
......
......@@ -15,8 +15,6 @@
#ifndef _CUT_AUTHENTICATE_
#include "hks_hash_test.h"
#include <hctest.h>
#include "hi_watchdog.h"
#include "hks_api.h"
......@@ -25,14 +23,17 @@
#include "hks_test_common.h"
#include "hks_test_log.h"
#include "hks_type.h"
#include "hks_hash_test.h"
#include "cmsis_os2.h"
#include "ohos_types.h"
#define DEFAULT_SRC_DATA_SIZE 200
#define DIGEST_SHA256_HASH_SIZE 32
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
/*
* @tc.register: register a test suit named "CalcMultiTest"
......@@ -42,6 +43,14 @@
*/
LITE_TEST_SUIT(security, securityData, HksHashTest);
static void ExecHksInitialize(void const *argument)
{
LiteTestPrint("HksInitialize Begin!\n");
TEST_ASSERT_TRUE(HksInitialize() == 0);
LiteTestPrint("HksInitialize End!\n");
osThreadExit();
}
/**
* @tc.setup: define a setup for test suit, format:"CalcMultiTest + SetUp"
* @return: true——setup success
......@@ -50,7 +59,19 @@ static BOOL HksHashTestSetUp()
{
LiteTestPrint("setup\n");
hi_watchdog_disable();
TEST_ASSERT_TRUE(HksInitialize() == 0);
osThreadId_t id;
osThreadAttr_t attr;
g_setPriority = osPriorityAboveNormal6;
attr.name = "test";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = TEST_TASK_STACK_SIZE;
attr.priority = g_setPriority;
id = osThreadNew((osThreadFunc_t)ExecHksInitialize, NULL, &attr);
sleep(WAIT_TO_TEST_DONE);
LiteTestPrint("HksMacTestSetUp End2!\n");
return TRUE;
}
......@@ -65,11 +86,6 @@ static BOOL HksHashTestTearDown()
return TRUE;
}
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
static const struct HksTestHashParams g_testHashParams[] = {
/* normal case */
{ 0, HKS_SUCCESS,
......
......@@ -30,6 +30,11 @@
#define HKS_DEFAULT_MAC_SRCDATA_SIZE 253
#define HKS_DEFAULT_MAC_SHA256_SIZE 32
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
static const struct HksTestMacParams g_testMacParams[] = {
/* success: ree-sha256 */
......@@ -59,6 +64,14 @@ static const struct HksTestMacParams g_testMacParams[] = {
*/
LITE_TEST_SUIT(security, securityData, HksMacTest);
static void ExecHksInitialize(void const *argument)
{
LiteTestPrint("HksInitialize Begin!\n");
TEST_ASSERT_TRUE(HksInitialize() == 0);
LiteTestPrint("HksInitialize End!\n");
osThreadExit();
}
/**
* @tc.setup: define a setup for test suit, format:"CalcMultiTest + SetUp"
* @return: true——setup success
......@@ -67,7 +80,19 @@ static BOOL HksMacTestSetUp()
{
LiteTestPrint("setup\n");
hi_watchdog_disable();
TEST_ASSERT_TRUE(HksInitialize() == 0);
osThreadId_t id;
osThreadAttr_t attr;
g_setPriority = osPriorityAboveNormal6;
attr.name = "test";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = TEST_TASK_STACK_SIZE;
attr.priority = g_setPriority;
id = osThreadNew((osThreadFunc_t)ExecHksInitialize, NULL, &attr);
sleep(WAIT_TO_TEST_DONE);
LiteTestPrint("HksMacTestSetUp End2!\n");
return TRUE;
}
......@@ -82,12 +107,6 @@ static BOOL HksMacTestTearDown()
return TRUE;
}
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
static int32_t ConstructDataToBlob(struct HksBlob **srcData, struct HksBlob **macData,
const struct HksTestBlobParams *srcDataParams, const struct HksTestBlobParams *macDataParams)
{
......
......@@ -37,6 +37,11 @@
static const char *g_storePath = "./hks_store/";
static const char *g_testName = "TestName";
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
static const struct HksTestCipherParams g_testCipherParams[] = {
/* success: aes256-gcm-none */
{ 0, HKS_SUCCESS, { true, DEFAULT_KEY_ALIAS_SIZE, true, DEFAULT_KEY_ALIAS_SIZE },
......@@ -88,6 +93,14 @@ static const struct HksTestCipherParams g_testCipherParams[] = {
*/
LITE_TEST_SUIT(security, securityData, HksModifyKeyTest);
static void ExecHksInitialize(void const *argument)
{
LiteTestPrint("HksInitialize Begin!\n");
TEST_ASSERT_TRUE(HksInitialize() == 0);
LiteTestPrint("HksInitialize End!\n");
osThreadExit();
}
/**
* @tc.setup: define a setup for test suit, format:"CalcMultiTest + SetUp"
* @return: true——setup success
......@@ -96,7 +109,19 @@ static BOOL HksModifyKeyTestSetUp()
{
LiteTestPrint("setup\n");
hi_watchdog_disable();
TEST_ASSERT_TRUE(HksInitialize() == 0);
osThreadId_t id;
osThreadAttr_t attr;
g_setPriority = osPriorityAboveNormal6;
attr.name = "test";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = TEST_TASK_STACK_SIZE;
attr.priority = g_setPriority;
id = osThreadNew((osThreadFunc_t)ExecHksInitialize, NULL, &attr);
sleep(WAIT_TO_TEST_DONE);
LiteTestPrint("HksModifyKeyTestSetUp End2!\n");
return TRUE;
}
......@@ -310,13 +335,10 @@ int32_t __attribute__((weak)) HksStoreKeyBlob(const struct HksBlob *processName,
(void)keyBlob;
}
/**
* @tc.name: HksModifyKeyTest.HksModifyKeyTest001
* @tc.desc: The static function will return true;
* @tc.type: FUNC
*/
LITE_TEST_CASE(HksModifyKeyTest, HksModifyKeyTest001, Level1)
static void ExecHksModifyKeyTest001(void const *argument)
{
LiteTestPrint("HksModifyKeyTest001 Begin!\n");
uint32_t index = 0;
struct HksBlob keyAlias = { strlen(g_testName), (uint8_t *)g_testName };
int32_t ret = GenerateKeyTwo(&keyAlias, &g_testCipherParams[index].keyAliasParams,
......@@ -365,6 +387,31 @@ LITE_TEST_CASE(HksModifyKeyTest, HksModifyKeyTest001, Level1)
TestFreeBlob(&nonceData);
TestFreeBlob(&aadData);
TEST_ASSERT_TRUE(ret != 0);
LiteTestPrint("HksModifyKeyTest001 End!\n");
osThreadExit();
}
/**
* @tc.name: HksModifyKeyTest.HksModifyKeyTest001
* @tc.desc: The static function will return true;
* @tc.type: FUNC
*/
LITE_TEST_CASE(HksModifyKeyTest, HksModifyKeyTest001, Level1)
{
osThreadId_t id;
osThreadAttr_t attr;
g_setPriority = osPriorityAboveNormal6;
attr.name = "test";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = TEST_TASK_STACK_SIZE;
attr.priority = g_setPriority;
id = osThreadNew((osThreadFunc_t)ExecHksModifyKeyTest001, NULL, &attr);
sleep(WAIT_TO_TEST_DONE);
LiteTestPrint("HksModifyKeyTest001 End2!\n");
}
RUN_TEST_SUITE(HksModifyKeyTest);
......
......@@ -26,6 +26,11 @@
#include "cmsis_os2.h"
#include "ohos_types.h"
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
/*
* @tc.register: register a test suit named "CalcMultiTest"
* @param: test subsystem name
......@@ -34,6 +39,13 @@
*/
LITE_TEST_SUIT(security, securityData, HksOthersTest);
static void ExecHksInitialize(void const *argument)
{
LiteTestPrint("HksInitialize Begin!\n");
TEST_ASSERT_TRUE(HksInitialize() == 0);
LiteTestPrint("HksInitialize End!\n");
osThreadExit();
}
/**
* @tc.setup: define a setup for test suit, format:"CalcMultiTest + SetUp"
* @return: true——setup success
......@@ -42,7 +54,19 @@ static BOOL HksOthersTestSetUp()
{
LiteTestPrint("setup\n");
hi_watchdog_disable();
TEST_ASSERT_TRUE(HksInitialize() == 0);
osThreadId_t id;
osThreadAttr_t attr;
g_setPriority = osPriorityAboveNormal6;
attr.name = "test";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = TEST_TASK_STACK_SIZE;
attr.priority = g_setPriority;
id = osThreadNew((osThreadFunc_t)ExecHksInitialize, NULL, &attr);
sleep(WAIT_TO_TEST_DONE);
LiteTestPrint("HksOthersTestSetUp End2!\n");
return TRUE;
}
......@@ -57,11 +81,6 @@ static BOOL HksOthersTestTearDown()
return TRUE;
}
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
static void ExcHksOthersTest001(void const *argument)
{
LiteTestPrint("HksOthersTest001 Begin!\n");
......
......@@ -30,6 +30,11 @@
const char *g_storePath = "/storage/";
const char *g_testEd25519 = "test_ed25519";
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
/*
* @tc.register: register a test suit named "CalcMultiTest"
* @param: test subsystem name
......@@ -38,6 +43,14 @@ const char *g_testEd25519 = "test_ed25519";
*/
LITE_TEST_SUIT(security, securityData, HksSafeCipherKeyTest);
static void ExecHksInitialize(void const *argument)
{
LiteTestPrint("HksInitialize Begin!\n");
TEST_ASSERT_TRUE(HksInitialize() == 0);
LiteTestPrint("HksInitialize End!\n");
osThreadExit();
}
/**
* @tc.setup: define a setup for test suit, format:"CalcMultiTest + SetUp"
* @return: true——setup success
......@@ -46,7 +59,20 @@ static BOOL HksSafeCipherKeyTestSetUp()
{
LiteTestPrint("setup\n");
hi_watchdog_disable();
TEST_ASSERT_TRUE(HksInitialize() == 0);
osThreadId_t id;
osThreadAttr_t attr;
g_setPriority = osPriorityAboveNormal6;
attr.name = "test";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = TEST_TASK_STACK_SIZE;
attr.priority = g_setPriority;
id = osThreadNew((osThreadFunc_t)ExecHksInitialize, NULL, &attr);
sleep(WAIT_TO_TEST_DONE);
LiteTestPrint("HksSafeCipherKeyTestSetUp End2!\n");
return TRUE;
}
......
......@@ -34,6 +34,11 @@ static const char *g_storePath = "/storage/";
static const char *g_testOne = "TestOne";
static const char *g_testTwo = "TestTwo";
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
/*
* @tc.register: register a test suit named "CalcMultiTest"
* @param: test subsystem name
......@@ -46,11 +51,31 @@ LITE_TEST_SUIT(security, securityData, HksSafeCompareKeyTest);
* @tc.setup: define a setup for test suit, format:"CalcMultiTest + SetUp"
* @return: true——setup success
*/
static void ExecHksInitialize(void const *argument)
{
LiteTestPrint("HksInitialize Begin!\n");
TEST_ASSERT_TRUE(HksInitialize() == 0);
LiteTestPrint("HksInitialize End!\n");
osThreadExit();
}
static BOOL HksSafeCompareKeyTestSetUp()
{
LiteTestPrint("setup\n");
hi_watchdog_disable();
TEST_ASSERT_TRUE(HksInitialize() == 0);
hi_watchdog_disable();
osThreadId_t id;
osThreadAttr_t attr;
g_setPriority = osPriorityAboveNormal6;
attr.name = "test";
attr.attr_bits = 0U;
attr.cb_mem = NULL;
attr.cb_size = 0U;
attr.stack_mem = NULL;
attr.stack_size = TEST_TASK_STACK_SIZE;
attr.priority = g_setPriority;
id = osThreadNew((osThreadFunc_t)ExecHksInitialize, NULL, &attr);
sleep(WAIT_TO_TEST_DONE);
LiteTestPrint("HksSafeCompareKeyTestSetUp End2!\n");
return TRUE;
}
......@@ -65,10 +90,7 @@ static BOOL HksSafeCompareKeyTestTearDown()
return TRUE;
}
#define TEST_TASK_STACK_SIZE 0x2000
#define WAIT_TO_TEST_DONE 4
static osPriority_t g_setPriority;
static const struct HksTestGenKeyParams g_testGenKeyParams[] = {
/* x25519: tee sign/verify */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册