From 04f2d2e4e97463a8aeab3ba5197d5d9efbfabf0f Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Fri, 22 Jun 2012 18:49:50 +0200 Subject: [PATCH] s3-torture: Use static printer for smbd spooler test --- source4/torture/rpc/spoolss.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index a724aeeae16..fd065fc6183 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -54,6 +54,7 @@ #define TORTURE_DRIVER_TIMESTAMPS "torture_driver_timestamps" #define TORTURE_DRIVER_DELETER "torture_driver_deleter" #define TORTURE_DRIVER_DELETERIN "torture_driver_deleterin" +#define TORTURE_PRINTER_STATIC1 "print1" #define TOP_LEVEL_PRINT_KEY "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print" #define TOP_LEVEL_PRINT_PRINTERS_KEY TOP_LEVEL_PRINT_KEY "\\Printers" @@ -7747,7 +7748,14 @@ static bool test_print_test_smbd(struct torture_context *tctx, struct cli_credentials *credentials = cmdline_credentials; struct smbcli_options options; TALLOC_CTX *mem_ctx = talloc_new(tctx); - const char *share = t->info2.printername; + /* + * Do not test against the dynamically added printers, printing via + * smbd means that a different spoolss process may handle the + * OpenPrinter request to the one that handled the AddPrinter request. + * This currently leads to an ugly race condition where one process + * sees the new printer and one doesn't. + */ + const char *share = TORTURE_PRINTER_STATIC1; torture_comment(tctx, "Testing smbd job spooling\n"); lpcfg_smbcli_options(tctx->lp_ctx, &options); -- 2.34.1