From 238862649cfa2f667915ef6475be54fb1ebff82d Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 27 Nov 2007 10:42:50 +0100 Subject: r26152: Add IDL and torture test for wkssvc_NetrEnumerateComputerNames(). Guenther (This used to be commit ea478168676e00a602f8181b408c4886b35d2fd3) --- source4/torture/rpc/wkssvc.c | 55 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'source4/torture/rpc') diff --git a/source4/torture/rpc/wkssvc.c b/source4/torture/rpc/wkssvc.c index d862e00d1d..7486e8cde5 100644 --- a/source4/torture/rpc/wkssvc.c +++ b/source4/torture/rpc/wkssvc.c @@ -504,6 +504,59 @@ static bool test_NetrLogonDomainNameDel(struct torture_context *tctx, return true; } +static bool test_NetrEnumerateComputerNames_level(struct torture_context *tctx, + struct dcerpc_pipe *p, + uint16_t level) +{ + NTSTATUS status; + struct wkssvc_NetrEnumerateComputerNames r; + struct wkssvc_ComputerNamesCtr *ctr; + + ctr = talloc_zero(tctx, struct wkssvc_ComputerNamesCtr); + + r.in.server_name = dcerpc_server_name(p); + r.in.name_type = level; + r.in.Reserved = 0; + r.out.ctr = &ctr; + + torture_comment(tctx, "testing NetrEnumerateComputerNames level %u\n", + r.in.name_type); + + status = dcerpc_wkssvc_NetrEnumerateComputerNames(p, tctx, &r); + torture_assert_ntstatus_ok(tctx, status, + "NetrEnumerateComputerNames failed"); + torture_assert_werr_ok(tctx, r.out.result, + "NetrEnumerateComputerNames failed"); + + if ((level == NetPrimaryComputerName) && ctr->count != 1) { + torture_comment(tctx, + "NetrEnumerateComputerNames did not return one " + "name but %u\n", ctr->count); + return false; + } + + return true; +} + +static bool test_NetrEnumerateComputerNames(struct torture_context *tctx, + struct dcerpc_pipe *p) +{ + uint16_t levels[] = {0,1,2}; + int i; + + for (i=0; i