]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:torture: Delete printer before we remove the driver
authorAndreas Schneider <asn@samba.org>
Tue, 8 Aug 2017 08:40:19 +0000 (10:40 +0200)
committerKarolin Seeger <kseeger@samba.org>
Mon, 28 Aug 2017 09:04:16 +0000 (11:04 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12984

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit bd44e435fa6a93d47a470f8ee95763a95eba4b5d)

source4/torture/rpc/spoolss.c

index a6315069bc8ec434fcca86117e52c124f5655cb8..2f60383e0e60b64f98669cedbe20aeb018f6768e 100644 (file)
@@ -8584,6 +8584,22 @@ static bool torture_rpc_spoolss_printer_teardown_common(struct torture_context *
 
        server_name_slash = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
 
+       if (!t->wellknown) {
+               const char *printer_name = t->info2.printername;
+
+               torture_assert(tctx,
+                       test_DeletePrinter(tctx, b, &t->handle),
+                       "failed to delete printer");
+
+               torture_assert(tctx,
+                       test_EnumPrinters_findname(tctx, b, PRINTER_ENUM_LOCAL, 1,
+                                                  printer_name, &found),
+                       "failed to enumerate printers");
+
+               torture_assert(tctx, !found, "deleted printer still there");
+       }
+
+
        if (t->added_driver) {
                torture_assert(tctx,
                        remove_printer_driver(tctx, dcerpc_server_name(p), &t->driver),
@@ -8600,21 +8616,6 @@ static bool torture_rpc_spoolss_printer_teardown_common(struct torture_context *
                        "failed to delete printer driver via spoolss");
        }
 
-       if (!t->wellknown) {
-               const char *printer_name = t->info2.printername;
-
-               torture_assert(tctx,
-                       test_DeletePrinter(tctx, b, &t->handle),
-                       "failed to delete printer");
-
-               torture_assert(tctx,
-                       test_EnumPrinters_findname(tctx, b, PRINTER_ENUM_LOCAL, 1,
-                                                  printer_name, &found),
-                       "failed to enumerate printers");
-
-               torture_assert(tctx, !found, "deleted printer still there");
-       }
-
        return true;
 }