s4-smbtorture: Make test names lowercase and dot-separated.
[metze/samba/wip.git] / source4 / torture / rpc / spoolss.c
index de4ca83b0bc385978828eb60728ce99d55590d76..26e53eb2524b8eda6d17b3f809440a3f19d80134 100644 (file)
@@ -45,6 +45,9 @@
 #define TORTURE_PRINTER_EX             "torture_printer_ex"
 #define TORTURE_DRIVER                 "torture_driver"
 #define TORTURE_DRIVER_EX              "torture_driver_ex"
+#define TORTURE_DRIVER_ADOBE           "torture_driver_adobe"
+#define TORTURE_DRIVER_EX_ADOBE                "torture_driver_ex_adobe"
+#define TORTURE_DRIVER_ADOBE_CUPSADDSMB        "torture_driver_adobe_cupsaddsmb"
 
 #define TOP_LEVEL_PRINT_KEY "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print"
 #define TOP_LEVEL_PRINT_PRINTERS_KEY TOP_LEVEL_PRINT_KEY "\\Printers"
@@ -3334,8 +3337,8 @@ static bool test_DoPrintTest_check_jobs(struct torture_context *tctx,
 
                if (strequal(ginfo.info1.document_name, document_name)) {
                        torture_warning(tctx,
-                               talloc_asprintf(tctx, "document_name did *NOT* change from '%s' to '%s'\n",
-                                       document_name, new_document_name));
+                                       "document_name did *NOT* change from '%s' to '%s'\n",
+                                       document_name, new_document_name);
                }
        }
 
@@ -3474,13 +3477,14 @@ static bool test_ResumePrinter(struct torture_context *tctx,
        return true;
 }
 
