diff options
author | Günther Deschner <gd@samba.org> | 2010-12-23 23:50:23 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2011-01-04 10:33:52 +0100 |
commit | 9c46370e915d8b32f0307eb0a491aeacd2b617b9 (patch) | |
tree | 657422543f612f24573296ccb89e356a843ea546 /source4 | |
parent | b79c0e1adbe8ad591157d92b36106484c2c18313 (diff) | |
download | samba-9c46370e915d8b32f0307eb0a491aeacd2b617b9.tar.gz samba-9c46370e915d8b32f0307eb0a491aeacd2b617b9.tar.bz2 samba-9c46370e915d8b32f0307eb0a491aeacd2b617b9.zip |
s4-smbtorture: add more tests for driver_dates.
Guenther
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/rpc/spoolss.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 6ff2414397..49eb27d83f 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" @@ -9215,6 +9216,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 +9268,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; } |