diff options
author | Stefan Metzmacher <metze@samba.org> | 2005-07-01 09:05:10 +0000 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2005-07-01 09:05:10 +0000 |
commit | 58e67963942fae3053cbf5dc2e0789b6d4f12136 (patch) | |
tree | 62178f9f5fc6e8b574f2ebda46342828a0722a80 /source/torture/rpc | |
parent | 0ab94ec33fd00bb3d4be71f44438d9a297a7555d (diff) | |
download | samba-58e67963942fae3053cbf5dc2e0789b6d4f12136.tar.gz |
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
Diffstat (limited to 'source/torture/rpc')
-rw-r--r-- | source/torture/rpc/spoolss.c | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/source/torture/rpc/spoolss.c b/source/torture/rpc/spoolss.c index f7bb454335d..fcbec4e561f 100644 --- a/source/torture/rpc/spoolss.c +++ b/source/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); |