aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2024-02-21 23:00:31 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2024-02-21 23:00:31 +0000
commitf31c52d54cc43096bc7dc90d291a1e6c4a6638d9 (patch)
tree2a207585e4518031d9a7cc99dc9d0f342fb3ee35
parentc46ec1990d161a93cbd2300efdb04811f51e1d64 (diff)
parent40f12b4aa685de19c07f58d35c31a2ccb3f5cfa9 (diff)
downloadbionic-f31c52d54cc43096bc7dc90d291a1e6c4a6638d9.tar.gz
Merge "grp_pwd_test: Hack around "trunk stable"." into android14-tests-dev am: 40f12b4aa6
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2957235 Change-Id: I22b5c2a3da1182aa249bda93044caf00ffca9657 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--tests/grp_pwd_test.cpp33
1 files changed, 25 insertions, 8 deletions
diff --git a/tests/grp_pwd_test.cpp b/tests/grp_pwd_test.cpp
index 16b8d5ac5..ddc0fc15c 100644
--- a/tests/grp_pwd_test.cpp
+++ b/tests/grp_pwd_test.cpp
@@ -444,16 +444,33 @@ static void expect_ids(T ids, bool is_group) {
return result;
};
- // AID_PRNG_SEEDER (1092) was added in TM-QPR2, but CTS is shared
- // across Android 13 versions so we may or may not find it in this
- // test (b/253185870).
- if (android::base::GetIntProperty("ro.build.version.sdk", 0) == __ANDROID_API_T__) {
-#ifndef AID_PRNG_SEEDER
-#define AID_PRNG_SEEDER 1092
+ // AID_UPROBESTATS (1093) was added in V, but "trunk stable" means
+ // that the 2024Q builds don't have branches like the QPR builds used
+ // to, and are tested with the _previous_ release's CTS.
+ if (android::base::GetIntProperty("ro.build.version.sdk", 0) == __ANDROID_API_U__) {
+#if !defined(AID_UPROBESTATS)
+#define AID_UPROBESTATS 1093
#endif
- ids.erase(AID_PRNG_SEEDER);
- expected_ids.erase(AID_PRNG_SEEDER);
+ ids.erase(AID_UPROBESTATS);
+ expected_ids.erase(AID_UPROBESTATS);
+ if (getpwuid(AID_UPROBESTATS)) {
+ EXPECT_STREQ(getpwuid(AID_UPROBESTATS)->pw_name, "uprobestats");
+ }
}
+ // AID_VIRTUALMACHINE (3013) was added in V, but "trunk stable" means
+ // that the 2024Q builds don't have branches like the QPR builds used
+ // to, and are tested with the _previous_ release's CTS.
+ if (android::base::GetIntProperty("ro.build.version.sdk", 0) == __ANDROID_API_U__) {
+#if !defined(AID_VIRTUALMACHINE)
+#define AID_VIRTUALMACHINE 3013
+#endif
+ ids.erase(AID_VIRTUALMACHINE);
+ expected_ids.erase(AID_VIRTUALMACHINE);
+ if (getpwuid(AID_VIRTUALMACHINE)) {
+ EXPECT_STREQ(getpwuid(AID_VIRTUALMACHINE)->pw_name, "virtualmachine");
+ }
+ }
+
EXPECT_EQ(expected_ids, ids) << return_differences();
}
#endif