diff options
author | Tom Cherry <tomcherry@google.com> | 2018-07-02 16:02:52 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-07-02 16:02:52 +0000 |
commit | 866374163a1164e1113a4d2e9e0453d68a06dfa3 (patch) | |
tree | 315e54eaf2b10a525767c2af9c6402b92eab3224 | |
parent | 03cb53a17d47e1a4777672e4ea76afa8e23f1d41 (diff) | |
parent | 9893d6d0ff2be5a6cdfb944df17b394678a7e340 (diff) | |
download | bionic-android-cts-9.0_r4.tar.gz |
Merge "Reland "Remove a check for AIDs in the OEM range."" into pi-devandroid-vts-9.0_r4android-cts-9.0_r4android-cts-9.0_r3android-cts-9.0_r2pie-dr1-dev
-rw-r--r-- | tests/grp_pwd_test.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/grp_pwd_test.cpp b/tests/grp_pwd_test.cpp index fa8a662f2..6316387f0 100644 --- a/tests/grp_pwd_test.cpp +++ b/tests/grp_pwd_test.cpp @@ -275,7 +275,14 @@ TEST(pwd, getpwent_iterate) { EXPECT_STREQ("/data", pwd->pw_dir) << "pwd->pw_uid: " << pwd->pw_uid; } - EXPECT_EQ(0U, uids.count(pwd->pw_uid)) << "pwd->pw_uid: " << pwd->pw_uid; + // TODO(b/27999086): fix this check with the OEM range + // If OEMs add their own AIDs to private/android_filesystem_config.h, this check will fail. + // Long term we want to create a better solution for OEMs adding AIDs, but we're not there + // yet, so therefore we do not check for uid's in the OEM range. + if (!(pwd->pw_uid >= 2900 && pwd->pw_uid <= 2999) && + !(pwd->pw_uid >= 5000 && pwd->pw_uid <= 5999)) { + EXPECT_EQ(0U, uids.count(pwd->pw_uid)) << "pwd->pw_uid: " << pwd->pw_uid; + } uids.emplace(pwd->pw_uid); } endpwent(); @@ -518,7 +525,14 @@ TEST(grp, getgrent_iterate) { EXPECT_STREQ(grp->gr_name, grp->gr_mem[0]) << "grp->gr_gid: " << grp->gr_gid; EXPECT_TRUE(grp->gr_mem[1] == NULL) << "grp->gr_gid: " << grp->gr_gid; - EXPECT_EQ(0U, gids.count(grp->gr_gid)) << "grp->gr_gid: " << grp->gr_gid; + // TODO(b/27999086): fix this check with the OEM range + // If OEMs add their own AIDs to private/android_filesystem_config.h, this check will fail. + // Long term we want to create a better solution for OEMs adding AIDs, but we're not there + // yet, so therefore we do not check for gid's in the OEM range. + if (!(grp->gr_gid >= 2900 && grp->gr_gid <= 2999) && + !(grp->gr_gid >= 5000 && grp->gr_gid <= 5999)) { + EXPECT_EQ(0U, gids.count(grp->gr_gid)) << "grp->gr_gid: " << grp->gr_gid; + } gids.emplace(grp->gr_gid); } endgrent(); |