提交 4611a81e 编写于 作者: Q qiaozzzh

fixed 0308fa12 from https://gitee.com/qiaozzzh/xts_acts/pulls/6111

告警修改
Signed-off-by: Nqiaozzzh <qiaozhang@huawei.com>
Change-Id: I670398cc68d01f03178ed47bf5663923c9bad7d5
上级 5afdefe5
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
int32_t HksGenerateKeyRun(const struct HksBlob *keyAlias, const struct HksParamSet *paramSetIn, int32_t HksGenerateKeyRun(const struct HksBlob *keyAlias, const struct HksParamSet *paramSetIn,
struct HksParamSet *paramSetOut, uint32_t performTimes) struct HksParamSet *paramSetOut, uint32_t performTimes)
{ {
int32_t ret; int32_t ret = 0;
/* if keyAlias exist, the key will be generated and refreshed */ /* if keyAlias exist, the key will be generated and refreshed */
for (uint32_t i = 0; i < performTimes; ++i) { for (uint32_t i = 0; i < performTimes; ++i) {
ret = HksGenerateKey(keyAlias, paramSetIn, paramSetOut); ret = HksGenerateKey(keyAlias, paramSetIn, paramSetOut);
...@@ -42,7 +42,7 @@ int32_t HksGenerateKeyRun(const struct HksBlob *keyAlias, const struct HksParamS ...@@ -42,7 +42,7 @@ int32_t HksGenerateKeyRun(const struct HksBlob *keyAlias, const struct HksParamS
int32_t HksEncryptRun(const struct HksBlob *key, const struct HksParamSet *paramSet, int32_t HksEncryptRun(const struct HksBlob *key, const struct HksParamSet *paramSet,
const struct HksBlob *plainText, struct HksBlob *cipherText, uint32_t performTimes) const struct HksBlob *plainText, struct HksBlob *cipherText, uint32_t performTimes)
{ {
int32_t ret; int32_t ret = 0;
uint32_t oriCipherTestSize = 0; uint32_t oriCipherTestSize = 0;
if (cipherText != NULL) { if (cipherText != NULL) {
oriCipherTestSize = cipherText->size; oriCipherTestSize = cipherText->size;
...@@ -65,7 +65,7 @@ int32_t HksEncryptRun(const struct HksBlob *key, const struct HksParamSet *param ...@@ -65,7 +65,7 @@ int32_t HksEncryptRun(const struct HksBlob *key, const struct HksParamSet *param
int32_t HksDecryptRun(const struct HksBlob *key, const struct HksParamSet *paramSet, int32_t HksDecryptRun(const struct HksBlob *key, const struct HksParamSet *paramSet,
const struct HksBlob *cipherText, struct HksBlob *plainText, uint32_t performTimes) const struct HksBlob *cipherText, struct HksBlob *plainText, uint32_t performTimes)
{ {
int32_t ret; int32_t ret = 0;
uint32_t oriPlainTextSize = 0; uint32_t oriPlainTextSize = 0;
if (plainText != NULL) { if (plainText != NULL) {
oriPlainTextSize = plainText->size; oriPlainTextSize = plainText->size;
...@@ -87,7 +87,7 @@ int32_t HksDecryptRun(const struct HksBlob *key, const struct HksParamSet *param ...@@ -87,7 +87,7 @@ int32_t HksDecryptRun(const struct HksBlob *key, const struct HksParamSet *param
int32_t HksMacRun(const struct HksBlob *key, const struct HksParamSet *paramSet, int32_t HksMacRun(const struct HksBlob *key, const struct HksParamSet *paramSet,
const struct HksBlob *srcData, struct HksBlob *mac, uint32_t performTimes) const struct HksBlob *srcData, struct HksBlob *mac, uint32_t performTimes)
{ {
int32_t ret; int32_t ret = 0;
uint32_t oriMacSize = 0; uint32_t oriMacSize = 0;
if (mac != NULL) { if (mac != NULL) {
oriMacSize = mac->size; oriMacSize = mac->size;
...@@ -109,7 +109,7 @@ int32_t HksMacRun(const struct HksBlob *key, const struct HksParamSet *paramSet, ...@@ -109,7 +109,7 @@ int32_t HksMacRun(const struct HksBlob *key, const struct HksParamSet *paramSet,
int32_t HksDeriveKeyRun(const struct HksParamSet *paramSet, const struct HksBlob *masterKey, int32_t HksDeriveKeyRun(const struct HksParamSet *paramSet, const struct HksBlob *masterKey,
struct HksBlob *derivedKey, uint32_t performTimes) struct HksBlob *derivedKey, uint32_t performTimes)
{ {
int32_t ret; int32_t ret = 0;
uint32_t oriDerivedKeySize = 0; uint32_t oriDerivedKeySize = 0;
if (derivedKey != NULL) { if (derivedKey != NULL) {
oriDerivedKeySize = derivedKey->size; oriDerivedKeySize = derivedKey->size;
...@@ -136,7 +136,7 @@ int32_t HksDeleteKeyRun(const struct HksBlob *keyAlias, uint32_t performTimes) ...@@ -136,7 +136,7 @@ int32_t HksDeleteKeyRun(const struct HksBlob *keyAlias, uint32_t performTimes)
int32_t HksKeyExistRun(const struct HksBlob *keyAlias, uint32_t performTimes) int32_t HksKeyExistRun(const struct HksBlob *keyAlias, uint32_t performTimes)
{ {
int32_t ret; int32_t ret = 0;
for (uint32_t i = 0; i < performTimes; ++i) { for (uint32_t i = 0; i < performTimes; ++i) {
ret = HksKeyExist(keyAlias, NULL); ret = HksKeyExist(keyAlias, NULL);
if (ret != HKS_SUCCESS) { if (ret != HKS_SUCCESS) {
...@@ -148,7 +148,7 @@ int32_t HksKeyExistRun(const struct HksBlob *keyAlias, uint32_t performTimes) ...@@ -148,7 +148,7 @@ int32_t HksKeyExistRun(const struct HksBlob *keyAlias, uint32_t performTimes)
int32_t HksGenerateRandomRun(struct HksBlob *random, uint32_t performTimes) int32_t HksGenerateRandomRun(struct HksBlob *random, uint32_t performTimes)
{ {
int32_t ret; int32_t ret = 0;
uint32_t oriRandomSize = 0; uint32_t oriRandomSize = 0;
if (random != NULL) { if (random != NULL) {
oriRandomSize = random->size; oriRandomSize = random->size;
...@@ -170,7 +170,7 @@ int32_t HksGenerateRandomRun(struct HksBlob *random, uint32_t performTimes) ...@@ -170,7 +170,7 @@ int32_t HksGenerateRandomRun(struct HksBlob *random, uint32_t performTimes)
int32_t HksAgreeKeyRun(const struct HksParamSet *paramSet, const struct HksBlob *privateKey, int32_t HksAgreeKeyRun(const struct HksParamSet *paramSet, const struct HksBlob *privateKey,
const struct HksBlob *peerPublicKey, struct HksBlob *agreedKey, uint32_t performTimes) const struct HksBlob *peerPublicKey, struct HksBlob *agreedKey, uint32_t performTimes)
{ {
int32_t ret; int32_t ret = 0;
uint32_t oriAgreedKeySize = 0; uint32_t oriAgreedKeySize = 0;
if (agreedKey != NULL) { if (agreedKey != NULL) {
oriAgreedKeySize = agreedKey->size; oriAgreedKeySize = agreedKey->size;
...@@ -192,7 +192,7 @@ int32_t HksAgreeKeyRun(const struct HksParamSet *paramSet, const struct HksBlob ...@@ -192,7 +192,7 @@ int32_t HksAgreeKeyRun(const struct HksParamSet *paramSet, const struct HksBlob
int32_t HksHashRun(const struct HksParamSet *paramSet, int32_t HksHashRun(const struct HksParamSet *paramSet,
const struct HksBlob *srcData, struct HksBlob *hash, uint32_t performTimes) const struct HksBlob *srcData, struct HksBlob *hash, uint32_t performTimes)
{ {
int32_t ret; int32_t ret = 0;
uint32_t oriHashSize = 0; uint32_t oriHashSize = 0;
if (hash != NULL) { if (hash != NULL) {
oriHashSize = hash->size; oriHashSize = hash->size;
...@@ -215,7 +215,7 @@ int32_t HksHashRun(const struct HksParamSet *paramSet, ...@@ -215,7 +215,7 @@ int32_t HksHashRun(const struct HksParamSet *paramSet,
int32_t HksBnExpModRun(struct HksBlob *x, const struct HksBlob *a, int32_t HksBnExpModRun(struct HksBlob *x, const struct HksBlob *a,
const struct HksBlob *e, const struct HksBlob *n, uint32_t performTimes) const struct HksBlob *e, const struct HksBlob *n, uint32_t performTimes)
{ {
int32_t ret; int32_t ret = 0;
uint32_t oriXSize = 0; uint32_t oriXSize = 0;
if (x != NULL) { if (x != NULL) {
oriXSize = x->size; oriXSize = x->size;
......
...@@ -508,7 +508,7 @@ char *GetCurrentPath() ...@@ -508,7 +508,7 @@ char *GetCurrentPath()
int CheckFsMount(const char *topDir, const char *topDirMountInfo) int CheckFsMount(const char *topDir, const char *topDirMountInfo)
{ {
const int lenMax = 100; const int lenMax = 100;
int len; int len = 0;
char buf[lenMax] = {0}; char buf[lenMax] = {0};
const char mountInfoFile[] = "/proc/mounts"; const char mountInfoFile[] = "/proc/mounts";
// check topDir exist // check topDir exist
......
...@@ -344,7 +344,7 @@ static int CapgetWithCaps(pid_t pid, unsigned int caps) ...@@ -344,7 +344,7 @@ static int CapgetWithCaps(pid_t pid, unsigned int caps)
*/ */
HWTEST_F(CapabilityTestSuite, CapabilityTest0600, Function | MediumTest | Level2) HWTEST_F(CapabilityTestSuite, CapabilityTest0600, Function | MediumTest | Level2)
{ {
int ret; int ret = 0;
int status1 = 0; int status1 = 0;
int status2 = 0; int status2 = 0;
// Preset action: Fork a sub process pid1 // Preset action: Fork a sub process pid1
...@@ -404,7 +404,7 @@ HWTEST_F(CapabilityTestSuite, CapabilityTest0600, Function | MediumTest | Level2 ...@@ -404,7 +404,7 @@ HWTEST_F(CapabilityTestSuite, CapabilityTest0600, Function | MediumTest | Level2
*/ */
HWTEST_F(CapabilityTestSuite, CapabilityTest0700, Function | MediumTest | Level2) HWTEST_F(CapabilityTestSuite, CapabilityTest0700, Function | MediumTest | Level2)
{ {
int ret; int ret = 0;
int status = 0; int status = 0;
pid_t pid = fork(); // Preset action: Fork a sub process pid_t pid = fork(); // Preset action: Fork a sub process
ASSERT_TRUE(pid >= 0) << "======== Fork Error! ========="; ASSERT_TRUE(pid >= 0) << "======== Fork Error! =========";
...@@ -454,7 +454,7 @@ HWTEST_F(CapabilityTestSuite, CapabilityTest0700, Function | MediumTest | Level2 ...@@ -454,7 +454,7 @@ HWTEST_F(CapabilityTestSuite, CapabilityTest0700, Function | MediumTest | Level2
*/ */
HWTEST_F(CapabilityTestSuite, CapabilityTest0800, Function | MediumTest | Level2) HWTEST_F(CapabilityTestSuite, CapabilityTest0800, Function | MediumTest | Level2)
{ {
int ret; int ret = 0;
int status = 0; int status = 0;
// Preset action: Fork a sub process // Preset action: Fork a sub process
pid_t pid = fork(); pid_t pid = fork();
...@@ -522,7 +522,7 @@ HWTEST_F(CapabilityTestSuite, CapabilityTest0800, Function | MediumTest | Level2 ...@@ -522,7 +522,7 @@ HWTEST_F(CapabilityTestSuite, CapabilityTest0800, Function | MediumTest | Level2
*/ */
HWTEST_F(CapabilityTestSuite, CapabilityTest0900, Security | MediumTest | Level2) HWTEST_F(CapabilityTestSuite, CapabilityTest0900, Security | MediumTest | Level2)
{ {
int ret; int ret = 0;
int status = 0; int status = 0;
// Preset action: Fork a sub process // Preset action: Fork a sub process
pid_t pid = fork(); pid_t pid = fork();
...@@ -559,7 +559,7 @@ HWTEST_F(CapabilityTestSuite, CapabilityTest0900, Security | MediumTest | Level2 ...@@ -559,7 +559,7 @@ HWTEST_F(CapabilityTestSuite, CapabilityTest0900, Security | MediumTest | Level2
*/ */
HWTEST_F(CapabilityTestSuite, CapabilityTest1000, Function | MediumTest | Level2) HWTEST_F(CapabilityTestSuite, CapabilityTest1000, Function | MediumTest | Level2)
{ {
int ret; int ret = 0;
int status1 = 0; int status1 = 0;
int status2 = 0; int status2 = 0;
// Preset action: Fork a sub process pid1 // Preset action: Fork a sub process pid1
...@@ -623,7 +623,7 @@ HWTEST_F(CapabilityTestSuite, CapabilityTest1000, Function | MediumTest | Level2 ...@@ -623,7 +623,7 @@ HWTEST_F(CapabilityTestSuite, CapabilityTest1000, Function | MediumTest | Level2
*/ */
HWTEST_F(CapabilityTestSuite, CapabilityTest1100, Function | MediumTest | Level2) HWTEST_F(CapabilityTestSuite, CapabilityTest1100, Function | MediumTest | Level2)
{ {
int ret; int ret = 0;
int status = 0; int status = 0;
struct timespec tp = { 0 }; struct timespec tp = { 0 };
// Preset action: Fork a sub process // Preset action: Fork a sub process
...@@ -821,7 +821,7 @@ HWTEST_F(CapabilityTestSuite, CapabilityTest1500, Reliability | MediumTest | Lev ...@@ -821,7 +821,7 @@ HWTEST_F(CapabilityTestSuite, CapabilityTest1500, Reliability | MediumTest | Lev
*/ */
HWTEST_F(CapabilityTestSuite, CapabilityTest1600, Reliability | MediumTest | Level3) HWTEST_F(CapabilityTestSuite, CapabilityTest1600, Reliability | MediumTest | Level3)
{ {
int ret; int ret = 0;
int status = 0; int status = 0;
// Preset action: Fork a sub process // Preset action: Fork a sub process
pid_t pid = fork(); pid_t pid = fork();
...@@ -901,7 +901,7 @@ HWTEST_F(CapabilityTestSuite, CapabilityTest1700, Reliability | MediumTest | Lev ...@@ -901,7 +901,7 @@ HWTEST_F(CapabilityTestSuite, CapabilityTest1700, Reliability | MediumTest | Lev
*/ */
HWTEST_F(CapabilityTestSuite, CapabilityTest1800, Reliability | MediumTest | Level3) HWTEST_F(CapabilityTestSuite, CapabilityTest1800, Reliability | MediumTest | Level3)
{ {
int ret; int ret = 0;
int status = 0; int status = 0;
// Preset action: Fork a sub process // Preset action: Fork a sub process
pid_t pid = fork(); pid_t pid = fork();
...@@ -939,7 +939,7 @@ HWTEST_F(CapabilityTestSuite, CapabilityTest1800, Reliability | MediumTest | Lev ...@@ -939,7 +939,7 @@ HWTEST_F(CapabilityTestSuite, CapabilityTest1800, Reliability | MediumTest | Lev
*/ */
HWTEST_F(CapabilityTestSuite, CapabilityTest1900, Reliability | MediumTest | Level2) HWTEST_F(CapabilityTestSuite, CapabilityTest1900, Reliability | MediumTest | Level2)
{ {
int ret; int ret = 0;
int status = 0; int status = 0;
// Preset action: Fork a sub process // Preset action: Fork a sub process
pid_t pid = fork(); pid_t pid = fork();
......
...@@ -642,7 +642,7 @@ HWTEST_F(DacTestSuite, DACTest0020, Function | MediumTest | Level1) ...@@ -642,7 +642,7 @@ HWTEST_F(DacTestSuite, DACTest0020, Function | MediumTest | Level1)
*/ */
HWTEST_F(DacTestSuite, DACTest0030, Function | MediumTest | Level1) HWTEST_F(DacTestSuite, DACTest0030, Function | MediumTest | Level1)
{ {
int ret; int ret = 0;
gid_t grouplist[SIZE255]; gid_t grouplist[SIZE255];
// Preset action: Obtain the groups of the current process // Preset action: Obtain the groups of the current process
unsigned int groupsize = getgroups(0, grouplist); unsigned int groupsize = getgroups(0, grouplist);
...@@ -677,7 +677,7 @@ HWTEST_F(DacTestSuite, DACTest0030, Function | MediumTest | Level1) ...@@ -677,7 +677,7 @@ HWTEST_F(DacTestSuite, DACTest0030, Function | MediumTest | Level1)
*/ */
HWTEST_F(DacTestSuite, DACTest0040, Function | MediumTest | Level2) HWTEST_F(DacTestSuite, DACTest0040, Function | MediumTest | Level2)
{ {
int ret; int ret = 0;
gid_t grouplist[SIZE255]; gid_t grouplist[SIZE255];
// Preset action: Obtain the groups of the current process // Preset action: Obtain the groups of the current process
unsigned int groupsize = getgroups(0, grouplist); unsigned int groupsize = getgroups(0, grouplist);
...@@ -712,7 +712,7 @@ HWTEST_F(DacTestSuite, DACTest0040, Function | MediumTest | Level2) ...@@ -712,7 +712,7 @@ HWTEST_F(DacTestSuite, DACTest0040, Function | MediumTest | Level2)
*/ */
HWTEST_F(DacTestSuite, DACTest0050, Function | MediumTest | Level3) HWTEST_F(DacTestSuite, DACTest0050, Function | MediumTest | Level3)
{ {
int ret; int ret = 0;
gid_t grouplist[SIZE255]; gid_t grouplist[SIZE255];
// Preset action: Obtain the groups of the current process // Preset action: Obtain the groups of the current process
unsigned int groupsize = getgroups(0, grouplist); unsigned int groupsize = getgroups(0, grouplist);
...@@ -747,7 +747,7 @@ HWTEST_F(DacTestSuite, DACTest0050, Function | MediumTest | Level3) ...@@ -747,7 +747,7 @@ HWTEST_F(DacTestSuite, DACTest0050, Function | MediumTest | Level3)
*/ */
HWTEST_F(DacTestSuite, DACTest0060, Function | MediumTest | Level3) HWTEST_F(DacTestSuite, DACTest0060, Function | MediumTest | Level3)
{ {
int ret; int ret = 0;
gid_t grouplist[SIZE255]; gid_t grouplist[SIZE255];
// Preset action: Obtain the groups of the current process // Preset action: Obtain the groups of the current process
size_t groupsize = getgroups(0, grouplist); size_t groupsize = getgroups(0, grouplist);
...@@ -787,7 +787,7 @@ HWTEST_F(DacTestSuite, DACTest0060, Function | MediumTest | Level3) ...@@ -787,7 +787,7 @@ HWTEST_F(DacTestSuite, DACTest0060, Function | MediumTest | Level3)
*/ */
HWTEST_F(DacTestSuite, DACTest0070, Security | MediumTest | Level2) HWTEST_F(DacTestSuite, DACTest0070, Security | MediumTest | Level2)
{ {
int ret; int ret = 0;
int status = 0; int status = 0;
// Preset action: Fork three sub processes // Preset action: Fork three sub processes
pid_t pid; pid_t pid;
...@@ -849,7 +849,7 @@ HWTEST_F(DacTestSuite, DACTest0070, Security | MediumTest | Level2) ...@@ -849,7 +849,7 @@ HWTEST_F(DacTestSuite, DACTest0070, Security | MediumTest | Level2)
*/ */
HWTEST_F(DacTestSuite, DACTest0080, Function | MediumTest | Level2) HWTEST_F(DacTestSuite, DACTest0080, Function | MediumTest | Level2)
{ {
int ret; int ret = 0;
uid_t ruid = 0; uid_t euid = 0; uid_t suid = 0; uid_t ruid = 0; uid_t euid = 0; uid_t suid = 0;
uid_t newruid = 0; uid_t neweuid = 0; uid_t newsuid = 0; uid_t newruid = 0; uid_t neweuid = 0; uid_t newsuid = 0;
gid_t rgid = 0; gid_t egid = 0; gid_t sgid = 0; gid_t rgid = 0; gid_t egid = 0; gid_t sgid = 0;
...@@ -909,7 +909,7 @@ HWTEST_F(DacTestSuite, DACTest0080, Function | MediumTest | Level2) ...@@ -909,7 +909,7 @@ HWTEST_F(DacTestSuite, DACTest0080, Function | MediumTest | Level2)
*/ */
HWTEST_F(DacTestSuite, DACTest0120, Security | MediumTest | Level2) HWTEST_F(DacTestSuite, DACTest0120, Security | MediumTest | Level2)
{ {
int ret; int ret = 0;
int status = 0; int status = 0;
// Preset action: Fork a sub process // Preset action: Fork a sub process
pid_t pid = fork(); pid_t pid = fork();
......
...@@ -171,7 +171,7 @@ HWTEST_F(ActsPMSLoadTest, testSecPMPMS_0540, Function | MediumTest | Level1) ...@@ -171,7 +171,7 @@ HWTEST_F(ActsPMSLoadTest, testSecPMPMS_0540, Function | MediumTest | Level1)
HWTEST_F(ActsPMSLoadTest, testSecPMPMS_0550, Function | MediumTest | Level0) HWTEST_F(ActsPMSLoadTest, testSecPMPMS_0550, Function | MediumTest | Level0)
{ {
SaveOrUpdatePermissions(TEST_APP_ID, g_systemPers, SYS_PERM_NUM, FIRST_INSTALL); SaveOrUpdatePermissions(TEST_APP_ID, g_systemPers, SYS_PERM_NUM, FIRST_INSTALL);
int i; int i = 0;
for (i = 0; i < SYS_PERM_NUM; i++) { for (i = 0; i < SYS_PERM_NUM; i++) {
g_interface->GrantPermission(TEST_APP_ID, g_systemPers[i].name); g_interface->GrantPermission(TEST_APP_ID, g_systemPers[i].name);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册