Skip to content

Commit b754dc2

Browse files
lukenava-metafacebook-github-bot
authored andcommitted
Fix ProcessInfoTest.cpp when running as root
Summary: CI runs as root, and when they run as root, the real-userId and effective-userId are root. Also we had another hidden bug if root was not really root. This should fix that. Reviewed By: jdelliot Differential Revision: D73051293 fbshipit-source-id: fcdbe61ba71b6b44b4a47bcc4a6a21ddd084d54c
1 parent 0760134 commit b754dc2

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

eden/common/utils/test/ProcessInfoTest.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,12 @@ TEST_F(ProcessInfoTest, readUserInfoForCurrentProcess) {
2525
EXPECT_TRUE(userInfo.has_value());
2626
// Verify that the UID matches the current user's UID
2727
EXPECT_EQ(userInfo->ruid, getuid());
28-
EXPECT_EQ(userInfo->euid, getuid());
2928

3029
// For a normal user process, sudoUser should be nullopt
3130
auto username = getlogin();
3231
if (username != nullptr) {
3332
EXPECT_EQ(userInfo->getRealUsername(), username);
3433
}
35-
if (getuid() == 0) {
36-
EXPECT_NE(userInfo->ruid, userInfo->euid);
37-
} else {
38-
EXPECT_EQ(userInfo->ruid, userInfo->euid);
39-
}
4034
}
4135

4236
TEST_F(ProcessInfoTest, readUserInfoForNonExistentProcess) {

0 commit comments

Comments
 (0)