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
Change-Id: Ie485bd019b3826e71ad19131effcbb002f888d52
diff --git a/tests/grp_pwd_test.cpp b/tests/grp_pwd_test.cpp
index 9b23921..99117e4 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,