diff options
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r-- | source4/torture/rpc/spoolss.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 7ca8db5a10c..94ced04a98b 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -303,7 +303,7 @@ static BOOL test_EnumPorts(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) status = dcerpc_spoolss_EnumPorts(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { - printf("EnumPorts failed -- %s\n", nt_errstr(status)); + printf("EnumPorts failed - %s\n", nt_errstr(status)); return False; } @@ -316,7 +316,7 @@ static BOOL test_EnumPorts(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) status = dcerpc_spoolss_EnumPorts(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { - printf("EnumPorts failed -- %s\n", nt_errstr(status)); + printf("EnumPorts failed - %s\n", nt_errstr(status)); return False; } @@ -329,6 +329,39 @@ static BOOL test_EnumPorts(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) return True; } +static BOOL test_AddPort(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +{ + NTSTATUS status; + struct spoolss_AddPort r; + + r.in.server_name = talloc_asprintf(mem_ctx, "\\\\%s", + dcerpc_server_name(p)); + r.in.unknown = 0; + r.in.monitor_name = "foo"; + + printf ("Testing AddPort\n"); + + status = dcerpc_spoolss_AddPort(p, mem_ctx, &r); + + if (!NT_STATUS_IS_OK(status)) { + printf("AddPort failed - %s\n", nt_errstr(status)); + return False; + } + + /* win2k3 returns WERR_NOT_SUPPORTED */ + +#if 0 + + if (!W_ERROR_IS_OK(r.out.result)) { + printf("AddPort failed - %s\n", win_errstr(r.out.result)); + return False; + } + +#endif + + return True; +} + static BOOL test_GetJob(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t job_id) { @@ -1095,6 +1128,8 @@ BOOL torture_rpc_spoolss(void) ret &= test_OpenPrinter_badnames(p, mem_ctx); + ret &= test_AddPort(p, mem_ctx); + ret &= test_EnumPorts(p, mem_ctx); ret &= test_EnumPrinters(p, mem_ctx); |