提交 d9ad2c3c 编写于 作者: O openharmony_ci 提交者: Gitee

!301 【轻内核】【master】修改由权限问题导致的用例失败的问题

Merge pull request !301 from limeng/kernel_lite_20210629_01
...@@ -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.
先完成此消息的编辑!
想要评论请 注册