The branch, v3-6-test has been updated via 4a40f71 s4-smbtorture: check driver_version equality as well. via 76f607a s4-smbtorture: always setup full driver level 8 in test_add_driver_arg(). via 59f5df9 s4-smbtorture: in test_GetDriverInfo_winreg() always test level 6 for samba3 as well. via 860d37e s4-smbtorture: setup help and dependent files in spoolss driver unc path tests. via d94eb8d s4-smbtorture: fix DriverDate and DriverVersion comparison checks against w2k3. via 7ccebe3 s4-smbtorture: add more tests for driver_dates. from 517aa77 s3: Fix some nonempty blank lines
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test - Log ----------------------------------------------------------------- commit 4a40f716268b3738eebe7d824ebf79a9b246746f Author: Günther Deschner <g...@samba.org> Date: Fri Dec 24 01:55:08 2010 +0100 s4-smbtorture: check driver_version equality as well. Guenther Autobuild-User: Günther Deschner <g...@samba.org> Autobuild-Date: Tue Jan 4 11:22:09 CET 2011 on sn-devel-104 (cherry picked from commit 0279422c83e42a6c903e82a069a5236dd01a0f21) commit 76f607afd2a5cf2179704081798f23c8c9f91a19 Author: Günther Deschner <g...@samba.org> Date: Fri Dec 24 01:25:49 2010 +0100 s4-smbtorture: always setup full driver level 8 in test_add_driver_arg(). Guenther (cherry picked from commit 64576106b10b8cde8970d82301fba66c0ee1995e) commit 59f5df9dcb02aa631881ea5d9206ee2bb445fb77 Author: Günther Deschner <g...@samba.org> Date: Fri Dec 24 01:25:04 2010 +0100 s4-smbtorture: in test_GetDriverInfo_winreg() always test level 6 for samba3 as well. Guenther (cherry picked from commit 69174fea5b2c580356693d33b2ab980a44a34259) commit 860d37e5d00ba4ef24bfff7dcdd8b6c3db13bc97 Author: Günther Deschner <g...@samba.org> Date: Fri Dec 24 01:22:24 2010 +0100 s4-smbtorture: setup help and dependent files in spoolss driver unc path tests. Guenther (cherry picked from commit 19a295dee8b9b9b9844c564fb5b856c7268f650a) commit d94eb8dfb846214fc8b91367ebb58bd46fe41d95 Author: Günther Deschner <g...@samba.org> Date: Fri Dec 24 01:14:49 2010 +0100 s4-smbtorture: fix DriverDate and DriverVersion comparison checks against w2k3. Guenther (cherry picked from commit 8fc28818b974042712b5c11776de0562755ed59d) commit 7ccebe3dcf8eed90087d7fdc1da97c5d7793c82b Author: Günther Deschner <g...@samba.org> Date: Thu Dec 23 23:50:23 2010 +0100 s4-smbtorture: add more tests for driver_dates. Guenther (cherry picked from commit 9c46370e915d8b32f0307eb0a491aeacd2b617b9) ----------------------------------------------------------------------- Summary of changes: source4/torture/rpc/spoolss.c | 79 ++++++++++++++++++++++++++++++++++------- 1 files changed, 66 insertions(+), 13 deletions(-) Changeset truncated at 500 lines: diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 6ff2414..2dd7164 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -48,6 +48,7 @@ #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 TORTURE_DRIVER_TIMESTAMPS "torture_driver_timestamps" #define TOP_LEVEL_PRINT_KEY "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print" #define TOP_LEVEL_PRINT_PRINTERS_KEY TOP_LEVEL_PRINT_KEY "\\Printers" @@ -4653,11 +4654,8 @@ static bool test_GetDriverInfo_winreg(struct torture_context *tctx, test_winreg_OpenKey(tctx, winreg_handle, hive_handle, driver_key, &key_handle), "failed to open driver key"); - if (torture_setting_bool(tctx, "samba3", false)) { - goto try_level3; - } - - if (torture_setting_bool(tctx, "w2k3", false)) { + if (torture_setting_bool(tctx, "samba3", false) || + torture_setting_bool(tctx, "w2k3", false)) { goto try_level6; } @@ -4741,7 +4739,9 @@ static bool test_GetDriverInfo_winreg(struct torture_context *tctx, test_sz("Driver", driver_path); if (torture_setting_bool(tctx, "w2k3", false)) { DATA_BLOB blob = data_blob_talloc_zero(tctx, 8); + push_nttime(blob.data, 0, info.info6.driver_date); test_binary("DriverDate", blob); + SBVAL(blob.data, 0, info.info6.driver_version); test_binary("DriverVersion", blob); } else { test_sz("DriverDate", driver_date); @@ -4759,8 +4759,6 @@ static bool test_GetDriverInfo_winreg(struct torture_context *tctx, test_dword("Version", info.info6.version); /* test_dword("TempDir", ?); */ - try_level3: - if (handle) { torture_assert(tctx, test_GetPrinterDriver2_level(tctx, b, handle, driver_name, environment, 3, version, 0, &info, &result), @@ -8452,6 +8450,7 @@ static bool test_AddPrinterDriver_args_level_6(struct torture_context *tctx, } torture_assert_nttime_equal(tctx, info.info6.driver_date, info6.driver_date, "driverdate mismatch"); + torture_assert_u64_equal(tctx, info.info6.driver_version, info6.driver_version, "driverversion mismatch"); return true; } @@ -8502,6 +8501,7 @@ static bool test_AddPrinterDriver_args_level_8(struct torture_context *tctx, } torture_assert_nttime_equal(tctx, info.info8.driver_date, r->driver_date, "driverdate mismatch"); + torture_assert_u64_equal(tctx, info.info8.driver_version, r->driver_version, "driverversion mismatch"); return true; } @@ -8990,12 +8990,19 @@ static bool test_add_driver_arg(struct torture_context *tctx, upload_printer_driver(tctx, dcerpc_server_name(p), d), "failed to upload printer driver"); - info8.version = d->info8.version; - info8.driver_name = d->info8.driver_name; - info8.architecture = d->local.environment; - info8.driver_path = d->info8.driver_path; - info8.data_file = d->info8.data_file; - info8.config_file = d->info8.config_file; + info8 = d->info8; + if (d->info8.dependent_files) { + info8.dependent_files = talloc_zero(tctx, struct spoolss_StringArray); + if (d->info8.dependent_files->string) { + for (i=0; d->info8.dependent_files->string[i] != NULL; i++) { + } + info8.dependent_files->string = talloc_zero_array(info8.dependent_files, const char *, i+1); + for (i=0; d->info8.dependent_files->string[i] != NULL; i++) { + info8.dependent_files->string[i] = talloc_strdup(info8.dependent_files->string, d->info8.dependent_files->string[i]); + } + } + } + info8.architecture = d->local.environment; for (i=0; i < ARRAY_SIZE(levels); i++) { @@ -9032,6 +9039,14 @@ static bool test_add_driver_arg(struct torture_context *tctx, if (d->info8.config_file) { info8.config_file = talloc_asprintf(tctx, "%s\\%s", d->remote.driver_directory, d->info8.config_file); } + if (d->info8.help_file) { + info8.help_file = talloc_asprintf(tctx, "%s\\%s", d->remote.driver_directory, d->info8.help_file); + } + if (d->info8.dependent_files && d->info8.dependent_files->string) { + for (i=0; d->info8.dependent_files->string[i] != NULL; i++) { + info8.dependent_files->string[i] = talloc_asprintf(tctx, "%s\\%s", d->remote.driver_directory, d->info8.dependent_files->string[i]); + } + } for (i=0; i < ARRAY_SIZE(levels); i++) { @@ -9215,6 +9230,42 @@ static bool test_add_driver_adobe_cupsaddsmb(struct torture_context *tctx, return test_add_driver_arg(tctx, p, d); } +static bool test_add_driver_timestamps(struct torture_context *tctx, + struct dcerpc_pipe *p) +{ + 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; + d->info8.driver_name = TORTURE_DRIVER_TIMESTAMPS; + 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->info8.driver_date = timeval_to_nttime(&t); + 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, + test_add_driver_arg(tctx, p, d), + ""); + + unix_to_nt_time(&d->info8.driver_date, 1); + + torture_assert(tctx, + test_add_driver_arg(tctx, p, d), + ""); + + return true; +} + struct torture_suite *torture_rpc_spoolss_driver(TALLOC_CTX *mem_ctx) { struct torture_suite *suite = torture_suite_create(mem_ctx, "spoolss.driver"); @@ -9231,5 +9282,7 @@ struct torture_suite *torture_rpc_spoolss_driver(TALLOC_CTX *mem_ctx) torture_rpc_tcase_add_test(tcase, "add_driver_adobe_cupsaddsmb", test_add_driver_adobe_cupsaddsmb); + torture_rpc_tcase_add_test(tcase, "add_driver_timestamps", test_add_driver_timestamps); + return suite; } -- Samba Shared Repository