Date: Sat, 20 Feb 2021 16:35:53 GMT From: Mark Johnston <markj@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: c4573b48c6db - stable/12 - libc/nss tests: Fix getpw and getgr single-pass tests Message-ID: <202102201635.11KGZr6W028808@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c4573b48c6db5963451edb92e98361305b78d6ab commit c4573b48c6db5963451edb92e98361305b78d6ab Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2021-01-21 19:30:19 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2021-02-20 16:35:32 +0000 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 (cherry picked from commit 7abc10098b3d9c23d611294714b3058e8048aec0) --- lib/libc/tests/nss/getgr_test.c | 16 ++++------------ lib/libc/tests/nss/getpw_test.c | 24 ++++-------------------- 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102201635.11KGZr6W028808>