diff options
author | Michael Adam <obnox@samba.org> | 2007-10-01 15:49:56 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:07:34 -0500 |
commit | 4d7273715f109db82a4ee4852855927a32bb4073 (patch) | |
tree | 0f9b904a5caeedd02e17e2d1c80c7f7d73c283cc /source4/torture/winbind | |
parent | 3f466b1aab78876852563e258bc690c7228950e2 (diff) | |
download | samba-4d7273715f109db82a4ee4852855927a32bb4073.tar.gz samba-4d7273715f109db82a4ee4852855927a32bb4073.tar.bz2 samba-4d7273715f109db82a4ee4852855927a32bb4073.zip |
r25444: Add an initial version of a WINBIND-STRUCT-GETPWENT test.
To be extended...
Michael
(This used to be commit 315ffc01914c34d0c4dacd9155d270af0f45f8e5)
Diffstat (limited to 'source4/torture/winbind')
-rw-r--r-- | source4/torture/winbind/struct_based.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/source4/torture/winbind/struct_based.c b/source4/torture/winbind/struct_based.c index 0b9391bcd8..a375158060 100644 --- a/source4/torture/winbind/struct_based.c +++ b/source4/torture/winbind/struct_based.c @@ -697,6 +697,33 @@ static bool torture_winbind_struct_setpwent(struct torture_context *torture) return true; } +static bool torture_winbind_struct_getpwent(struct torture_context *torture) +{ + struct winbindd_request req; + struct winbindd_response rep; + struct winbindd_pw *pwent; + + torture_comment(torture, "Running WINBINDD_GETPWENT (struct based)\n"); + + torture_comment(torture, " - Running WINBINDD_SETPWENT first\n"); + ZERO_STRUCT(req); + ZERO_STRUCT(rep); + DO_STRUCT_REQ_REP(WINBINDD_SETPWENT, &req, &rep); + + torture_comment(torture, " - Running WINBINDD_GETPWENT now\n"); + ZERO_STRUCT(req); + ZERO_STRUCT(rep); + req.data.num_entries = 1; + DO_STRUCT_REQ_REP(WINBINDD_GETPWENT, &req, &rep); + pwent = (struct winbindd_pw *)rep.extra_data.data; + torture_assert(torture, (pwent != NULL), "NULL pwent"); + torture_comment(torture, "name: %s, uid: %d, gid: %d, shell: %s\n", + pwent->pw_name, pwent->pw_uid, pwent->pw_gid, + pwent->pw_shell); + + return true; +} + static bool torture_winbind_struct_endpwent(struct torture_context *torture) { struct winbindd_request req; @@ -731,6 +758,7 @@ struct torture_suite *torture_winbind_struct_init(void) torture_suite_add_simple_test(suite, "LIST_GROUPS", torture_winbind_struct_list_groups); torture_suite_add_simple_test(suite, "SHOW_SEQUENCE", torture_winbind_struct_show_sequence); torture_suite_add_simple_test(suite, "SETPWENT", torture_winbind_struct_setpwent); + torture_suite_add_simple_test(suite, "GETPWENT", torture_winbind_struct_getpwent); torture_suite_add_simple_test(suite, "ENDPWENT", torture_winbind_struct_endpwent); suite->description = talloc_strdup(suite, "WINBIND - struct based protocol tests"); |