ctdb-scripts: Support storing statd-callout state in cluster filesystem
[samba4-gss.git] / source4 / torture / rpc / spoolss_notify.c
blobbd9dac48afeda68371e954ffa16367cf6e761b6a
1 /*
2 Unix SMB/CIFS implementation.
3 test suite for spoolss rpc notify operations
5 Copyright (C) Jelmer Vernooij 2007
6 Copyright (C) Guenther Deschner 2010
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include "includes.h"
24 #include "system/filesys.h"
25 #include "librpc/gen_ndr/ndr_spoolss_c.h"
26 #include "librpc/gen_ndr/ndr_spoolss.h"
27 #include "torture/rpc/torture_rpc.h"
28 #include "rpc_server/dcerpc_server.h"
29 #include "rpc_server/dcerpc_server_proto.h"
30 #include "rpc_server/service_rpc.h"
31 #include "samba/process_model.h"
32 #include "smb_server/smb_server.h"
33 #include "lib/socket/netif.h"
34 #include "ntvfs/ntvfs.h"
35 #include "param/param.h"
37 static struct dcesrv_context_callbacks srv_cb = {
38 .log.successful_authz = log_successful_dcesrv_authz_event,
39 .auth.gensec_prepare = dcesrv_gensec_prepare,
40 .assoc_group.find = dcesrv_assoc_group_find_s4,
43 static NTSTATUS spoolss__op_bind(struct dcesrv_connection_context *context,
44 const struct dcesrv_interface *iface)
46 return NT_STATUS_OK;
49 static void spoolss__op_unbind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
53 static NTSTATUS spoolss__op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_pull *pull, void **r)
55 enum ndr_err_code ndr_err;
56 uint16_t opnum = dce_call->pkt.u.request.opnum;
58 dce_call->fault_code = 0;
60 if (opnum >= ndr_table_spoolss.num_calls) {
61 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
62 return NT_STATUS_NET_WRITE_FAULT;
65 *r = talloc_size(mem_ctx, ndr_table_spoolss.calls[opnum].struct_size);
66 NT_STATUS_HAVE_NO_MEMORY(*r);
68 /* unravel the NDR for the packet */
69 ndr_err = ndr_table_spoolss.calls[opnum].ndr_pull(pull, NDR_IN, *r);
70 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
71 dce_call->fault_code = DCERPC_FAULT_NDR;
72 return NT_STATUS_NET_WRITE_FAULT;
75 return NT_STATUS_OK;
78 /* Note that received_packets are allocated on the NULL context
79 * because no other context appears to stay around long enough. */
80 static struct received_packet {
81 uint16_t opnum;
82 void *r;
83 struct received_packet *prev, *next;
84 } *received_packets = NULL;
86 static void free_received_packets(void)
88 struct received_packet *rp;
89 struct received_packet *rp_next;
91 for (rp = received_packets; rp; rp = rp_next) {
92 rp_next = rp->next;
93 DLIST_REMOVE(received_packets, rp);
94 talloc_unlink(rp, rp->r);
95 talloc_free(rp);
97 received_packets = NULL;
100 static WERROR _spoolss_ReplyOpenPrinter(struct dcesrv_call_state *dce_call,
101 TALLOC_CTX *mem_ctx,
102 struct spoolss_ReplyOpenPrinter *r)
104 DEBUG(1,("_spoolss_ReplyOpenPrinter\n"));
106 NDR_PRINT_IN_DEBUG(spoolss_ReplyOpenPrinter, r);
108 r->out.handle = talloc(r, struct policy_handle);
109 r->out.handle->handle_type = 42;
110 r->out.handle->uuid = GUID_random();
111 r->out.result = WERR_OK;
113 NDR_PRINT_OUT_DEBUG(spoolss_ReplyOpenPrinter, r);
115 return WERR_OK;
118 static WERROR _spoolss_ReplyClosePrinter(struct dcesrv_call_state *dce_call,
119 TALLOC_CTX *mem_ctx,
120 struct spoolss_ReplyClosePrinter *r)
122 DEBUG(1,("_spoolss_ReplyClosePrinter\n"));
124 NDR_PRINT_IN_DEBUG(spoolss_ReplyClosePrinter, r);
126 ZERO_STRUCTP(r->out.handle);
127 r->out.result = WERR_OK;
129 NDR_PRINT_OUT_DEBUG(spoolss_ReplyClosePrinter, r);
131 return WERR_OK;
134 static WERROR _spoolss_RouterReplyPrinterEx(struct dcesrv_call_state *dce_call,
135 TALLOC_CTX *mem_ctx,
136 struct spoolss_RouterReplyPrinterEx *r)
138 DEBUG(1,("_spoolss_RouterReplyPrinterEx\n"));
140 NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinterEx, r);
142 r->out.reply_result = talloc(r, uint32_t);
143 *r->out.reply_result = 0;
144 r->out.result = WERR_OK;
146 NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinterEx, r);
148 return WERR_OK;
151 static NTSTATUS spoolss__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
153 uint16_t opnum = dce_call->pkt.u.request.opnum;
154 struct received_packet *rp;
156 rp = talloc_zero(NULL, struct received_packet);
157 rp->opnum = opnum;
158 rp->r = talloc_reference(rp, r);
160 DLIST_ADD_END(received_packets, rp);
162 switch (opnum) {
163 case 58: {
164 struct spoolss_ReplyOpenPrinter *r2 = (struct spoolss_ReplyOpenPrinter *)r;
165 r2->out.result = _spoolss_ReplyOpenPrinter(dce_call, mem_ctx, r2);
166 break;
168 case 60: {
169 struct spoolss_ReplyClosePrinter *r2 = (struct spoolss_ReplyClosePrinter *)r;
170 r2->out.result = _spoolss_ReplyClosePrinter(dce_call, mem_ctx, r2);
171 break;
173 case 66: {
174 struct spoolss_RouterReplyPrinterEx *r2 = (struct spoolss_RouterReplyPrinterEx *)r;
175 r2->out.result = _spoolss_RouterReplyPrinterEx(dce_call, mem_ctx, r2);
176 break;
179 default:
180 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
181 break;
184 if (dce_call->fault_code != 0) {
185 return NT_STATUS_NET_WRITE_FAULT;
187 return NT_STATUS_OK;
191 static NTSTATUS spoolss__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
193 return NT_STATUS_OK;
197 static NTSTATUS spoolss__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r)
199 enum ndr_err_code ndr_err;
200 uint16_t opnum = dce_call->pkt.u.request.opnum;
202 ndr_err = ndr_table_spoolss.calls[opnum].ndr_push(push, NDR_OUT, r);
203 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
204 dce_call->fault_code = DCERPC_FAULT_NDR;
205 return NT_STATUS_NET_WRITE_FAULT;
208 return NT_STATUS_OK;
211 static const struct dcesrv_interface notify_test_spoolss_interface = {
212 .name = "spoolss",
213 .syntax_id = {{0x12345678,0x1234,0xabcd,{0xef,0x00},{0x01,0x23,0x45,0x67,0x89,0xab}},1.0},
214 .bind = spoolss__op_bind,
215 .unbind = spoolss__op_unbind,
216 .ndr_pull = spoolss__op_ndr_pull,
217 .dispatch = spoolss__op_dispatch,
218 .reply = spoolss__op_reply,
219 .ndr_push = spoolss__op_ndr_push
222 static bool spoolss__op_interface_by_uuid(struct dcesrv_interface *iface, const struct GUID *uuid, uint32_t if_version)
224 if (notify_test_spoolss_interface.syntax_id.if_version == if_version &&
225 GUID_equal(&notify_test_spoolss_interface.syntax_id.uuid, uuid)) {
226 memcpy(iface,&notify_test_spoolss_interface, sizeof(*iface));
227 return true;
230 return false;
233 static bool spoolss__op_interface_by_name(struct dcesrv_interface *iface, const char *name)
235 if (strcmp(notify_test_spoolss_interface.name, name)==0) {
236 memcpy(iface, &notify_test_spoolss_interface, sizeof(*iface));
237 return true;
240 return false;
243 static NTSTATUS spoolss__op_init_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
245 uint32_t i;
247 for (i=0;i<ndr_table_spoolss.endpoints->count;i++) {
248 NTSTATUS ret;
249 const char *name = ndr_table_spoolss.endpoints->names[i];
251 ret = dcesrv_interface_register(dce_ctx,
252 name,
253 NULL,
254 &notify_test_spoolss_interface,
255 NULL);
256 if (!NT_STATUS_IS_OK(ret)) {
257 DEBUG(1,("spoolss_op_init_server: failed to register endpoint '%s'\n",name));
258 return ret;
262 return NT_STATUS_OK;
265 static NTSTATUS spoolss__op_shutdown_server(struct dcesrv_context *dce_ctx,
266 const struct dcesrv_endpoint_server *ep_server)
268 return NT_STATUS_OK;
271 static bool test_OpenPrinter(struct torture_context *tctx,
272 struct dcerpc_pipe *p,
273 struct policy_handle *handle,
274 const char *printername)
276 struct spoolss_OpenPrinter r;
277 struct dcerpc_binding_handle *b = p->binding_handle;
279 ZERO_STRUCT(r);
281 r.in.printername = printername;
282 r.in.datatype = NULL;
283 r.in.devmode_ctr.devmode= NULL;
284 r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
285 r.out.handle = handle;
287 torture_comment(tctx, "Testing OpenPrinter(%s)\n", r.in.printername);
289 torture_assert_ntstatus_ok(tctx, dcerpc_spoolss_OpenPrinter_r(b, tctx, &r),
290 "OpenPrinter failed");
291 torture_assert_werr_ok(tctx, r.out.result,
292 "OpenPrinter failed");
294 return true;
297 static struct spoolss_NotifyOption *setup_printserver_NotifyOption(struct torture_context *tctx)
299 struct spoolss_NotifyOption *o;
301 o = talloc_zero(tctx, struct spoolss_NotifyOption);
303 o->version = 2;
304 o->flags = PRINTER_NOTIFY_OPTIONS_REFRESH;
306 o->count = 2;
307 o->types = talloc_zero_array(o, struct spoolss_NotifyOptionType, o->count);
309 o->types[0].type = PRINTER_NOTIFY_TYPE;
310 o->types[0].count = 1;
311 o->types[0].fields = talloc_array(o->types, union spoolss_Field, o->types[0].count);
312 o->types[0].fields[0].field = PRINTER_NOTIFY_FIELD_SERVER_NAME;
314 o->types[1].type = JOB_NOTIFY_TYPE;
315 o->types[1].count = 1;
316 o->types[1].fields = talloc_array(o->types, union spoolss_Field, o->types[1].count);
317 o->types[1].fields[0].field = JOB_NOTIFY_FIELD_MACHINE_NAME;
319 return o;
322 #if 0
323 static struct spoolss_NotifyOption *setup_printer_NotifyOption(struct torture_context *tctx)
325 struct spoolss_NotifyOption *o;
327 o = talloc_zero(tctx, struct spoolss_NotifyOption);
329 o->version = 2;
330 o->flags = PRINTER_NOTIFY_OPTIONS_REFRESH;
332 o->count = 1;
333 o->types = talloc_zero_array(o, struct spoolss_NotifyOptionType, o->count);
335 o->types[0].type = PRINTER_NOTIFY_TYPE;
336 o->types[0].count = 1;
337 o->types[0].fields = talloc_array(o->types, union spoolss_Field, o->types[0].count);
338 o->types[0].fields[0].field = PRINTER_NOTIFY_FIELD_COMMENT;
340 return o;
342 #endif
344 static bool test_RemoteFindFirstPrinterChangeNotifyEx(struct torture_context *tctx,
345 struct dcerpc_binding_handle *b,
346 struct policy_handle *handle,
347 const char *address,
348 struct spoolss_NotifyOption *option)
350 struct spoolss_RemoteFindFirstPrinterChangeNotifyEx r;
351 const char *local_machine = talloc_asprintf(tctx, "\\\\%s", address);
353 torture_comment(tctx, "Testing RemoteFindFirstPrinterChangeNotifyEx(%s)\n", local_machine);
355 r.in.flags = 0;
356 r.in.local_machine = local_machine;
357 r.in.options = 0;
358 r.in.printer_local = 0;
359 r.in.notify_options = option;
360 r.in.handle = handle;
362 torture_assert_ntstatus_ok(tctx, dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r(b, tctx, &r),
363 "RemoteFindFirstPrinterChangeNotifyEx failed");
364 torture_assert_werr_ok(tctx, r.out.result,
365 "error return code for RemoteFindFirstPrinterChangeNotifyEx");
367 return true;
370 static bool test_RouterRefreshPrinterChangeNotify(struct torture_context *tctx,
371 struct dcerpc_binding_handle *b,
372 struct policy_handle *handle,
373 struct spoolss_NotifyOption *options,
374 struct spoolss_NotifyInfo **info)
376 struct spoolss_RouterRefreshPrinterChangeNotify r;
378 torture_comment(tctx, "Testing RouterRefreshPrinterChangeNotify\n");
380 r.in.handle = handle;
381 r.in.change_low = 0;
382 r.in.options = options;
383 r.out.info = info;
385 torture_assert_ntstatus_ok(tctx, dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r(b, tctx, &r),
386 "RouterRefreshPrinterChangeNotify failed");
387 torture_assert_werr_ok(tctx, r.out.result,
388 "error return code for RouterRefreshPrinterChangeNotify");
390 return true;
393 #if 0
394 static bool test_SetPrinter(struct torture_context *tctx,
395 struct dcerpc_pipe *p,
396 struct policy_handle *handle)
398 union spoolss_PrinterInfo info;
399 struct spoolss_SetPrinter r;
400 struct spoolss_SetPrinterInfo2 info2;
401 struct spoolss_SetPrinterInfoCtr info_ctr;
402 struct spoolss_DevmodeContainer devmode_ctr;
403 struct sec_desc_buf secdesc_ctr;
404 struct dcerpc_binding_handle *b = p->binding_handle;
406 torture_assert(tctx, test_GetPrinter_level(tctx, b, handle, 2, &info), "");
408 ZERO_STRUCT(devmode_ctr);
409 ZERO_STRUCT(secdesc_ctr);
411 info2.servername = info.info2.servername;
412 info2.printername = info.info2.printername;
413 info2.sharename = info.info2.sharename;
414 info2.portname = info.info2.portname;
415 info2.drivername = info.info2.drivername;
416 info2.comment = talloc_asprintf(tctx, "torture_comment %d\n", (int)time(NULL));
417 info2.location = info.info2.location;
418 info2.devmode_ptr = 0;
419 info2.sepfile = info.info2.sepfile;
420 info2.printprocessor = info.info2.printprocessor;
421 info2.datatype = info.info2.datatype;
422 info2.parameters = info.info2.parameters;
423 info2.secdesc_ptr = 0;
424 info2.attributes = info.info2.attributes;
425 info2.priority = info.info2.priority;
426 info2.defaultpriority = info.info2.defaultpriority;
427 info2.starttime = info.info2.starttime;
428 info2.untiltime = info.info2.untiltime;
429 info2.status = info.info2.status;
430 info2.cjobs = info.info2.cjobs;
431 info2.averageppm = info.info2.averageppm;
433 info_ctr.level = 2;
434 info_ctr.info.info2 = &info2;
436 r.in.handle = handle;
437 r.in.info_ctr = &info_ctr;
438 r.in.devmode_ctr = &devmode_ctr;
439 r.in.secdesc_ctr = &secdesc_ctr;
440 r.in.command = 0;
442 torture_assert_ntstatus_ok(tctx, dcerpc_spoolss_SetPrinter_r(b, tctx, &r), "SetPrinter failed");
443 torture_assert_werr_ok(tctx, r.out.result, "SetPrinter failed");
445 return true;
447 #endif
449 static bool test_start_dcerpc_server(struct torture_context *tctx,
450 struct tevent_context *event_ctx,
451 struct dcesrv_context **dce_ctx_p,
452 const char **address_p)
454 struct dcesrv_endpoint_server ep_server;
455 NTSTATUS status;
456 struct dcesrv_context *dce_ctx;
457 const char *endpoints[] = { "spoolss", NULL };
458 struct dcesrv_endpoint *e;
459 const char *address;
460 struct interface *ifaces;
462 ntvfs_init(tctx->lp_ctx);
464 /* fill in our name */
465 ep_server.name = "spoolss";
467 ep_server.initialized = false;
469 /* fill in all the operations */
470 ep_server.init_server = spoolss__op_init_server;
471 ep_server.shutdown_server = spoolss__op_shutdown_server;
473 ep_server.interface_by_uuid = spoolss__op_interface_by_uuid;
474 ep_server.interface_by_name = spoolss__op_interface_by_name;
476 torture_assert_ntstatus_ok(tctx, dcerpc_register_ep_server(&ep_server),
477 "unable to register spoolss server");
479 lpcfg_set_cmdline(tctx->lp_ctx, "dcerpc endpoint servers", "spoolss");
481 load_interface_list(tctx, tctx->lp_ctx, &ifaces);
482 address = iface_list_first_v4(ifaces);
484 torture_comment(tctx, "Listening for callbacks on %s\n", address);
486 status = process_model_init(tctx->lp_ctx);
487 torture_assert_ntstatus_ok(tctx, status,
488 "unable to initialize process models");
490 status = smbsrv_add_socket(tctx, event_ctx, tctx->lp_ctx,
491 process_model_startup("single"),
492 address, NULL);
493 torture_assert_ntstatus_ok(tctx, status, "starting smb server");
495 status = dcesrv_init_context(tctx, tctx->lp_ctx, &srv_cb, &dce_ctx);
496 torture_assert_ntstatus_ok(tctx, status,
497 "unable to initialize DCE/RPC server");
499 status = dcesrv_init_ep_servers(dce_ctx, endpoints);
500 torture_assert_ntstatus_ok(tctx,
501 status,
502 "unable to initialize DCE/RPC ep servers");
504 for (e=dce_ctx->endpoint_list;e;e=e->next) {
505 status = dcesrv_add_ep(dce_ctx, tctx->lp_ctx,
506 e, tctx->ev,
507 process_model_startup("single"), NULL);
508 torture_assert_ntstatus_ok(tctx, status,
509 "unable listen on dcerpc endpoint server");
512 *dce_ctx_p = dce_ctx;
513 *address_p = address;
515 return true;
518 static struct received_packet *last_packet(struct received_packet *p)
520 struct received_packet *tmp;
521 for (tmp = p; tmp->next; tmp = tmp->next) {
523 return tmp;
526 static bool test_RFFPCNEx(struct torture_context *tctx,
527 struct dcerpc_pipe *p)
529 struct dcesrv_context *dce_ctx;
530 struct policy_handle handle;
531 const char *address;
532 struct received_packet *tmp;
533 struct spoolss_NotifyOption *server_option = setup_printserver_NotifyOption(tctx);
534 #if 0
535 struct spoolss_NotifyOption *printer_option = setup_printer_NotifyOption(tctx);
536 #endif
537 struct dcerpc_binding_handle *b = p->binding_handle;
538 const char *printername = NULL;
539 struct spoolss_NotifyInfo *info = NULL;
541 free_received_packets();
543 /* Start DCE/RPC server */
544 torture_assert(tctx, test_start_dcerpc_server(tctx, tctx->ev, &dce_ctx, &address), "");
546 printername = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
548 torture_assert(tctx, test_OpenPrinter(tctx, p, &handle, printername), "");
549 torture_assert(tctx, test_RemoteFindFirstPrinterChangeNotifyEx(tctx, b, &handle, address, server_option), "");
550 torture_assert(tctx, received_packets, "no packets received");
551 torture_assert_int_equal(tctx, received_packets->opnum, NDR_SPOOLSS_REPLYOPENPRINTER,
552 "no ReplyOpenPrinter packet after RemoteFindFirstPrinterChangeNotifyEx");
553 torture_assert(tctx, test_RouterRefreshPrinterChangeNotify(tctx, b, &handle, NULL, &info), "");
554 torture_assert(tctx, test_RouterRefreshPrinterChangeNotify(tctx, b, &handle, server_option, &info), "");
555 torture_assert(tctx, test_ClosePrinter(tctx, b, &handle), "");
556 tmp = last_packet(received_packets);
557 torture_assert_int_equal(tctx, tmp->opnum, NDR_SPOOLSS_REPLYCLOSEPRINTER,
558 "no ReplyClosePrinter packet after ClosePrinter");
559 #if 0
560 printername = talloc_asprintf(tctx, "\\\\%s\\%s", dcerpc_server_name(p), name);
562 torture_assert(tctx, test_OpenPrinter(tctx, p, &handle, "Epson AL-2600"), "");
563 torture_assert(tctx, test_RemoteFindFirstPrinterChangeNotifyEx(tctx, p, &handle, address, printer_option), "");
564 tmp = last_packet(received_packets);
565 torture_assert_int_equal(tctx, tmp->opnum, NDR_SPOOLSS_REPLYOPENPRINTER,
566 "no ReplyOpenPrinter packet after RemoteFindFirstPrinterChangeNotifyEx");
567 torture_assert(tctx, test_RouterRefreshPrinterChangeNotify(tctx, p, &handle, NULL, &info), "");
568 torture_assert(tctx, test_RouterRefreshPrinterChangeNotify(tctx, p, &handle, printer_option, &info), "");
569 torture_assert(tctx, test_SetPrinter(tctx, p, &handle), "");
570 tmp = last_packet(received_packets);
571 torture_assert_int_equal(tctx, tmp->opnum, NDR_SPOOLSS_ROUTERREPLYPRINTEREX,
572 "no RouterReplyPrinterEx packet after ClosePrinter");
573 torture_assert(tctx, test_ClosePrinter(tctx, p, &handle), "");
574 tmp = last_packet(received_packets);
575 torture_assert_int_equal(tctx, tmp->opnum, NDR_SPOOLSS_REPLYCLOSEPRINTER,
576 "no ReplyClosePrinter packet after ClosePrinter");
577 #endif
578 /* Shut down DCE/RPC server */
579 talloc_free(dce_ctx);
580 free_received_packets();
582 return true;
585 /** Test that makes sure that calling ReplyOpenPrinter()
586 * on Samba 4 will cause an irpc broadcast call.
588 static bool test_ReplyOpenPrinter(struct torture_context *tctx,
589 struct dcerpc_pipe *p)
591 struct spoolss_ReplyOpenPrinter r;
592 struct spoolss_ReplyClosePrinter s;
593 struct policy_handle h;
594 struct dcerpc_binding_handle *b = p->binding_handle;
596 if (torture_setting_bool(tctx, "samba3", false)) {
597 torture_skip(tctx, "skipping ReplyOpenPrinter server implementation test against s3\n");
600 r.in.server_name = "earth";
601 r.in.printer_local = 2;
602 r.in.type = REG_DWORD;
603 r.in.bufsize = 0;
604 r.in.buffer = NULL;
605 r.out.handle = &h;
607 torture_assert_ntstatus_ok(tctx,
608 dcerpc_spoolss_ReplyOpenPrinter_r(b, tctx, &r),
609 "spoolss_ReplyOpenPrinter call failed");
611 torture_assert_werr_ok(tctx, r.out.result, "error return code");
613 s.in.handle = &h;
614 s.out.handle = &h;
616 torture_assert_ntstatus_ok(tctx,
617 dcerpc_spoolss_ReplyClosePrinter_r(b, tctx, &s),
618 "spoolss_ReplyClosePrinter call failed");
620 torture_assert_werr_ok(tctx, r.out.result, "error return code");
622 return true;
625 struct torture_suite *torture_rpc_spoolss_notify(TALLOC_CTX *mem_ctx)
627 struct torture_suite *suite = torture_suite_create(mem_ctx, "spoolss.notify");
629 struct torture_rpc_tcase *tcase = torture_suite_add_rpc_iface_tcase(suite,
630 "notify", &ndr_table_spoolss);
632 torture_rpc_tcase_add_test(tcase, "testRFFPCNEx", test_RFFPCNEx);
633 torture_rpc_tcase_add_test(tcase, "testReplyOpenPrinter", test_ReplyOpenPrinter);
635 return suite;