summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-07-01 09:05:10 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:02 -0500
commitfe94ba6e71eb8d3273d593763f6b6d03fa90113d (patch)
treecc1076eb2a6edfbe80dda981d627835ffc8bc1f1 /source4/torture/rpc
parentcee17efc7c3897182765d457cce98043f7a7b94f (diff)
downloadsamba-fe94ba6e71eb8d3273d593763f6b6d03fa90113d.tar.gz
samba-fe94ba6e71eb8d3273d593763f6b6d03fa90113d.tar.bz2
samba-fe94ba6e71eb8d3273d593763f6b6d03fa90113d.zip
r8046: - add somemore failure checks in the RPC-SPOOLSS test
- test AddForm on the PrintServer object - GetForm() isn't allowed on the PrintServer object so remove NTPTR function for it - accept the dns name as servername in the spoolss server metze (This used to be commit d8c308a4653d59514915021607fe55c5f2b38749)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/spoolss.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index f7bb454335..fcbec4e561 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -838,6 +838,17 @@ static BOOL test_GetForm(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
r.in.buffer = &blob;
r.in.offered = r.out.needed;
status = dcerpc_spoolss_GetForm(p, mem_ctx, &r);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("GetForm failed - %s\n",
+ nt_errstr(status));
+ return False;
+ }
+
+ if (!W_ERROR_IS_OK(r.out.result)) {
+ printf("GetForm failed - %s\n",
+ win_errstr(r.out.result));
+ return False;
+ }
if (!r.out.info) {
printf("No form info returned\n");
@@ -845,6 +856,13 @@ static BOOL test_GetForm(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
}
}
+
+ if (!W_ERROR_IS_OK(r.out.result)) {
+ printf("GetForm failed - %s\n",
+ win_errstr(r.out.result));
+ return False;
+ }
+
return True;
}
@@ -853,6 +871,7 @@ static BOOL test_EnumForms(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
{
NTSTATUS status;
struct spoolss_EnumForms r;
+ BOOL ret = True;
r.in.handle = handle;
r.in.level = 1;
@@ -890,7 +909,7 @@ static BOOL test_EnumForms(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
info = r.out.info;
for (j = 0; j < r.out.count; j++) {
- test_GetForm(p, mem_ctx, handle, info[j].info1.form_name);
+ if (!print_server) ret &= test_GetForm(p, mem_ctx, handle, info[j].info1.form_name);
}
}
@@ -933,7 +952,7 @@ static BOOL test_DeleteForm(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
}
static BOOL test_AddForm(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
- struct policy_handle *handle)
+ struct policy_handle *handle, BOOL print_server)
{
struct spoolss_AddForm r;
struct spoolss_AddFormInfo1 addform;
@@ -961,10 +980,12 @@ static BOOL test_AddForm(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
}
if (!W_ERROR_IS_OK(r.out.result)) {
- printf("AddForm failed - %s\n", nt_errstr(status));
+ printf("AddForm failed - %s\n", win_errstr(r.out.result));
goto done;
}
+ if (!print_server) ret &= test_GetForm(p, mem_ctx, handle, form_name);
+
{
struct spoolss_SetForm sf;
struct spoolss_AddFormInfo1 setform;
@@ -996,6 +1017,8 @@ static BOOL test_AddForm(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
}
}
+ if (!print_server) ret &= test_GetForm(p, mem_ctx, handle, form_name);
+
done:
if (!test_DeleteForm(p, mem_ctx, handle, form_name)) {
printf("DeleteForm failed\n");
@@ -1821,7 +1844,7 @@ static BOOL test_OpenPrinterEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
ret = False;
}
- if (!test_AddForm(p, mem_ctx, &handle)) {
+ if (!test_AddForm(p, mem_ctx, &handle, False)) {
ret = False;
}
@@ -2074,6 +2097,8 @@ BOOL torture_rpc_spoolss(void)
ret &= test_EnumForms(ctx->p, ctx, &ctx->server_handle, True);
+ ret &= test_AddForm(ctx->p, ctx, &ctx->server_handle, True);
+
ret &= test_EnumPorts(ctx);
ret &= test_GetPrinterDriverDirectory(ctx);