summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-07-16 09:36:17 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:57:40 -0500
commitfda5ab2f21f5d57c398eb89ba609ed43bce59bd1 (patch)
treeac52477bf00cccdbbe0f135c30b4506477ef7efe /source4
parent4dbc8abcc0f058b6aabc9739574a3cc92e2eb9f7 (diff)
downloadsamba-fda5ab2f21f5d57c398eb89ba609ed43bce59bd1.tar.gz
samba-fda5ab2f21f5d57c398eb89ba609ed43bce59bd1.tar.bz2
samba-fda5ab2f21f5d57c398eb89ba609ed43bce59bd1.zip
r1529: add NetSrvGetInfo torture test
metze (This used to be commit 0018aeb2fe8c42e49fdcdd1ecc646b277625967d)
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rpc/srvsvc.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/source4/torture/rpc/srvsvc.c b/source4/torture/rpc/srvsvc.c
index 460ac8c0cf..47002d3550 100644
--- a/source4/torture/rpc/srvsvc.c
+++ b/source4/torture/rpc/srvsvc.c
@@ -541,6 +541,44 @@ static BOOL test_NetShareEnum(struct dcerpc_pipe *p,
}
/**************************/
+/* srvsvc_NetSrv */
+/**************************/
+static BOOL test_NetSrvGetInfo(struct dcerpc_pipe *p,
+ TALLOC_CTX *mem_ctx)
+{
+ NTSTATUS status;
+ struct srvsvc_NetSrvGetInfo r;
+ struct srvsvc_NetSrvInfo503 i503;
+ uint32_t levels[] = {100, 101, 102, 502, 503};
+ int i;
+ BOOL ret = True;
+ uint32_t resume_handle;
+
+ ZERO_STRUCT(i503);
+
+ r.in.server_unc = talloc_asprintf(mem_ctx,"\\\\%s",dcerpc_server_name(p));
+
+ for (i=0;i<ARRAY_SIZE(levels);i++) {
+ ZERO_STRUCT(r.out);
+ resume_handle = 0;
+ r.in.level = levels[i];
+ printf("testing NetSrvGetInfo level %u\n", r.in.level);
+ status = dcerpc_srvsvc_NetSrvGetInfo(p, mem_ctx, &r);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("NetSrvGetInfo level %u failed - %s\n", r.in.level, nt_errstr(status));
+ ret = False;
+ continue;
+ }
+ if (!W_ERROR_IS_OK(r.out.result)) {
+ printf("NetSrvGetInfo level %u failed - %s\n", r.in.level, win_errstr(r.out.result));
+ continue;
+ }
+ }
+
+ return ret;
+}
+
+/**************************/
/* srvsvc_NetDisk */
/**************************/
static BOOL test_NetDiskEnum(struct dcerpc_pipe *p,
@@ -658,6 +696,10 @@ BOOL torture_rpc_srvsvc(int dummy)
ret = False;
}
+ if (!test_NetSrvGetInfo(p, mem_ctx)) {
+ ret = False;
+ }
+
if (!test_NetDiskEnum(p, mem_ctx)) {
ret = False;
}