summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2017-01-10 18:23:14 +0100
committerStefan Metzmacher <metze@samba.org>2017-01-12 15:35:13 +0100
commit06e4d1c174b27f001ece0d57abed3e472674b2e4 (patch)
treeedd960347ac125c3e4a14b6c5150f118f84fc349 /source4
parent39489a8ca958ad6ffc9d299486e7bff36c296adf (diff)
downloadsamba-06e4d1c174b27f001ece0d57abed3e472674b2e4.tar.gz
s4-torture: cleanup after printing tests that had to add a driver
We were only removing drivers from the upload area but did not delete them via spoolss. Guenther Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rpc/spoolss.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index bc25e859e9b..67822a14b5e 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -8559,21 +8559,42 @@ static bool torture_rpc_spoolss_printerdm_setup(struct torture_context *tctx, vo
}
#endif
+static bool test_DeletePrinterDriverEx_exp(struct torture_context *tctx,
+ struct dcerpc_binding_handle *b,
+ const char *server,
+ const char *driver,
+ const char *environment,
+ uint32_t delete_flags,
+ uint32_t version,
+ WERROR expected_result);
+
static bool torture_rpc_spoolss_printer_teardown_common(struct torture_context *tctx, struct torture_printer_context *t)
{
bool found = false;
struct dcerpc_pipe *p = t->spoolss_pipe;
- struct dcerpc_binding_handle *b;
+ struct dcerpc_binding_handle *b = p->binding_handle;
const char *printer_name = t->info2.printername;
+ const char *server_name_slash;
+
+ server_name_slash = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
if (t->added_driver) {
torture_assert(tctx,
- remove_printer_driver(tctx, dcerpc_server_name(t->spoolss_pipe), &t->driver),
+ remove_printer_driver(tctx, dcerpc_server_name(p), &t->driver),
"failed to remove printer driver");
+
+ torture_assert(tctx,
+ test_DeletePrinterDriverEx_exp(tctx, b,
+ server_name_slash,
+ t->driver.info8.driver_name,
+ t->driver.info8.architecture,
+ DPD_DELETE_ALL_FILES,
+ t->driver.info8.version,
+ WERR_OK),
+ "failed to delete printer driver via spoolss");
}
if (p && !t->wellknown) {
- b = p->binding_handle;
torture_assert(tctx,
test_DeletePrinter(tctx, b, &t->handle),