summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2007-11-20 09:33:14 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:45:47 +0100
commit9532bced6c4da4063969bd55988674c26eb22e6a (patch)
treee40ae27a1ced5736c3d289f010374ecbeced5e92 /source4/torture/rpc
parente35e41a8f912007a13c40543e4ab1da371b56d1e (diff)
downloadsamba-9532bced6c4da4063969bd55988674c26eb22e6a.tar.gz
samba-9532bced6c4da4063969bd55988674c26eb22e6a.tar.bz2
samba-9532bced6c4da4063969bd55988674c26eb22e6a.zip
r26048: spoolss: Fix test_SecondaryClosePrinter.
The test was trying to be too smart. Fixed to not reuse test_ClosePrinter. (This used to be commit 5f688d1fddd1faac523e491ba3de2b453c8b44ca)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/spoolss.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index 2d343ea1ed..23b4aad30b 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -1297,7 +1297,7 @@ static bool test_SecondaryClosePrinter(struct torture_context *tctx,
NTSTATUS status;
struct dcerpc_binding *b;
struct dcerpc_pipe *p2;
- bool ret = true;
+ struct spoolss_ClosePrinter cp;
/* only makes sense on SMB */
if (p->conn->transport.transport != NCACN_NP) {
@@ -1315,10 +1315,12 @@ static bool test_SecondaryClosePrinter(struct torture_context *tctx,
status = dcerpc_bind_auth_none(p2, &ndr_table_spoolss);
torture_assert_ntstatus_ok(tctx, status, "Failed to create bind on secondary connection");
- if (test_ClosePrinter(tctx, p2, handle)) {
- torture_comment(tctx, "ERROR: Allowed close on secondary connection!\n");
- ret = false;
- }
+ cp.in.handle = handle;
+ cp.out.handle = handle;
+
+ status = dcerpc_spoolss_ClosePrinter(p2, tctx, &cp);
+ torture_assert_ntstatus_equal(tctx, status, NT_STATUS_NET_WRITE_FAULT,
+ "ERROR: Allowed close on secondary connection");
torture_assert_int_equal(tctx, p2->last_fault_code, DCERPC_FAULT_CONTEXT_MISMATCH,
"Unexpected fault code");