Don't test pw_shell for old vendor images R GSI on P product tests fail since pw_shell has changed. This value has no practical use on Android, so we ignore testing it for older vendor images. Bug: 160937247 Test: this test does/doesn't run appropriately Merged-In: Ie485bd019b3826e71ad19131effcbb002f888d52 Change-Id: Ie485bd019b3826e71ad19131effcbb002f888d52 (cherry picked from commit b9fa04d805912d58d920ccd1a7af77daf81293e7)
diff --git a/tests/grp_pwd_test.cpp b/tests/grp_pwd_test.cpp index 9c6b0c5..cab7175 100644 --- a/tests/grp_pwd_test.cpp +++ b/tests/grp_pwd_test.cpp
@@ -75,7 +75,11 @@ EXPECT_STREQ("/", pwd->pw_dir); } - EXPECT_STREQ("/bin/sh", pwd->pw_shell); + // This has changed over time and that causes new GSI + old vendor images testing to fail. + // This parameter doesn't matter on Android, so simply ignore its value for older vendor images. + if (android::base::GetIntProperty("ro.product.first_api_level", 0) >= 30) { + EXPECT_STREQ("/bin/sh", pwd->pw_shell); + } } static void check_getpwuid(const char* username, uid_t uid, uid_type_t uid_type,