From ce0af45ef11b7661771dfcebb7298d81d1d2b80e Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 27 Nov 2007 09:35:10 +0100 Subject: r26142: Cleanup IDL and add torture test for wkssvc_NetWkstaEnumUsers. Guenther (This used to be commit 638ce91b0fb0c5602d82bc9913f5c820615acf0c) --- source4/torture/rpc/wkssvc.c | 76 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 66 insertions(+), 10 deletions(-) (limited to 'source4/torture/rpc/wkssvc.c') diff --git a/source4/torture/rpc/wkssvc.c b/source4/torture/rpc/wkssvc.c index 87eae78c06..5b777948ea 100644 --- a/source4/torture/rpc/wkssvc.c +++ b/source4/torture/rpc/wkssvc.c @@ -1,19 +1,19 @@ -/* +/* Unix SMB/CIFS implementation. test suite for wkssvc rpc operations Copyright (C) Andrew Tridgell 2003 - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -23,7 +23,7 @@ #include "librpc/gen_ndr/ndr_wkssvc_c.h" #include "torture/rpc/rpc.h" -static bool test_NetWkstaGetInfo(struct torture_context *tctx, +static bool test_NetWkstaGetInfo(struct torture_context *tctx, struct dcerpc_pipe *p) { NTSTATUS status; @@ -39,9 +39,9 @@ static bool test_NetWkstaGetInfo(struct torture_context *tctx, r.in.level = levels[i]; torture_comment(tctx, "testing NetWkstaGetInfo level %u\n", r.in.level); status = dcerpc_wkssvc_NetWkstaGetInfo(p, tctx, &r); - torture_assert_ntstatus_ok(tctx, status, + torture_assert_ntstatus_ok(tctx, status, talloc_asprintf(tctx, "NetWkstaGetInfo level %u failed", r.in.level)); - torture_assert_werr_ok(tctx, r.out.result, + torture_assert_werr_ok(tctx, r.out.result, talloc_asprintf(tctx, "NetWkstaGetInfo level %u failed", r.in.level)); } @@ -71,12 +71,64 @@ static bool test_NetWkstaTransportEnum(struct torture_context *tctx, status = dcerpc_wkssvc_NetWkstaTransportEnum(p, tctx, &r); torture_assert_ntstatus_ok(tctx, status, "NetWkstaTransportEnum failed"); - torture_assert_werr_ok(tctx, r.out.result, talloc_asprintf(tctx, + torture_assert_werr_ok(tctx, r.out.result, talloc_asprintf(tctx, "NetWkstaTransportEnum level %u failed", r.in.level)); return true; } +static bool test_NetWkstaEnumUsers(struct torture_context *tctx, + struct dcerpc_pipe *p) +{ + NTSTATUS status; + struct wkssvc_NetWkstaEnumUsers r; + uint32_t handle = 0; + uint32_t entries_read = 0; + struct wkssvc_NetWkstaEnumUsersInfo info; + struct wkssvc_NetWkstaEnumUsersCtr0 *user0; + struct wkssvc_NetWkstaEnumUsersCtr1 *user1; + uint32_t levels[] = { 0, 1 }; + int i; + + for (i=0; i