The branch, v3-6-test has been updated
       via  5624aa8 s3-spoolss: Dont wipe out all drivers when only one should 
be deleted.
       via  abd4a39 s4-smbtorture: add torture test to check proper add and 
delete driver operations.
       via  1065ecc s3-selftest: mark the driver timestamp test as knownfail 
for now.
       via  4d9492e s4-smbtorture: also run the driver timestamp spoolss test 
against samba.
      from  519a85b s4-waf: split out wscript_build for ndrdump binary.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -----------------------------------------------------------------
commit 5624aa8eafa9220d93db4bd47e6a383e9bca47ef
Author: Günther Deschner <[email protected]>
Date:   Tue Feb 8 17:19:23 2011 +0100

    s3-spoolss: Dont wipe out all drivers when only one should be deleted.
    
    Great catch from Bjoern Baumbach <[email protected]> !
    
    Andreas, Simo, please check.
    
    We now have a torture test (rpc.spoolss.driver.driver.multiple_drivers) for 
this.
    
    Guenther
    
    Autobuild-User: Günther Deschner <[email protected]>
    Autobuild-Date: Tue Feb  8 18:11:48 CET 2011 on sn-devel-104
    (cherry picked from commit 8b64d0607bc3b5e3182d8a879a7fa382dbdf0fc7)

commit abd4a396ca25433dfcbbffe76911baea065a706e
Author: Günther Deschner <[email protected]>
Date:   Tue Feb 8 17:16:51 2011 +0100

    s4-smbtorture: add torture test to check proper add and delete driver 
operations.
    
    Thanks to Bjoern Baumbach <[email protected]> for pushing us to test and 
verify this.
    
    Guenther
    (cherry picked from commit 9e6d61fb8571683ddf02a7796e569ee8e4da907e)

commit 1065ecca34e1aa0ce9807867961a93be67359d69
Author: Günther Deschner <[email protected]>
Date:   Tue Feb 8 15:16:44 2011 +0100

    s3-selftest: mark the driver timestamp test as knownfail for now.
    
    Guenther
    (cherry picked from commit 541bf8068d5f9236ba63630f09cbc3cf02a8882f)

commit 4d9492ed6b965b912d7f31d5664f373306f0f722
Author: Günther Deschner <[email protected]>
Date:   Tue Feb 8 15:16:20 2011 +0100

    s4-smbtorture: also run the driver timestamp spoolss test against samba.
    
    Guenther
    (cherry picked from commit 7d107cda8936edfe3e0ce916600cc3cea91cd490)

-----------------------------------------------------------------------

Summary of changes:
 source3/rpc_server/srv_spoolss_util.c |    5 +-
 source3/selftest/knownfail            |    1 +
 source4/torture/rpc/spoolss.c         |   81 +++++++++++++++++++++++++++++++--
 3 files changed, 81 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/rpc_server/srv_spoolss_util.c 
