From 7769f9db3408d5b98560045b07529a8359ca6911 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 27 Nov 2007 09:41:50 +0100 Subject: r26143: Add IDL and torture test for wkssvc_NetrWkstaUserGetInfo. Guenther (This used to be commit b358f953e9ba03bc89a241ab5232c823d836057f) --- source4/torture/rpc/wkssvc.c | 51 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'source4/torture') diff --git a/source4/torture/rpc/wkssvc.c b/source4/torture/rpc/wkssvc.c index 5b777948ea..9592870cdf 100644 --- a/source4/torture/rpc/wkssvc.c +++ b/source4/torture/rpc/wkssvc.c @@ -22,6 +22,8 @@ #include "torture/torture.h" #include "librpc/gen_ndr/ndr_wkssvc_c.h" #include "torture/rpc/rpc.h" +#include "lib/cmdline/popt_common.h" +#include "param/param.h" static bool test_NetWkstaGetInfo(struct torture_context *tctx, struct dcerpc_pipe *p) @@ -129,6 +131,53 @@ static bool test_NetWkstaEnumUsers(struct torture_context *tctx, return true; } + +static bool test_NetrWkstaUserGetInfo(struct torture_context *tctx, + struct dcerpc_pipe *p) +{ + NTSTATUS status; + struct wkssvc_NetrWkstaUserGetInfo r; + union wkssvc_NetrWkstaUserInfo info; + const char *dom = lp_workgroup(global_loadparm); + struct cli_credentials *creds = cmdline_credentials; + const char *user = cli_credentials_get_username(creds); + int i; + + const struct { + const char *unknown; + uint32_t level; + WERROR result; + } tests[] = { + { NULL, 0, WERR_NO_SUCH_LOGON_SESSION }, + { NULL, 1, WERR_NO_SUCH_LOGON_SESSION }, + { NULL, 1101, WERR_OK }, + { dom, 0, WERR_INVALID_PARAM }, + { dom, 1, WERR_INVALID_PARAM }, + { dom, 1101, WERR_INVALID_PARAM }, + { user, 0, WERR_INVALID_PARAM }, + { user, 1, WERR_INVALID_PARAM }, + { user, 1101, WERR_INVALID_PARAM }, + }; + + for (i=0; i