提交 2e9f0206 编写于 作者: X xialiyun

hujixiang1@huawei.com

Signed-off-by: Nxialiyun <xialiyun@huawei.com>
Change-Id: Idcf44a7dc27febbc932ed6b55d15561fad47bcde
上级 588aa762
...@@ -645,12 +645,9 @@ HWTEST_F(DacTestSuite, DACTest0030, Function | MediumTest | Level1) ...@@ -645,12 +645,9 @@ HWTEST_F(DacTestSuite, DACTest0030, Function | MediumTest | Level1)
int ret; int ret;
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); unsigned int groupsize = getgroups(0, grouplist);
if (groupsize >= 0) { if (groupsize >= 0) {
getgroups(groupsize, grouplist); getgroups(groupsize, grouplist);
} else {
EXPECT_GE(groupsize, 0) << "ErrInfo: Failed to get groups";
}
// Preset action: Obtain the group lists required for the testcase // Preset action: Obtain the group lists required for the testcase
gid_t list1[SIZE1] = {1}; gid_t list1[SIZE1] = {1};
gid_t list2[SIZE1] = {MAX_INT}; gid_t list2[SIZE1] = {MAX_INT};
...@@ -668,6 +665,9 @@ HWTEST_F(DacTestSuite, DACTest0030, Function | MediumTest | Level1) ...@@ -668,6 +665,9 @@ HWTEST_F(DacTestSuite, DACTest0030, Function | MediumTest | Level1)
setgroups(0, nullptr); setgroups(0, nullptr);
ret = setgroups(groupsize, grouplist); ret = setgroups(groupsize, grouplist);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to restore the initial groups of the process"; EXPECT_EQ(ret, 0) << "ErrInfo: Failed to restore the initial groups of the process";
} else {
EXPECT_GE(groupsize, 0) << "ErrInfo: Failed to get groups";
}
} }
/* /*
...@@ -680,12 +680,9 @@ HWTEST_F(DacTestSuite, DACTest0040, Function | MediumTest | Level2) ...@@ -680,12 +680,9 @@ HWTEST_F(DacTestSuite, DACTest0040, Function | MediumTest | Level2)
int ret; int ret;
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); unsigned int groupsize = getgroups(0, grouplist);
if (groupsize >= 0) { if (groupsize >= 0) {
getgroups(groupsize, grouplist); getgroups(groupsize, grouplist);
} else {
EXPECT_GE(groupsize, 0) << "ErrInfo: Failed to get groups";
}
// Preset action: Obtain the group lists required for the testcase // Preset action: Obtain the group lists required for the testcase
gid_t list1[SIZE2]={GID0, GID0}; gid_t list1[SIZE2]={GID0, GID0};
gid_t list2[SIZE2]={GID1, GID1}; gid_t list2[SIZE2]={GID1, GID1};
...@@ -703,6 +700,9 @@ HWTEST_F(DacTestSuite, DACTest0040, Function | MediumTest | Level2) ...@@ -703,6 +700,9 @@ HWTEST_F(DacTestSuite, DACTest0040, Function | MediumTest | Level2)
setgroups(0, nullptr); setgroups(0, nullptr);
ret = setgroups(groupsize, grouplist); ret = setgroups(groupsize, grouplist);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to restore the initial groups of the process"; EXPECT_EQ(ret, 0) << "ErrInfo: Failed to restore the initial groups of the process";
} else {
EXPECT_GE(groupsize, 0) << "ErrInfo: Failed to get groups";
}
} }
/* /*
...@@ -715,12 +715,9 @@ HWTEST_F(DacTestSuite, DACTest0050, Function | MediumTest | Level3) ...@@ -715,12 +715,9 @@ HWTEST_F(DacTestSuite, DACTest0050, Function | MediumTest | Level3)
int ret; int ret;
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); unsigned int groupsize = getgroups(0, grouplist);
if (groupsize >= 0) { if (groupsize >= 0) {
getgroups(groupsize, grouplist); getgroups(groupsize, grouplist);
} else {
EXPECT_GE(groupsize, 0) << "ErrInfo: Failed to get groups";
}
// Preset action: Obtain the group lists required for the testcase // Preset action: Obtain the group lists required for the testcase
gid_t list1[SIZE3]={GID0, GID0, MAX_INT}; gid_t list1[SIZE3]={GID0, GID0, MAX_INT};
gid_t list2[SIZE3]={GID10000, GID10000, MAX_INT}; gid_t list2[SIZE3]={GID10000, GID10000, MAX_INT};
...@@ -738,6 +735,9 @@ HWTEST_F(DacTestSuite, DACTest0050, Function | MediumTest | Level3) ...@@ -738,6 +735,9 @@ HWTEST_F(DacTestSuite, DACTest0050, Function | MediumTest | Level3)
setgroups(0, nullptr); setgroups(0, nullptr);
ret = setgroups(groupsize, grouplist); ret = setgroups(groupsize, grouplist);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to restore the initial groups of the process"; EXPECT_EQ(ret, 0) << "ErrInfo: Failed to restore the initial groups of the process";
} else {
EXPECT_GE(groupsize, 0) << "ErrInfo: Failed to get groups";
}
} }
/* /*
...@@ -753,9 +753,6 @@ HWTEST_F(DacTestSuite, DACTest0060, Function | MediumTest | Level3) ...@@ -753,9 +753,6 @@ HWTEST_F(DacTestSuite, DACTest0060, Function | MediumTest | Level3)
size_t groupsize = getgroups(0, grouplist); size_t groupsize = getgroups(0, grouplist);
if (groupsize >= 0) { if (groupsize >= 0) {
getgroups(groupsize, grouplist); getgroups(groupsize, grouplist);
} else {
EXPECT_GE(groupsize, 0) << "ErrInfo: Failed to get groups";
}
// Preset action: Obtain the group lists required for the testcase // Preset action: Obtain the group lists required for the testcase
gid_t list0[SIZE255]; gid_t list0[SIZE255];
for (size_t num0 = 0; num0 < SIZE254; num0++) { for (size_t num0 = 0; num0 < SIZE254; num0++) {
...@@ -777,6 +774,9 @@ HWTEST_F(DacTestSuite, DACTest0060, Function | MediumTest | Level3) ...@@ -777,6 +774,9 @@ HWTEST_F(DacTestSuite, DACTest0060, Function | MediumTest | Level3)
setgroups(0, nullptr); setgroups(0, nullptr);
ret = setgroups(groupsize, grouplist); ret = setgroups(groupsize, grouplist);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to restore the initial groups of the process"; EXPECT_EQ(ret, 0) << "ErrInfo: Failed to restore the initial groups of the process";
} else {
EXPECT_GE(groupsize, 0) << "ErrInfo: Failed to get groups";
}
} }
/* /*
...@@ -863,9 +863,6 @@ HWTEST_F(DacTestSuite, DACTest0080, Function | MediumTest | Level2) ...@@ -863,9 +863,6 @@ HWTEST_F(DacTestSuite, DACTest0080, Function | MediumTest | Level2)
int groupsize = getgroups(0, grouplist); int groupsize = getgroups(0, grouplist);
if (groupsize >= 0) { if (groupsize >= 0) {
getgroups(groupsize, grouplist); getgroups(groupsize, grouplist);
} else {
EXPECT_GE(groupsize, 0) << "ErrInfo: Failed to get groups";
}
// Preset action: Obtain the group lists required for the testcase // Preset action: Obtain the group lists required for the testcase
gid_t list1[SIZE1] = {GID10000}; gid_t list1[SIZE1] = {GID10000};
gid_t list2[SIZE1] = {}; gid_t list2[SIZE1] = {};
...@@ -900,6 +897,9 @@ HWTEST_F(DacTestSuite, DACTest0080, Function | MediumTest | Level2) ...@@ -900,6 +897,9 @@ HWTEST_F(DacTestSuite, DACTest0080, Function | MediumTest | Level2)
setgroups(0, nullptr); setgroups(0, nullptr);
ret = setgroups(groupsize, grouplist); ret = setgroups(groupsize, grouplist);
EXPECT_EQ(ret, 0) << "ErrInfo: Failed to restore the initial groups of the process"; EXPECT_EQ(ret, 0) << "ErrInfo: Failed to restore the initial groups of the process";
} else {
EXPECT_GE(groupsize, 0) << "ErrInfo: Failed to get groups";
}
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册