提交 e9231c4a 编写于 作者: L limeng151

修改因为权限问题导致的getgroups用例出错

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