nss_wrapper: add more coherency checks for user and group enumeration.
authorGünther Deschner <gd@samba.org>
Thu, 4 Jun 2009 21:49:02 +0000 (23:49 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 5 Jun 2009 11:40:49 +0000 (13:40 +0200)
Guenther

lib/nss_wrapper/testsuite.c

index e3ba5bf7b3f878ce2e979ee0553be82b2677faf1..c1b6e9ebbf77213690495838dca17172a655f31e 100644 (file)
@@ -235,8 +235,12 @@ static bool test_nwrap_passwd(struct torture_context *tctx)
        for (i=0; i < num_pwd; i++) {
                torture_assert(tctx, test_nwrap_getpwnam(tctx, pwd[i].pw_name, &pwd1),
                        "failed to call getpwnam for enumerated user");
+               torture_assert_passwd_equal(tctx, &pwd[i], &pwd1,
+                       "getpwent and getpwnam gave different results");
                torture_assert(tctx, test_nwrap_getpwuid(tctx, pwd[i].pw_uid, &pwd2),
                        "failed to call getpwuid for enumerated user");
+               torture_assert_passwd_equal(tctx, &pwd[i], &pwd2,
+                       "getpwent and getpwuid gave different results");
                torture_assert_passwd_equal(tctx, &pwd1, &pwd2,
                        "getpwnam and getpwuid gave different results");
        }
@@ -317,8 +321,12 @@ static bool test_nwrap_group(struct torture_context *tctx)
        for (i=0; i < num_grp; i++) {
                torture_assert(tctx, test_nwrap_getgrnam(tctx, grp[i].gr_name, &grp1),
                        "failed to call getgrnam for enumerated user");
+               torture_assert_group_equal(tctx, &grp[i], &grp1,
+                       "getgrent and getgrnam gave different results");
                torture_assert(tctx, test_nwrap_getgrgid(tctx, grp[i].gr_gid, &grp2),
                        "failed to call getgrgid for enumerated user");
+               torture_assert_group_equal(tctx, &grp[i], &grp2,
+                       "getgrent and getgruid gave different results");
                torture_assert_group_equal(tctx, &grp1, &grp2,
                        "getgrnam and getgrgid gave different results");
        }