summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2005-02-25 06:16:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:10:54 -0500
commit04d3e8046a6276ddf968728998c9a57054faff22 (patch)
tree908acabf038618398288eae47c220210690d789e /source4/torture
parent84d632ab5edfef0b7e7ca3ae6db983744f4e3fdf (diff)
downloadsamba-04d3e8046a6276ddf968728998c9a57054faff22.tar.gz
samba-04d3e8046a6276ddf968728998c9a57054faff22.tar.bz2
samba-04d3e8046a6276ddf968728998c9a57054faff22.zip
r5553: Add idl and test for spoolss_AddPort(). It always seems to return
WERR_NOT_SUPPORTED though. (This used to be commit ba4730a37838f45db1b77b777af8efdb45a06006)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/spoolss.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index 7ca8db5a10..94ced04a98 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);