svn commit: samba r24925 - in branches/4.0-spoolsstest: .
source/torture/rpc
jelmer at samba.org
jelmer at samba.org
Mon Sep 3 12:45:41 GMT 2007
Author: jelmer
Date: 2007-09-03 12:45:40 +0000 (Mon, 03 Sep 2007)
New Revision: 24925
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24925
Log:
Add file I had forgotten to commit.
Added:
branches/4.0-spoolsstest/source/torture/rpc/spoolss_notify.c
Modified:
branches/4.0-spoolsstest/
Changeset:
Property changes on: branches/4.0-spoolsstest
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:file-ids
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...
Added: branches/4.0-spoolsstest/source/torture/rpc/spoolss_notify.c
===================================================================
--- branches/4.0-spoolsstest/source/torture/rpc/spoolss_notify.c 2007-09-03 12:43:55 UTC (rev 24924)
+++ branches/4.0-spoolsstest/source/torture/rpc/spoolss_notify.c 2007-09-03 12:45:40 UTC (rev 24925)
@@ -0,0 +1,69 @@
+/*
+ Unix SMB/CIFS implementation.
+ test suite for spoolss rpc notify operations
+
+ Copyright (C) Jelmer Vernooij 2007
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "includes.h"
+#include "torture/torture.h"
+#include "torture/ui.h"
+#include "torture/rpc/rpc.h"
+#include "librpc/gen_ndr/ndr_spoolss_c.h"
+
+/** 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 policy_handle h;
+
+ r.in.server_name = "earth";
+ r.in.printer_local = 2;
+ r.in.type = REG_DWORD;
+ r.in.unknown1 = 0;
+ r.in.unknown2 = 0;
+ r.out.handle = &h;
+
+ /* FIXME: Listen for IRPC calls */
+
+ 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");
+
+ /* FIXME: Make sure that an irpc call was done */
+
+ return true;
+}
+
+struct torture_suite *torture_rpc_spoolss_notify(void)
+{
+ struct torture_suite *suite = torture_suite_create(
+ talloc_autofree_context(), "SPOOLSS-NOTIFY");
+
+ struct torture_tcase *tcase = torture_suite_add_rpc_iface_tcase(suite,
+ "notify", &dcerpc_table_spoolss);
+
+ torture_rpc_tcase_add_test(tcase, "test_replyopenprinter",
+ test_ReplyOpenPrinter);
+
+ return suite;
+}
More information about the samba-cvs
mailing list