From 340d2df123813196247d3b1aff38048cfe93c1ec Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 20 Dec 2010 16:02:02 +0100 Subject: s4-smbtorture: interesting, DriverDate and DriverVersion are different in w2k3 and w2k8r2. While in w2k8 they are REG_SZ date or numerical strings, they are 8 byte REG_BINARY blobs in w2k3. Guenther --- source4/torture/rpc/spoolss.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'source4/torture') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 630694d01a..d7d1df1187 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -4369,6 +4369,23 @@ do {\ talloc_asprintf(tctx, "%s - %s mismatch", #wname, #iname));\ } while(0); +#define test_binary(wname, iname) \ +do {\ + enum winreg_Type w_type;\ + uint32_t w_size;\ + uint32_t w_length;\ + uint8_t *w_data;\ + torture_assert(tctx,\ + test_winreg_QueryValue(tctx, winreg_handle, &key_handle, wname,\ + &w_type, &w_size, &w_length, &w_data),\ + "failed to query winreg");\ + torture_assert_int_equal(tctx, w_type, REG_BINARY, "unexpected type");\ + torture_assert_int_equal(tctx, w_size, iname.length, "unexpected length");\ + torture_assert_mem_equal(tctx, w_data, iname.data, w_size, \ + "binary unequal");\ +} while(0); + + #define test_dm(wname, iname) \ do {\ DATA_BLOB blob;\ @@ -4717,8 +4734,14 @@ static bool test_GetDriverInfo_winreg(struct torture_context *tctx, test_sz("Data File", data_file); test_sz("Datatype", info.info6.default_datatype); test_sz("Driver", driver_path); - test_sz("DriverDate", driver_date); - test_sz("DriverVersion", driver_version); + if (torture_setting_bool(tctx, "w2k3", false)) { + DATA_BLOB blob = data_blob_talloc_zero(tctx, 8); + test_binary("DriverDate", blob); + test_binary("DriverVersion", blob); + } else { + test_sz("DriverDate", driver_date); + test_sz("DriverVersion", driver_version); + } test_sz("HardwareID", info.info6.hardware_id); test_sz("Help File", help_file); test_sz("Manufacturer", info.info6.manufacturer_name); -- cgit