-static bool test_GetPrinterData(struct torture_context *tctx,
-                               struct dcerpc_binding_handle *b,
-                               struct policy_handle *handle,
-                               const char *value_name,
-                               enum winreg_Type *type_p,
-                               uint8_t **data_p,
-                               uint32_t *needed_p)
+static bool test_GetPrinterData_checktype(struct torture_context *tctx,
+                                         struct dcerpc_binding_handle *b,
+                                         struct policy_handle *handle,
+                                         const char *value_name,
+                                         enum winreg_Type *expected_type,
+                                         enum winreg_Type *type_p,
+                                         uint8_t **data_p,
+                                         uint32_t *needed_p)
 {
        NTSTATUS status;
        struct spoolss_GetPrinterData r;
@@ -3501,6 +3505,9 @@ static bool test_GetPrinterData(struct torture_context *tctx,
        torture_assert_ntstatus_ok(tctx, status, "GetPrinterData failed");
 
        if (W_ERROR_EQUAL(r.out.result, WERR_MORE_DATA)) {
+               if (expected_type) {
+                       torture_assert_int_equal(tctx, type, *expected_type, "unexpected type");
+               }
                r.in.offered = needed;
                r.out.data = talloc_zero_array(tctx, uint8_t, r.in.offered);
                status = dcerpc_spoolss_GetPrinterData_r(b, tctx, &r);
@@ -3527,14 +3534,27 @@ static bool test_GetPrinterData(struct torture_context *tctx,
        return true;
 }
 
-static bool test_GetPrinterDataEx(struct torture_context *tctx,
-                                 struct dcerpc_pipe *p,
-                                 struct policy_handle *handle,
-                                 const char *key_name,
-                                 const char *value_name,
-                                 enum winreg_Type *type_p,
-                                 uint8_t **data_p,
-                                 uint32_t *needed_p)
+static bool test_GetPrinterData(struct torture_context *tctx,
+                               struct dcerpc_binding_handle *b,
+                               struct policy_handle *handle,
+                               const char *value_name,
+                               enum winreg_Type *type_p,
+                               uint8_t **data_p,
+                               uint32_t *needed_p)
+{
+       return test_GetPrinterData_checktype(tctx, b, handle, value_name,
+                                            NULL, type_p, data_p, needed_p);
+}
+
+static bool test_GetPrinterDataEx_checktype(struct torture_context *tctx,
+                                           struct dcerpc_pipe *p,
+                                           struct policy_handle *handle,
+                                           const char *key_name,
+                                           const char *value_name,
+                                           enum winreg_Type *expected_type,
+                                           enum winreg_Type *type_p,
+                                           uint8_t **data_p,
+                                           uint32_t *needed_p)
 {
        NTSTATUS status;
        struct spoolss_GetPrinterDataEx r;
@@ -3563,6 +3583,9 @@ static bool test_GetPrinterDataEx(struct torture_context *tctx,
        }
 
        if (W_ERROR_EQUAL(r.out.result, WERR_MORE_DATA)) {
+               if (expected_type) {
+                       torture_assert_int_equal(tctx, type, *expected_type, "unexpected type");
+               }
                r.in.offered = needed;
                r.out.data = talloc_zero_array(tctx, uint8_t, r.in.offered);
                status = dcerpc_spoolss_GetPrinterDataEx_r(b, tctx, &r);
@@ -3589,6 +3612,19 @@ static bool test_GetPrinterDataEx(struct torture_context *tctx,
        return true;
 }
 
+static bool test_GetPrinterDataEx(struct torture_context *tctx,
+                                 struct dcerpc_pipe *p,
+                                 struct policy_handle *handle,
+                                 const char *key_name,
+                                 const char *value_name,
+                                 enum winreg_Type *type_p,
+                                 uint8_t **data_p,
+                                 uint32_t *needed_p)
+{
+       return test_GetPrinterDataEx_checktype(tctx, p, handle, key_name, value_name,
+                                              NULL, type_p, data_p, needed_p);
+}
+
 static bool test_get_environment(struct torture_context *tctx,
                                 struct dcerpc_binding_handle *b,
                                 struct policy_handle *handle,
@@ -4751,7 +4787,7 @@ static bool test_SetPrinterData_matrix(struct torture_context *tctx,
 
        for (i=0; i < ARRAY_SIZE(values); i++) {
 
-               enum winreg_Type type;
+               enum winreg_Type type, expected_type = REG_SZ;
                DATA_BLOB blob;
                uint8_t *data;
                uint32_t needed;
@@ -4764,7 +4800,7 @@ static bool test_SetPrinterData_matrix(struct torture_context *tctx,
                        "SetPrinterData failed");
 
                torture_assert(tctx,
-                       test_GetPrinterData(tctx, b, handle, values[i], &type, &data, &needed),
+                       test_GetPrinterData_checktype(tctx, b, handle, values[i], &expected_type, &type, &data, &needed),
                        "GetPrinterData failed");
 
                torture_assert_int_equal(tctx, type, REG_SZ, "type mismatch");
@@ -5087,7 +5123,7 @@ static bool test_SetPrinterDataEx_matrix(struct torture_context *tctx,
                        "failed to call SetPrinterDataEx");
 
                torture_assert(tctx,
-                       test_GetPrinterDataEx(tctx, p, handle, key_name, value_name, &type, &data_out, &needed),
+                       test_GetPrinterDataEx_checktype(tctx, p, handle, key_name, value_name, &types[t], &type, &data_out, &needed),
                        "failed to call GetPrinterDataEx");
 
                torture_assert(tctx,
@@ -5777,10 +5813,8 @@ static bool call_OpenPrinterEx(struct torture_context *tctx,
                               struct spoolss_DeviceMode *devmode,
                               struct policy_handle *handle)
 {
-       struct spoolss_OpenPrinterEx r;
        union spoolss_UserLevel userlevel;
        struct spoolss_UserLevel1 userlevel1;
-       NTSTATUS status;
        struct dcerpc_binding_handle *b = p->binding_handle;
 
        userlevel1.size = 1234;
@@ -5896,6 +5930,118 @@ static bool test_printer_rename(struct torture_context *tctx,
        return ret;
 }
 
+static bool test_openprinter(struct torture_context *tctx,
+                            struct dcerpc_binding_handle *b,
+                            const char *real_printername)
+{
+       union spoolss_UserLevel userlevel;
+       struct policy_handle handle;
+       struct spoolss_UserLevel1 userlevel1;
+       const char *printername = NULL;
+       int i;
+
+       struct {
+               const char *suffix;
+               WERROR expected_result;
+       } tests[] = {
+               {
+                       .suffix                 = "rubbish",
+                       .expected_result        = WERR_INVALID_PRINTER_NAME
+               },{
+                       .suffix                 = ", LocalOnl",
+                       .expected_result        = WERR_INVALID_PRINTER_NAME
+               },{
+                       .suffix                 = ", localOnly",
+                       .expected_result        = WERR_INVALID_PRINTER_NAME
+               },{
+                       .suffix                 = ", localonl",
+                       .expected_result        = WERR_INVALID_PRINTER_NAME
+               },{
+                       .suffix                 = ",LocalOnl",
+                       .expected_result        = WERR_INVALID_PRINTER_NAME
+               },{
+                       .suffix                 = ",localOnl2",
+                       .expected_result        = WERR_INVALID_PRINTER_NAME
+               },{
+                       .suffix                 = ", DrvConver2t",
+                       .expected_result        = WERR_INVALID_PRINTER_NAME
+               },{
+                       .suffix                 = ", drvconvert",
+                       .expected_result        = WERR_INVALID_PRINTER_NAME
+               },{
+                       .suffix                 = ",drvconvert",
+                       .expected_result        = WERR_INVALID_PRINTER_NAME
+               },{
+                       .suffix                 = ", DrvConvert",
+                       .expected_result        = WERR_OK
+               },{
+                       .suffix                 = " , DrvConvert",
+                       .expected_result        = WERR_INVALID_PRINTER_NAME
+               },{
+                       .suffix                 = ",DrvConvert",
+                       .expected_result        = WERR_OK
+               },{
+                       .suffix                 = ", DrvConvertsadfasdf",
+                       .expected_result        = WERR_OK
+               },{
+                       .suffix                 = ",DrvConvertasdfasd",
+                       .expected_result        = WERR_OK
+               },{
+                       .suffix                 = ", LocalOnly",
+                       .expected_result        = WERR_OK
+               },{
+                       .suffix                 = " , LocalOnly",
+                       .expected_result        = WERR_INVALID_PRINTER_NAME
+               },{
+                       .suffix                 = ",LocalOnly",
+                       .expected_result        = WERR_OK
+               },{
+                       .suffix                 = ", LocalOnlysagi4gjfkd",
+                       .expected_result        = WERR_OK
+               },{
+                       .suffix                 = ",LocalOnlysagi4gjfkd",
+                       .expected_result        = WERR_OK
+               }
+       };
+
+       userlevel1.size = 1234;
+       userlevel1.client = "hello";
+       userlevel1.user = "spottyfoot!";
+       userlevel1.build = 1;
+       userlevel1.major = 2;
+       userlevel1.minor = 3;
+       userlevel1.processor = 4;
+
+       userlevel.level1 = &userlevel1;
+
+       torture_comment(tctx, "Testing openprinterex printername pattern\n");
+
+       torture_assert(tctx,
+               test_OpenPrinterEx(tctx, b, real_printername, NULL, NULL, 0, 1,
+                                  &userlevel, &handle,
+                                  WERR_OK),
+               "OpenPrinterEx failed");
+       test_ClosePrinter(tctx, b, &handle);
+
+       for (i=0; i < ARRAY_SIZE(tests); i++) {
+
+               printername = talloc_asprintf(tctx, "%s%s",
+                                             real_printername,
+                                             tests[i].suffix);
+
+               torture_assert(tctx,
+                       test_OpenPrinterEx(tctx, b, printername, NULL, NULL, 0, 1,
+                                          &userlevel, &handle,
+                                          tests[i].expected_result),
+                       "OpenPrinterEx failed");
+               if (W_ERROR_IS_OK(tests[i].expected_result)) {
+                       test_ClosePrinter(tctx, b, &handle);
+               }
+       }
+
+       return true;
+}
+
 
 static bool test_existing_printer_openprinterex(struct torture_context *tctx,
                                                struct dcerpc_pipe *p,
@@ -5906,6 +6052,10 @@ static bool test_existing_printer_openprinterex(struct torture_context *tctx,
        bool ret = true;
        struct dcerpc_binding_handle *b = p->binding_handle;
 
+       if (!test_openprinter(tctx, b, name)) {
+               return false;
+       }
+
        if (!call_OpenPrinterEx(tctx, p, name, NULL, &handle)) {
                return false;
        }
@@ -6895,6 +7045,18 @@ bool test_printer_all_keys(struct torture_context *tctx,
        return true;
 }
 
+static bool test_openprinter_wrap(struct torture_context *tctx,
+                                 void *private_data)
+{
+       struct torture_printer_context *t =
+               (struct torture_printer_context *)talloc_get_type_abort(private_data, struct torture_printer_context);
+       struct dcerpc_pipe *p = t->spoolss_pipe;
+       struct dcerpc_binding_handle *b = p->binding_handle;
+       const char *printername = t->info2.printername;
+
+       return test_openprinter(tctx, b, printername);
+}
+
 static bool test_csetprinter(struct torture_context *tctx,
                             void *private_data)
 {
@@ -7636,6 +7798,7 @@ static bool test_driver_info_winreg(struct torture_context *tctx,
 
 void torture_tcase_printer(struct torture_tcase *tcase)
 {
+       torture_tcase_add_simple_test(tcase, "openprinter", test_openprinter_wrap);
        torture_tcase_add_simple_test(tcase, "csetprinter", test_csetprinter);
        torture_tcase_add_simple_test(tcase, "print_test", test_print_test);
        torture_tcase_add_simple_test(tcase, "print_test_extended", test_print_test_extended);
@@ -7657,7 +7820,7 @@ void torture_tcase_printer(struct torture_tcase *tcase)
 
 struct torture_suite *torture_rpc_spoolss_printer(TALLOC_CTX *mem_ctx)
 {
-       struct torture_suite *suite = torture_suite_create(mem_ctx, "PRINTER");
+       struct torture_suite *suite = torture_suite_create(mem_ctx, "printer");
        struct torture_tcase *tcase;
 
        tcase = torture_suite_add_tcase(suite, "addprinter");
@@ -7703,8 +7866,8 @@ struct torture_suite *torture_rpc_spoolss_printer(TALLOC_CTX *mem_ctx)
 
 struct torture_suite *torture_rpc_spoolss(TALLOC_CTX *mem_ctx)
 {
-       struct torture_suite *suite = torture_suite_create(mem_ctx, "SPOOLSS");
-       struct torture_tcase *tcase = torture_suite_add_tcase(suite, "PRINTSERVER");
+       struct torture_suite *suite = torture_suite_create(mem_ctx, "spoolss");
+       struct torture_tcase *tcase = torture_suite_add_tcase(suite, "printserver");
 
        torture_tcase_set_fixture(tcase,
                                  torture_rpc_spoolss_setup,
@@ -8439,7 +8602,7 @@ static bool upload_printer_driver_file(struct torture_context *tctx,
        const char *local_name = talloc_asprintf(tctx, "%s/%s", d->local.driver_directory, file_name);
        const char *remote_name = talloc_asprintf(tctx, "%s\\%s", remote_dir, file_name);
 
-       if (!file_name) {
+       if (!file_name || strlen(file_name) == 0) {
                return true;
        }
 
@@ -8571,7 +8734,7 @@ static bool remove_printer_driver_file(struct torture_context *tctx,
        const char *remote_name;
        const char *remote_dir =  driver_directory_dir(d->remote.driver_directory);
 
-       if (!file_name) {
+       if (!file_name || strlen(file_name) == 0) {
                return true;
        }
 
@@ -8607,9 +8770,11 @@ static bool remove_printer_driver(struct torture_context *tctx,
        torture_assert(tctx,
                remove_printer_driver_file(tctx, cli, d, d->info8.data_file),
                "failed to remove data_file");
-       torture_assert(tctx,
-               remove_printer_driver_file(tctx, cli, d, d->info8.config_file),
-               "failed to remove config_file");
+       if (!strequal(d->info8.config_file, d->info8.driver_path)) {
+               torture_assert(tctx,
+                       remove_printer_driver_file(tctx, cli, d, d->info8.config_file),
+                       "failed to remove config_file");
+       }
        torture_assert(tctx,
                remove_printer_driver_file(tctx, cli, d, d->info8.help_file),
                "failed to remove help_file");
@@ -8693,7 +8858,9 @@ static bool test_add_driver_arg(struct torture_context *tctx,
 
        info8.driver_path       = talloc_asprintf(tctx, "%s\\%s", d->remote.driver_directory, d->info8.driver_path);
        info8.data_file         = talloc_asprintf(tctx, "%s\\%s", d->remote.driver_directory, d->info8.data_file);
-       info8.config_file       = talloc_asprintf(tctx, "%s\\%s", d->remote.driver_directory, d->info8.config_file);
+       if (d->info8.config_file) {
+               info8.config_file       = talloc_asprintf(tctx, "%s\\%s", d->remote.driver_directory, d->info8.config_file);
+       }
 
        for (i=0; i < ARRAY_SIZE(levels); i++) {
 
@@ -8727,60 +8894,143 @@ static bool test_add_driver_arg(struct torture_context *tctx,
 }
 
 static bool test_add_driver_ex_64(struct torture_context *tctx,
-                                 struct dcerpc_pipe *p,
-                                 void *private_data)
+                                 struct dcerpc_pipe *p)
 {
-       struct torture_driver_context *d =
-               (struct torture_driver_context *)talloc_get_type_abort(private_data, struct torture_driver_context);
+       struct torture_driver_context *d;
+
+       d = talloc_zero(tctx, struct torture_driver_context);
 
+       d->info8.version                = SPOOLSS_DRIVER_VERSION_200X;
+       d->info8.driver_name            = TORTURE_DRIVER_EX;
+       d->info8.architecture           = NULL;
+       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 x64");
        d->local.driver_directory       = talloc_strdup(d, "/usr/share/cups/drivers/x64");
-       d->info8.driver_name            = TORTURE_DRIVER_EX;
        d->ex                           = true;
 
        return test_add_driver_arg(tctx, p, d);
 }
 
 static bool test_add_driver_ex_32(struct torture_context *tctx,
-                                 struct dcerpc_pipe *p,
-                                 void *private_data)
+                                 struct dcerpc_pipe *p)
 {
-       struct torture_driver_context *d =
-               (struct torture_driver_context *)talloc_get_type_abort(private_data, struct torture_driver_context);
+       struct torture_driver_context *d;
+
+       d = talloc_zero(tctx, struct torture_driver_context);
 
+       d->info8.version                = SPOOLSS_DRIVER_VERSION_200X;
+       d->info8.driver_name            = TORTURE_DRIVER_EX;
+       d->info8.architecture           = NULL;
+       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->info8.driver_name            = TORTURE_DRIVER_EX;
        d->ex                           = true;
 
        return test_add_driver_arg(tctx, p, d);
 }
 
 static bool test_add_driver_64(struct torture_context *tctx,
-                              struct dcerpc_pipe *p,
-                              void *private_data)
+                              struct dcerpc_pipe *p)
 {
-       struct torture_driver_context *d =
-               (struct torture_driver_context *)talloc_get_type_abort(private_data, struct torture_driver_context);
+       struct torture_driver_context *d;
+
+       d = talloc_zero(tctx, struct torture_driver_context);
 
+       d->info8.version                = SPOOLSS_DRIVER_VERSION_200X;
+       d->info8.driver_name            = TORTURE_DRIVER;
+       d->info8.architecture           = NULL;
+       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 x64");
        d->local.driver_directory       = talloc_strdup(d, "/usr/share/cups/drivers/x64");
-       d->info8.driver_name            = TORTURE_DRIVER;
        d->ex                           = false;
 
        return test_add_driver_arg(tctx, p, d);
 }
 
 static bool test_add_driver_32(struct torture_context *tctx,
-                              struct dcerpc_pipe *p,
-                              void *private_data)
+                              struct dcerpc_pipe *p)
 {
-       struct torture_driver_context *d =
-               (struct torture_driver_context *)talloc_get_type_abort(private_data, struct torture_driver_context);
+       struct torture_driver_context *d;
+
+       d = talloc_zero(tctx, struct torture_driver_context);
 
+       d->info8.version                = SPOOLSS_DRIVER_VERSION_200X;
+       d->info8.driver_name            = TORTURE_DRIVER;
+       d->info8.architecture           = NULL;
+       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->info8.driver_name            = TORTURE_DRIVER;
+       d->ex                           = false;
+
+       return test_add_driver_arg(tctx, p, d);
+}
+
+static bool test_add_driver_adobe(struct torture_context *tctx,
+                                 struct dcerpc_pipe *p)
+{
+       struct torture_driver_context *d;
+
+       d = talloc_zero(tctx, struct torture_driver_context);
+
+       d->info8.version                = SPOOLSS_DRIVER_VERSION_9X;
+       d->info8.driver_name            = TORTURE_DRIVER_ADOBE;
+       d->info8.architecture           = NULL;
+       d->info8.driver_path            = talloc_strdup(d, "ADOBEPS4.DRV");
+       d->info8.data_file              = talloc_strdup(d, "DEFPRTR2.PPD");
+       d->info8.config_file            = talloc_strdup(d, "ADOBEPS4.DRV");
+#if 0
+       d->info8.help_file              = talloc_strdup(d, "ADOBEPS4.HLP");
+       d->info8.monitor_name           = talloc_strdup(d, "PSMON.DLL");
+#endif
+       d->local.environment            = talloc_strdup(d, "Windows 4.0");
+       d->local.driver_directory       = talloc_strdup(d, "/usr/share/cups/drivers/adobe/");
+       d->ex                           = false;
+
+       return test_add_driver_arg(tctx, p, d);
+}
+
+static bool test_add_driver_adobe_cupsaddsmb(struct torture_context *tctx,
+                                            struct dcerpc_pipe *p)
+{
+       struct torture_driver_context *d;
+       struct spoolss_StringArray *a;
+
+       if (!torture_setting_bool(tctx, "samba3", false)) {
+               torture_skip(tctx, "skipping cupsaddsmb test which only works against samba3");
+       }
+
+       d = talloc_zero(tctx, struct torture_driver_context);
+
+       d->info8.version                = SPOOLSS_DRIVER_VERSION_9X;
+       d->info8.driver_name            = TORTURE_DRIVER_ADOBE_CUPSADDSMB;
+       d->info8.architecture           = NULL;
+       d->info8.driver_path            = talloc_strdup(d, "ADOBEPS4.DRV");
+       d->info8.data_file              = talloc_strdup(d, "DEFPRTR2.PPD");
+       d->info8.config_file            = NULL;
+       d->info8.help_file              = talloc_strdup(d, "ADOBEPS4.HLP");
+       d->info8.monitor_name           = talloc_strdup(d, "PSMON.DLL");
+       d->info8.default_datatype       = talloc_strdup(d, "RAW");
+
+       a                               = talloc_zero(d, struct spoolss_StringArray);
+       a->string                       = talloc_zero_array(a, const char *, 7);
+       a->string[0]                    = talloc_strdup(a->string, "ADOBEPS4.DRV");
+       a->string[1]                    = talloc_strdup(a->string, "DEFPRTR2.PPD");
+       a->string[2]                    = talloc_strdup(a->string, "ADOBEPS4.HLP");
+       a->string[3]                    = talloc_strdup(a->string, "PSMON.DLL");
+       a->string[4]                    = talloc_strdup(a->string, "ADFONTS.MFM");
+       a->string[5]                    = talloc_strdup(a->string, "ICONLIB.DLL");
+
+       d->info8.dependent_files        = a;
+       d->local.environment            = talloc_strdup(d, "Windows 4.0");
+       d->local.driver_directory       = talloc_strdup(d, "/usr/share/cups/drivers/adobe/");
        d->ex                           = false;
 
        return test_add_driver_arg(tctx, p, d);
@@ -8788,26 +9038,19 @@ static bool test_add_driver_32(struct torture_context *tctx,
 
 struct torture_suite *torture_rpc_spoolss_driver(TALLOC_CTX *mem_ctx)
 {
-       struct torture_suite *suite = torture_suite_create(mem_ctx, "SPOOLSS-DRIVER");
+       struct torture_suite *suite = torture_suite_create(mem_ctx, "spoolss.driver");
 
        struct torture_rpc_tcase *tcase = torture_suite_add_rpc_iface_tcase(suite,
                                                        "driver", &ndr_table_spoolss);
-       struct torture_driver_context *t;
-
-       t = talloc_zero(mem_ctx, struct torture_driver_context);
+       torture_rpc_tcase_add_test(tcase, "add_driver_64", test_add_driver_64);
+       torture_rpc_tcase_add_test(tcase, "add_driver_ex_64", test_add_driver_ex_64);
 
-       t->info8.version        = SPOOLSS_DRIVER_VERSION_200X;
-       t->info8.driver_name    = NULL;
-       t->info8.architecture   = NULL;
-       t->info8.driver_path    = talloc_strdup(t, "pscript5.dll");
-       t->info8.data_file      = talloc_strdup(t, "cups6.ppd");
-       t->info8.config_file    = talloc_strdup(t, "cupsui6.dll");
+       torture_rpc_tcase_add_test(tcase, "add_driver_32", test_add_driver_32);
+       torture_rpc_tcase_add_test(tcase, "add_driver_ex_32", test_add_driver_ex_32);
 
-       torture_rpc_tcase_add_test_ex(tcase, "add_driver_64", test_add_driver_64, t);
-       torture_rpc_tcase_add_test_ex(tcase, "add_driver_ex_64", test_add_driver_ex_64, t);
+       torture_rpc_tcase_add_test(tcase, "add_driver_adobe", test_add_driver_adobe);
 
-       torture_rpc_tcase_add_test_ex(tcase, "add_driver_32", test_add_driver_32, t);
-       torture_rpc_tcase_add_test_ex(tcase, "add_driver_ex_32", test_add_driver_ex_32, t);
+       torture_rpc_tcase_add_test(tcase, "add_driver_adobe_cupsaddsmb", test_add_driver_adobe_cupsaddsmb);
 
        return suite;
 }