]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4-torture: cleanup after printing tests that had to add a driver
authorGünther Deschner <gd@samba.org>
Tue, 10 Jan 2017 17:23:14 +0000 (18:23 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 12 Jan 2017 14:35:13 +0000 (15:35 +0100)
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>
source4/torture/rpc/spoolss.c

index bc25e859e9b0cdf3f3a50498cfb164cc6eab26b5..67822a14b5e4f03087d5ebbc631248ec79d32029 100644 (file)
@@ -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),