summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-12-07 19:26:45 +0100
committerGünther Deschner <gd@samba.org>2009-12-08 11:51:09 +0100
commit5e8e5dfe889a63747ffbd9429d8115e1715f53e6 (patch)
treefdff58ddf6b29a3ac8289d73f3ae7ac94dbf0d8c /source4/torture/rpc
parent7770d1492bad12e778f9f4e0503dcf00983b2bb1 (diff)
downloadsamba-5e8e5dfe889a63747ffbd9429d8115e1715f53e6.tar.gz
samba-5e8e5dfe889a63747ffbd9429d8115e1715f53e6.tar.bz2
samba-5e8e5dfe889a63747ffbd9429d8115e1715f53e6.zip
s4-smbtorture: make level 8 the reference for PrinterDriverEnum test.
Guenther
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/spoolss.c115
1 files changed, 73 insertions, 42 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index 1a2c6ddea4..1b3f8d19aa 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -42,8 +42,8 @@ struct test_spoolss_context {
union spoolss_PortInfo *ports[3];
/* for EnumPrinterDrivers */
- uint32_t driver_count[7];
- union spoolss_DriverInfo *drivers[7];
+ uint32_t driver_count[8];
+ union spoolss_DriverInfo *drivers[8];
/* for EnumMonitors */
uint32_t monitor_count[3];
@@ -80,6 +80,17 @@ struct test_spoolss_context {
torture_assert_int_equal(tctx, c.e, r.e, "invalid value"); \
} while(0)
+#define COMPARE_UINT64(tctx, c, r, e) do {\
+ _CHECK_FIELD_SIZE(c, r, e, uint64_t); \
+ torture_assert_int_equal(tctx, c.e, r.e, "invalid value"); \
+} while(0)
+
+
+#define COMPARE_NTTIME(tctx, c, r, e) do {\
+ _CHECK_FIELD_SIZE(c, r, e, NTTIME); \
+ torture_assert_int_equal(tctx, c.e, r.e, "invalid value"); \
+} while(0)
+
#define COMPARE_STRING_ARRAY(tctx, c,r,e) do {\
int __i; \
if (!c.e && !r.e) { \
@@ -328,7 +339,7 @@ static bool test_EnumPrinterDrivers(struct torture_context *tctx,
{
NTSTATUS status;
struct spoolss_EnumPrinterDrivers r;
- uint16_t levels[] = { 1, 2, 3, 4, 5, 6 };
+ uint16_t levels[] = { 1, 2, 3, 4, 5, 6, 8 };
int i, j;
for (i=0;i<ARRAY_SIZE(levels);i++) {
@@ -389,57 +400,77 @@ static bool test_EnumPrinterDrivers(struct torture_context *tctx,
for (j=0;j<ctx->driver_count[level];j++) {
union spoolss_DriverInfo *cur = &ctx->drivers[level][j];
- union spoolss_DriverInfo *ref = &ctx->drivers[6][j];
+ union spoolss_DriverInfo *ref = &ctx->drivers[8][j];
+
switch (level) {
case 1:
- COMPARE_STRING(tctx, cur->info1, ref->info6, driver_name);
+ COMPARE_STRING(tctx, cur->info1, ref->info8, driver_name);
break;
case 2:
- COMPARE_UINT32(tctx, cur->info2, ref->info6, version);
- COMPARE_STRING(tctx, cur->info2, ref->info6, driver_name);
- COMPARE_STRING(tctx, cur->info2, ref->info6, architecture);
- COMPARE_STRING(tctx, cur->info2, ref->info6, driver_path);
- COMPARE_STRING(tctx, cur->info2, ref->info6, data_file);
- COMPARE_STRING(tctx, cur->info2, ref->info6, config_file);
+ COMPARE_UINT32(tctx, cur->info2, ref->info8, version);
+ COMPARE_STRING(tctx, cur->info2, ref->info8, driver_name);
+ COMPARE_STRING(tctx, cur->info2, ref->info8, architecture);
+ COMPARE_STRING(tctx, cur->info2, ref->info8, driver_path);
+ COMPARE_STRING(tctx, cur->info2, ref->info8, data_file);
+ COMPARE_STRING(tctx, cur->info2, ref->info8, config_file);
break;
case 3:
- COMPARE_UINT32(tctx, cur->info3, ref->info6, version);
- COMPARE_STRING(tctx, cur->info3, ref->info6, driver_name);
- COMPARE_STRING(tctx, cur->info3, ref->info6, architecture);
- COMPARE_STRING(tctx, cur->info3, ref->info6, driver_path);
- COMPARE_STRING(tctx, cur->info3, ref->info6, data_file);
- COMPARE_STRING(tctx, cur->info3, ref->info6, config_file);
- COMPARE_STRING(tctx, cur->info3, ref->info6, help_file);
- COMPARE_STRING_ARRAY(tctx, cur->info3, ref->info6, dependent_files);
- COMPARE_STRING(tctx, cur->info3, ref->info6, monitor_name);
- COMPARE_STRING(tctx, cur->info3, ref->info6, default_datatype);
+ COMPARE_UINT32(tctx, cur->info3, ref->info8, version);
+ COMPARE_STRING(tctx, cur->info3, ref->info8, driver_name);
+ COMPARE_STRING(tctx, cur->info3, ref->info8, architecture);
+ COMPARE_STRING(tctx, cur->info3, ref->info8, driver_path);
+ COMPARE_STRING(tctx, cur->info3, ref->info8, data_file);
+ COMPARE_STRING(tctx, cur->info3, ref->info8, config_file);
+ COMPARE_STRING(tctx, cur->info3, ref->info8, help_file);
+ COMPARE_STRING_ARRAY(tctx, cur->info3, ref->info8, dependent_files);
+ COMPARE_STRING(tctx, cur->info3, ref->info8, monitor_name);
+ COMPARE_STRING(tctx, cur->info3, ref->info8, default_datatype);
break;
case 4:
- COMPARE_UINT32(tctx, cur->info4, ref->info6, version);
- COMPARE_STRING(tctx, cur->info4, ref->info6, driver_name);
- COMPARE_STRING(tctx, cur->info4, ref->info6, architecture);
- COMPARE_STRING(tctx, cur->info4, ref->info6, driver_path);
- COMPARE_STRING(tctx, cur->info4, ref->info6, data_file);
- COMPARE_STRING(tctx, cur->info4, ref->info6, config_file);
- COMPARE_STRING(tctx, cur->info4, ref->info6, help_file);
- COMPARE_STRING_ARRAY(tctx, cur->info4, ref->info6, dependent_files);
- COMPARE_STRING(tctx, cur->info4, ref->info6, monitor_name);
- COMPARE_STRING(tctx, cur->info4, ref->info6, default_datatype);
- COMPARE_STRING_ARRAY(tctx, cur->info4, ref->info6, previous_names);
+ COMPARE_UINT32(tctx, cur->info4, ref->info8, version);
+ COMPARE_STRING(tctx, cur->info4, ref->info8, driver_name);
+ COMPARE_STRING(tctx, cur->info4, ref->info8, architecture);
+ COMPARE_STRING(tctx, cur->info4, ref->info8, driver_path);
+ COMPARE_STRING(tctx, cur->info4, ref->info8, data_file);
+ COMPARE_STRING(tctx, cur->info4, ref->info8, config_file);
+ COMPARE_STRING(tctx, cur->info4, ref->info8, help_file);
+ COMPARE_STRING_ARRAY(tctx, cur->info4, ref->info8, dependent_files);
+ COMPARE_STRING(tctx, cur->info4, ref->info8, monitor_name);
+ COMPARE_STRING(tctx, cur->info4, ref->info8, default_datatype);
+ COMPARE_STRING_ARRAY(tctx, cur->info4, ref->info8, previous_names);
break;
case 5:
- COMPARE_UINT32(tctx, cur->info5, ref->info6, version);
- COMPARE_STRING(tctx, cur->info5, ref->info6, driver_name);
- COMPARE_STRING(tctx, cur->info5, ref->info6, architecture);
- COMPARE_STRING(tctx, cur->info5, ref->info6, driver_path);
- COMPARE_STRING(tctx, cur->info5, ref->info6, data_file);
- COMPARE_STRING(tctx, cur->info5, ref->info6, config_file);
- /*COMPARE_UINT32(tctx, cur->info5, ref->info6, driver_attributes);*/
- /*COMPARE_UINT32(tctx, cur->info5, ref->info6, config_version);*/
- /*TODO: ! COMPARE_UINT32(tctx, cur->info5, ref->info6, driver_version); */
+ COMPARE_UINT32(tctx, cur->info5, ref->info8, version);
+ COMPARE_STRING(tctx, cur->info5, ref->info8, driver_name);
+ COMPARE_STRING(tctx, cur->info5, ref->info8, architecture);
+ COMPARE_STRING(tctx, cur->info5, ref->info8, driver_path);
+ COMPARE_STRING(tctx, cur->info5, ref->info8, data_file);
+ COMPARE_STRING(tctx, cur->info5, ref->info8, config_file);
+ /*COMPARE_UINT32(tctx, cur->info5, ref->info8, driver_attributes);*/
+ /*COMPARE_UINT32(tctx, cur->info5, ref->info8, config_version);*/
+ /*TODO: ! COMPARE_UINT32(tctx, cur->info5, ref->info8, driver_version); */
break;
case 6:
- /* level 6 is our reference, and it makes no sense to compare it to itself */
+ COMPARE_UINT32(tctx, cur->info6, ref->info8, version);
+ COMPARE_STRING(tctx, cur->info6, ref->info8, driver_name);
+ COMPARE_STRING(tctx, cur->info6, ref->info8, architecture);
+ COMPARE_STRING(tctx, cur->info6, ref->info8, driver_path);
+ COMPARE_STRING(tctx, cur->info6, ref->info8, data_file);
+ COMPARE_STRING(tctx, cur->info6, ref->info8, config_file);
+ COMPARE_STRING(tctx, cur->info6, ref->info8, help_file);
+ COMPARE_STRING_ARRAY(tctx, cur->info6, ref->info8, dependent_files);
+ COMPARE_STRING(tctx, cur->info6, ref->info8, monitor_name);
+ COMPARE_STRING(tctx, cur->info6, ref->info8, default_datatype);
+ COMPARE_STRING_ARRAY(tctx, cur->info6, ref->info8, previous_names);
+ COMPARE_NTTIME(tctx, cur->info6, ref->info8, driver_date);
+ COMPARE_UINT64(tctx, cur->info6, ref->info8, driver_version);
+ COMPARE_STRING(tctx, cur->info6, ref->info8, manufacturer_name);
+ COMPARE_STRING(tctx, cur->info6, ref->info8, manufacturer_url);
+ COMPARE_STRING(tctx, cur->info6, ref->info8, hardware_id);
+ COMPARE_STRING(tctx, cur->info6, ref->info8, provider);
+ break;
+ case 8:
+ /* level 8 is our reference, and it makes no sense to compare it to itself */
break;
}
}