提交 1ee821fb 编写于 作者: L limeng151

修改由权限导致用例执行失败的问题

Signed-off-by: Nlimeng151 <limeng151@huawei.com>
Change-Id: I303461dc760f4d16ee9b76aa3eb193b998a23924
上级 e9231c4a
...@@ -642,7 +642,6 @@ HWTEST_F(UidGidTest, testGetgroups, Function | MediumTest | Level1) ...@@ -642,7 +642,6 @@ HWTEST_F(UidGidTest, testGetgroups, Function | MediumTest | Level1)
int n = getgroups(0, gidList); int n = getgroups(0, gidList);
ASSERT_EQ(n, 1); ASSERT_EQ(n, 1);
ASSERT_EQ(gidList[0], 0); ASSERT_EQ(gidList[0], 0);
n = getgroups(testSize, gidList); n = getgroups(testSize, gidList);
ASSERT_EQ(n, 1); ASSERT_EQ(n, 1);
ASSERT_EQ(gidList[0], SHELL_GID); ASSERT_EQ(gidList[0], SHELL_GID);
...@@ -691,8 +690,6 @@ HWTEST_F(UidGidTest, testSetgroups1, Function | MediumTest | Level1) ...@@ -691,8 +690,6 @@ HWTEST_F(UidGidTest, testSetgroups1, Function | MediumTest | Level1)
n = getgroups(2, gidListOut); n = getgroups(2, gidListOut);
EXPECT_EQ(n, 1); EXPECT_EQ(n, 1);
EXPECT_EQ(gidListOut[0], SHELL_GID); EXPECT_EQ(gidListOut[0], SHELL_GID);
gidListOut[0] = 2;
int ret = setgroups(2, gidListOut);
free(gidListIn); free(gidListIn);
free(gidListOut); free(gidListOut);
} }
...@@ -708,8 +705,8 @@ HWTEST_F(UidGidTest, testSetgroups2, Function | MediumTest | Level1) ...@@ -708,8 +705,8 @@ HWTEST_F(UidGidTest, testSetgroups2, Function | MediumTest | Level1)
gid_t gidListOut[4] = {0}; gid_t gidListOut[4] = {0};
LOG("Init: make sure groups not changed by other test."); LOG("Init: make sure groups not changed by other test.");
int n = getgroups(2, gidListOut); int n = getgroups(1, gidListOut);
EXPECT_EQ(n, 2); EXPECT_EQ(n, 1);
EXPECT_EQ(gidListOut[0], SHELL_GID); EXPECT_EQ(gidListOut[0], SHELL_GID);
LOG("add 2 groups"); LOG("add 2 groups");
......
...@@ -61,6 +61,7 @@ protected: ...@@ -61,6 +61,7 @@ protected:
setgid(SHELL_GID); setgid(SHELL_GID);
AssertAllUid(SHELL_UID); AssertAllUid(SHELL_UID);
AssertAllGid(SHELL_GID); AssertAllGid(SHELL_GID);
int rt = setgroups(0, NULL);
} }
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册