b/source3/rpc_server/srv_spoolss_util.c
index 5640711..dc861f8 100644
--- a/source3/rpc_server/srv_spoolss_util.c
+++ b/source3/rpc_server/srv_spoolss_util.c
@@ -4126,9 +4126,10 @@ WERROR winreg_del_driver(TALLOC_CTX *mem_ctx,
        }
 
        key_name = talloc_asprintf(tmp_ctx,
-                                  "%s\\Environments\\%s\\Drivers\\Version-%u",
+                                  
"%s\\Environments\\%s\\Drivers\\Version-%u\\%s",
                                   TOP_LEVEL_CONTROL_KEY,
-                                  info8->architecture, version);
+                                  info8->architecture, version,
+                                  info8->driver_name);
        if (key_name == NULL) {
                result = WERR_NOMEM;
                goto done;
diff --git a/source3/selftest/knownfail b/source3/selftest/knownfail
index fde9b76..661ec50 100644
--- a/source3/selftest/knownfail
+++ b/source3/selftest/knownfail
@@ -4,3 +4,4 @@ samba3.posix_s3.rap.printing # fails sometimes on sn-devel
 samba3.posix_s3.rpc.spoolss.*printserver.enum_printers_old # fails on some 
hosts due to timing issues ?
 samba3.posix_s3.rpc.spoolss.printer.*addprinterex.print_test # another 
intermittent failure
 samba3.posix_s3.smb2.lock.*.rw-exclusive # another intermittent failure
+.*driver.add_driver_timestamps # we only can store dates, not timestamps
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index dc9f704..6ba1c3d 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -9269,10 +9269,6 @@ static bool test_add_driver_timestamps(struct 
torture_context *tctx,
        struct torture_driver_context *d;
        struct timeval t = timeval_current();
 
-       if (torture_setting_bool(tctx, "samba3", false)) {
-               torture_skip(tctx, "skipping timestamps test against samba");
-       }
-
        d = talloc_zero(tctx, struct torture_driver_context);
 
        d->info8.version                = SPOOLSS_DRIVER_VERSION_200X;
@@ -9299,6 +9295,81 @@ static bool test_add_driver_timestamps(struct 
torture_context *tctx,
        return true;
 }
 
+static bool test_multiple_drivers(struct torture_context *tctx,
+                                 struct dcerpc_pipe *p)
+{
+       struct torture_driver_context *d;
+       struct dcerpc_binding_handle *b = p->binding_handle;
+       const char *server_name_slash = talloc_asprintf(tctx, "\\\\%s", 
dcerpc_server_name(p));
+       int i;
+       struct spoolss_AddDriverInfo8 info8;
+       uint32_t add_flags = APD_COPY_NEW_FILES;
+       uint32_t delete_flags = 0;
+
+       d = talloc_zero(tctx, struct torture_driver_context);
+
+       d->info8.version                = SPOOLSS_DRIVER_VERSION_200X;
+       d->info8.driver_path            = talloc_strdup(d, "pscript5.dll");
+       d->info8.data_file              = talloc_strdup(d, "cups6.ppd");
+       d->info8.config_file            = talloc_strdup(d, "cupsui6.dll");
+       d->local.environment            = talloc_strdup(d, "Windows NT x86");
+       d->local.driver_directory       = talloc_strdup(d, 
"/usr/share/cups/drivers/i386");
+       d->ex                           = true;
+
+       torture_assert(tctx,
+               fillup_printserver_info(tctx, p, d),
+               "failed to fillup printserver info");
+
+       if (!directory_exist(d->local.driver_directory)) {
+               torture_skip(tctx, "Skipping Printer Driver test as no local 
driver is available");
+       }
+
+       torture_assert(tctx,
+               upload_printer_driver(tctx, dcerpc_server_name(p), d),
+               "failed to upload printer driver");
+
+       info8 = d->info8;
+       info8.architecture      = d->local.environment;
+
+       for (i=0; i < 3; i++) {
+               info8.driver_name               = talloc_asprintf(d, 
"torture_test_driver_%d", i);
+
+               torture_assert(tctx,
+                       test_AddPrinterDriver_args_level_3(tctx, b, 
server_name_slash, &info8, add_flags, true, NULL),
+                       "failed to add driver");
+       }
+
+       torture_assert(tctx,
+               test_DeletePrinterDriverEx(tctx, b, server_name_slash, 
"torture_test_driver_0", info8.architecture, delete_flags, info8.version),
+               "failed to delete driver");
+
+       torture_assert(tctx,
+               test_EnumPrinterDrivers_findone(tctx, b, server_name_slash, 
info8.architecture, 3, "torture_test_driver_1", NULL),
+               "torture_test_driver_1 no longer on the server");
+
+       torture_assert(tctx,
+               test_EnumPrinterDrivers_findone(tctx, b, server_name_slash, 
info8.architecture, 3, "torture_test_driver_2", NULL),
+               "torture_test_driver_2 no longer on the server");
+
+       torture_assert(tctx,
+               test_DeletePrinterDriverEx(tctx, b, server_name_slash, 
"torture_test_driver_1", info8.architecture, delete_flags, info8.version),
+               "failed to delete driver");
+
+       torture_assert(tctx,
+               test_EnumPrinterDrivers_findone(tctx, b, server_name_slash, 
info8.architecture, 3, "torture_test_driver_2", NULL),
+               "torture_test_driver_2 no longer on the server");
+
+       torture_assert(tctx,
+               test_DeletePrinterDriverEx(tctx, b, server_name_slash, 
"torture_test_driver_2", info8.architecture, delete_flags, info8.version),
+               "failed to delete driver");
+
+       torture_assert(tctx,
+               remove_printer_driver(tctx, dcerpc_server_name(p), d),
+               "failed to remove printer driver");
+
+       return true;
+}
+
 struct torture_suite *torture_rpc_spoolss_driver(TALLOC_CTX *mem_ctx)
 {
        struct torture_suite *suite = torture_suite_create(mem_ctx, 
"spoolss.driver");
@@ -9317,5 +9388,7 @@ struct torture_suite 
*torture_rpc_spoolss_driver(TALLOC_CTX *mem_ctx)
 
        torture_rpc_tcase_add_test(tcase, "add_driver_timestamps", 
test_add_driver_timestamps);
 
+       torture_rpc_tcase_add_test(tcase, "multiple_drivers", 
test_multiple_drivers);
+
        return suite;
 }


-- 
Samba Shared Repository

Reply via email to