diff options
author | Tom Cherry <tomcherry@google.com> | 2020-07-10 10:40:21 -0700 |
---|---|---|
committer | Tom Cherry <tomcherry@google.com> | 2020-07-10 10:42:16 -0700 |
commit | b9fa04d805912d58d920ccd1a7af77daf81293e7 (patch) | |
tree | b477bb49353e0881addd5941ac3e13ab48deb6d5 | |
parent | b5f301eaafdc23f05fe5558fb0406a0ab04fc807 (diff) |
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
-rw-r--r-- | tests/grp_pwd_test.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/grp_pwd_test.cpp b/tests/grp_pwd_test.cpp index 9b239215a..99117e45b 100644 --- a/tests/grp_pwd_test.cpp +++ b/tests/grp_pwd_test.cpp @@ -75,7 +75,11 @@ static void check_passwd(const passwd* pwd, const char* username, uid_t uid, uid 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, |