Disable {getpwent,getgrent}_iterate tests on glibc.
These tests aren't meaningful on the host, and take forever to fail.
Test: bionic-unit-tests-glibc --gtest_filter="*get??ent_iterate"
Change-Id: I8ca20829ba94f2ea815c636f779bacc55449cffd
diff --git a/tests/grp_pwd_test.cpp b/tests/grp_pwd_test.cpp
index a905fae..12d4b7f 100644
--- a/tests/grp_pwd_test.cpp
+++ b/tests/grp_pwd_test.cpp
@@ -115,10 +115,14 @@
#else // !defined(__BIONIC__)
-static void check_get_passwd(const char* /* username */, uid_t /* uid */, uid_type_t /* uid_type */) {
+static void print_no_getpwnam_test_info() {
GTEST_LOG_(INFO) << "This test is about uid/username translation for Android, which does nothing on libc other than bionic.\n";
}
+static void check_get_passwd(const char* /* username */, uid_t /* uid */, uid_type_t /* uid_type */) {
+ print_no_getpwnam_test_info();
+}
+
#endif
TEST(pwd, getpwnam_system_id_root) {
@@ -238,6 +242,7 @@
}
TEST(pwd, getpwent_iterate) {
+#if defined(__BIONIC__)
passwd* pwd;
std::set<uid_t> uids;
@@ -263,6 +268,9 @@
endpwent();
expect_ids(uids);
+#else
+ print_no_getpwnam_test_info();
+#endif
}
static void check_group(const group* grp, const char* group_name, gid_t gid) {
@@ -477,6 +485,7 @@
}
TEST(grp, getgrent_iterate) {
+#if defined(__BIONIC__)
group* grp;
std::set<gid_t> gids;
@@ -493,4 +502,7 @@
endgrent();
expect_ids(gids);
+#else
+ print_no_getgrnam_test_info();
+#endif
}