aboutsummaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2021-01-21 19:30:19 +0000
committerMark Johnston <markj@FreeBSD.org>2021-01-21 19:30:19 +0000
commit7abc10098b3d9c23d611294714b3058e8048aec0 (patch)
treee0a877f1afad6b4cc1d8ac41c199057dbc0558f2 /lib/libc
parented14c69d5679b9a6b86722be698b3060d4b74946 (diff)
downloadsrc-7abc10098b3d9c23d611294714b3058e8048aec0.tar.gz
src-7abc10098b3d9c23d611294714b3058e8048aec0.zip
libc/nss tests: Fix getpw and getgr single-pass tests
Some NSS regression tests for getgrent(3) and getpwent(3) were not testing anything because the test incorrectly requested creation of a database snapshot. Sponsored by: The FreeBSD Foundation MFC after: 1 month
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/tests/nss/getgr_test.c16
-rw-r--r--lib/libc/tests/nss/getpw_test.c24
2 files changed, 8 insertions, 32 deletions
diff --git a/lib/libc/tests/nss/getgr_test.c b/lib/libc/tests/nss/getgr_test.c
index ec06d5cf2f6c..568b7daece9c 100644
--- a/lib/libc/tests/nss/getgr_test.c
+++ b/lib/libc/tests/nss/getgr_test.c
@@ -480,14 +480,12 @@ fin:
ATF_TC_WITHOUT_HEAD(getgrent);
ATF_TC_BODY(getgrent, tc)
{
-
- ATF_REQUIRE(run_tests(SNAPSHOT_FILE, TEST_GETGRENT) == 0);
+ ATF_REQUIRE(run_tests(NULL, TEST_GETGRENT) == 0);
}
ATF_TC_WITHOUT_HEAD(getgrent_with_snapshot);
ATF_TC_BODY(getgrent_with_snapshot, tc)
{
-
ATF_REQUIRE(run_tests(SNAPSHOT_FILE, TEST_BUILD_SNAPSHOT) == 0);
ATF_REQUIRE(run_tests(SNAPSHOT_FILE, TEST_GETGRENT) == 0);
}
@@ -495,21 +493,18 @@ ATF_TC_BODY(getgrent_with_snapshot, tc)
ATF_TC_WITHOUT_HEAD(getgrent_with_two_pass);
ATF_TC_BODY(getgrent_with_two_pass, tc)
{
-
- ATF_REQUIRE(run_tests(SNAPSHOT_FILE, TEST_GETGRENT_2PASS) == 0);
+ ATF_REQUIRE(run_tests(NULL, TEST_GETGRENT_2PASS) == 0);
}
ATF_TC_WITHOUT_HEAD(getgrgid);
ATF_TC_BODY(getgrgid, tc)
{
-
- ATF_REQUIRE(run_tests(SNAPSHOT_FILE, TEST_GETGRGID) == 0);
+ ATF_REQUIRE(run_tests(NULL, TEST_GETGRGID) == 0);
}
ATF_TC_WITHOUT_HEAD(getgrgid_with_snapshot);
ATF_TC_BODY(getgrgid_with_snapshot, tc)
{
-
ATF_REQUIRE(run_tests(SNAPSHOT_FILE, TEST_BUILD_SNAPSHOT) == 0);
ATF_REQUIRE(run_tests(SNAPSHOT_FILE, TEST_GETGRGID) == 0);
}
@@ -517,21 +512,18 @@ ATF_TC_BODY(getgrgid_with_snapshot, tc)
ATF_TC_WITHOUT_HEAD(getgrnam);
ATF_TC_BODY(getgrnam, tc)
{
-
- ATF_REQUIRE(run_tests(SNAPSHOT_FILE, TEST_GETGRNAM) == 0);
+ ATF_REQUIRE(run_tests(NULL, TEST_GETGRNAM) == 0);
}
ATF_TC_WITHOUT_HEAD(getgrnam_with_snapshot);
ATF_TC_BODY(getgrnam_with_snapshot, tc)
{
-
ATF_REQUIRE(run_tests(SNAPSHOT_FILE, TEST_BUILD_SNAPSHOT) == 0);
ATF_REQUIRE(run_tests(SNAPSHOT_FILE, TEST_GETGRNAM) == 0);
}
ATF_TP_ADD_TCS(tp)
{
-
ATF_TP_ADD_TC(tp, getgrent);
ATF_TP_ADD_TC(tp, getgrent_with_snapshot);
ATF_TP_ADD_TC(tp, getgrent_with_two_pass);
diff --git a/lib/libc/tests/nss/getpw_test.c b/lib/libc/tests/nss/getpw_test.c
index e7c5304005ec..40b1820b95ed 100644
--- a/lib/libc/tests/nss/getpw_test.c
+++ b/lib/libc/tests/nss/getpw_test.c
@@ -458,24 +458,15 @@ fin:
#define SNAPSHOT_FILE "snapshot_pwd"
-ATF_TC_WITHOUT_HEAD(build_snapshot);
-ATF_TC_BODY(build_snapshot, tc)
-{
-
- ATF_REQUIRE(run_tests(SNAPSHOT_FILE, TEST_BUILD_SNAPSHOT) == 0);
-}
-
ATF_TC_WITHOUT_HEAD(getpwent);
ATF_TC_BODY(getpwent, tc)
{
-
- ATF_REQUIRE(run_tests(SNAPSHOT_FILE, TEST_GETPWENT) == 0);
+ ATF_REQUIRE(run_tests(NULL, TEST_GETPWENT) == 0);
}
ATF_TC_WITHOUT_HEAD(getpwent_with_snapshot);
ATF_TC_BODY(getpwent_with_snapshot, tc)
{
-
ATF_REQUIRE(run_tests(SNAPSHOT_FILE, TEST_BUILD_SNAPSHOT) == 0);
ATF_REQUIRE(run_tests(SNAPSHOT_FILE, TEST_GETPWENT) == 0);
}
@@ -483,21 +474,18 @@ ATF_TC_BODY(getpwent_with_snapshot, tc)
ATF_TC_WITHOUT_HEAD(getpwent_with_two_pass);
ATF_TC_BODY(getpwent_with_two_pass, tc)
{
-
- ATF_REQUIRE(run_tests(SNAPSHOT_FILE, TEST_GETPWENT_2PASS) == 0);
+ ATF_REQUIRE(run_tests(NULL, TEST_GETPWENT_2PASS) == 0);
}
ATF_TC_WITHOUT_HEAD(getpwnam);
ATF_TC_BODY(getpwnam, tc)
{
-
- ATF_REQUIRE(run_tests(SNAPSHOT_FILE, TEST_GETPWNAM) == 0);
+ ATF_REQUIRE(run_tests(NULL, TEST_GETPWNAM) == 0);
}
ATF_TC_WITHOUT_HEAD(getpwnam_with_snapshot);
ATF_TC_BODY(getpwnam_with_snapshot, tc)
{
-
ATF_REQUIRE(run_tests(SNAPSHOT_FILE, TEST_BUILD_SNAPSHOT) == 0);
ATF_REQUIRE(run_tests(SNAPSHOT_FILE, TEST_GETPWNAM) == 0);
}
@@ -505,22 +493,18 @@ ATF_TC_BODY(getpwnam_with_snapshot, tc)
ATF_TC_WITHOUT_HEAD(getpwuid);
ATF_TC_BODY(getpwuid, tc)
{
-
- ATF_REQUIRE(run_tests(SNAPSHOT_FILE, TEST_GETPWUID) == 0);
+ ATF_REQUIRE(run_tests(NULL, TEST_GETPWUID) == 0);
}
ATF_TC_WITHOUT_HEAD(getpwuid_with_snapshot);
ATF_TC_BODY(getpwuid_with_snapshot, tc)
{
-
ATF_REQUIRE(run_tests(SNAPSHOT_FILE, TEST_BUILD_SNAPSHOT) == 0);
ATF_REQUIRE(run_tests(SNAPSHOT_FILE, TEST_GETPWUID) == 0);
}
ATF_TP_ADD_TCS(tp)
{
-
- ATF_TP_ADD_TC(tp, build_snapshot);
ATF_TP_ADD_TC(tp, getpwent);
ATF_TP_ADD_TC(tp, getpwent_with_snapshot);
ATF_TP_ADD_TC(tp, getpwent_with_two_pass);