From 0f76e2d0bd8120d27ec6b782da6fb63407012fa2 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 13 Apr 2009 17:05:12 +0200 Subject: s4-smbtorture: move test_ReplyOpenPrinter from RPC-SPOOLSS to RPC-SPOOLSS-NOTIFY. Guenther --- source4/torture/rpc/spoolss.c | 36 ------------------------------------ source4/torture/rpc/spoolss_notify.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 36 deletions(-) (limited to 'source4') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index f2a503b6fd..6c78cf3cc2 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -1941,41 +1941,6 @@ static bool test_EnumPrinterDrivers_old(struct torture_context *tctx, return true; } -/** Test that makes sure that calling ReplyOpenPrinter() - * on Samba 4 will cause an irpc broadcast call. - */ -static bool test_ReplyOpenPrinter(struct torture_context *tctx, - struct dcerpc_pipe *pipe) -{ - struct spoolss_ReplyOpenPrinter r; - struct spoolss_ReplyClosePrinter s; - struct policy_handle h; - - r.in.server_name = "earth"; - r.in.printer_local = 2; - r.in.type = REG_DWORD; - r.in.bufsize = 0; - r.in.buffer = NULL; - r.out.handle = &h; - - torture_assert_ntstatus_ok(tctx, - dcerpc_spoolss_ReplyOpenPrinter(pipe, tctx, &r), - "spoolss_ReplyOpenPrinter call failed"); - - torture_assert_werr_ok(tctx, r.out.result, "error return code"); - - s.in.handle = &h; - s.out.handle = &h; - - torture_assert_ntstatus_ok(tctx, - dcerpc_spoolss_ReplyClosePrinter(pipe, tctx, &s), - "spoolss_ReplyClosePrinter call failed"); - - torture_assert_werr_ok(tctx, r.out.result, "error return code"); - - return true; -} - bool torture_rpc_spoolss(struct torture_context *torture) { NTSTATUS status; @@ -2029,7 +1994,6 @@ bool torture_rpc_spoolss(struct torture_context *torture) ret &= test_EnumPorts_old(torture, p); ret &= test_EnumPrinters_old(torture, p); ret &= test_EnumPrinterDrivers_old(torture, p); - ret &= test_ReplyOpenPrinter(torture, p); return ret; } diff --git a/source4/torture/rpc/spoolss_notify.c b/source4/torture/rpc/spoolss_notify.c index b7f2d3c410..a8a0ca5df6 100644 --- a/source4/torture/rpc/spoolss_notify.c +++ b/source4/torture/rpc/spoolss_notify.c @@ -289,6 +289,41 @@ static bool test_RFFPCNEx(struct torture_context *tctx, return true; } +/** Test that makes sure that calling ReplyOpenPrinter() + * on Samba 4 will cause an irpc broadcast call. + */ +static bool test_ReplyOpenPrinter(struct torture_context *tctx, + struct dcerpc_pipe *pipe) +{ + struct spoolss_ReplyOpenPrinter r; + struct spoolss_ReplyClosePrinter s; + struct policy_handle h; + + r.in.server_name = "earth"; + r.in.printer_local = 2; + r.in.type = REG_DWORD; + r.in.bufsize = 0; + r.in.buffer = NULL; + r.out.handle = &h; + + torture_assert_ntstatus_ok(tctx, + dcerpc_spoolss_ReplyOpenPrinter(pipe, tctx, &r), + "spoolss_ReplyOpenPrinter call failed"); + + torture_assert_werr_ok(tctx, r.out.result, "error return code"); + + s.in.handle = &h; + s.out.handle = &h; + + torture_assert_ntstatus_ok(tctx, + dcerpc_spoolss_ReplyClosePrinter(pipe, tctx, &s), + "spoolss_ReplyClosePrinter call failed"); + + torture_assert_werr_ok(tctx, r.out.result, "error return code"); + + return true; +} + struct torture_suite *torture_rpc_spoolss_notify(TALLOC_CTX *mem_ctx) { struct torture_suite *suite = torture_suite_create(mem_ctx, "SPOOLSS-NOTIFY"); @@ -297,6 +332,7 @@ struct torture_suite *torture_rpc_spoolss_notify(TALLOC_CTX *mem_ctx) "notify", &ndr_table_spoolss); torture_rpc_tcase_add_test(tcase, "testRFFPCNEx", test_RFFPCNEx); + torture_rpc_tcase_add_test(tcase, "testReplyOpenPrinter", test_ReplyOpenPrinter); return suite; } -- cgit From 56f5105400e1eda7baf5babe7ad1e608d0ffa04b Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 13 Apr 2009 17:06:37 +0200 Subject: s4-smbtorture: disable test_SecondaryClosePrinter when running against s3 for now. Guenther --- source4/torture/rpc/spoolss.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source4') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 6c78cf3cc2..f4181f4747 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -1658,8 +1658,10 @@ static bool test_OpenPrinter(struct torture_context *tctx, ret = false; } - if (!test_SecondaryClosePrinter(tctx, p, &handle)) { - ret = false; + if (!torture_setting_bool(tctx, "samba3", false)) { + if (!test_SecondaryClosePrinter(tctx, p, &handle)) { + ret = false; + } } if (!test_ClosePrinter(tctx, p, &handle)) { @@ -1758,8 +1760,10 @@ static bool test_OpenPrinterEx(struct torture_context *tctx, ret = false; } - if (!test_SecondaryClosePrinter(tctx, p, &handle)) { - ret = false; + if (!torture_setting_bool(tctx, "samba3", false)) { + if (!test_SecondaryClosePrinter(tctx, p, &handle)) { + ret = false; + } } if (!test_ClosePrinter(tctx, p, &handle)) { -- cgit From 1dbb6530fa044fbbc65409238b5b57dfd0e850a3 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 13 Apr 2009 20:44:19 +0200 Subject: s4-smbtorture: fix two valgrind warnings. Guenther --- source4/torture/rpc/spoolss.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index f4181f4747..b1889704a7 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -1122,6 +1122,7 @@ static bool test_AddJob(struct torture_context *tctx, r.in.handle = handle; r.in.offered = 0; r.out.needed = &needed; + r.in.buffer = r.out.buffer = NULL; torture_comment(tctx, "Testing AddJob\n"); @@ -1381,6 +1382,7 @@ static bool test_GetPrinterDataEx(struct torture_context *tctx, r.in.offered = 0; r.out.type = &type; r.out.needed = &needed; + r.out.buffer = NULL; torture_comment(tctx, "Testing GetPrinterDataEx\n"); -- cgit