From 4e9d67b7c0a6fb3de56a0703ba1479360364071c Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 16 Dec 2010 16:06:02 +0100 Subject: s4-smbtorture: allow to call test_GetDriverInfo_winreg without printer handle. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guenther Autobuild-User: Günther Deschner Autobuild-Date: Fri Dec 17 17:35:21 CET 2010 on sn-devel-104 --- source4/torture/rpc/spoolss.c | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) (limited to 'source4') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 3006d3ff04..114b3e1493 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -4599,7 +4599,8 @@ static bool test_GetDriverInfo_winreg(struct torture_context *tctx, const char *environment, enum spoolss_DriverOSVersion version, struct dcerpc_binding_handle *winreg_handle, - struct policy_handle *hive_handle) + struct policy_handle *hive_handle, + const char *server_name_slash) { WERROR result; union spoolss_DriverInfo info; @@ -4638,9 +4639,15 @@ static bool test_GetDriverInfo_winreg(struct torture_context *tctx, goto try_level6; } - torture_assert(tctx, - test_GetPrinterDriver2_level(tctx, b, handle, driver_name, environment, 8, version, 0, &info, &result), - "failed to get driver info level 8"); + if (handle) { + torture_assert(tctx, + test_GetPrinterDriver2_level(tctx, b, handle, driver_name, environment, 8, version, 0, &info, &result), + "failed to get driver info level 8"); + } else { + torture_assert(tctx, + test_EnumPrinterDrivers_findone(tctx, b, server_name_slash, environment, 8, driver_name, &info), + "failed to get driver info level 8"); + } if (W_ERROR_EQUAL(result, WERR_INVALID_LEVEL)) { goto try_level6; @@ -4686,9 +4693,15 @@ static bool test_GetDriverInfo_winreg(struct torture_context *tctx, try_level6: - torture_assert(tctx, - test_GetPrinterDriver2_level(tctx, b, handle, driver_name, environment, 6, version, 0, &info, &result), - "failed to get driver info level 6"); + if (handle) { + torture_assert(tctx, + test_GetPrinterDriver2_level(tctx, b, handle, driver_name, environment, 6, version, 0, &info, &result), + "failed to get driver info level 6"); + } else { + torture_assert(tctx, + test_EnumPrinterDrivers_findone(tctx, b, server_name_slash, environment, 6, driver_name, &info), + "failed to get driver info level 6"); + } driver_path = strip_path(info.info6.driver_path); data_file = strip_path(info.info6.data_file); @@ -4720,9 +4733,15 @@ static bool test_GetDriverInfo_winreg(struct torture_context *tctx, try_level3: - torture_assert(tctx, - test_GetPrinterDriver2_level(tctx, b, handle, driver_name, environment, 3, version, 0, &info, &result), - "failed to get driver info level 3"); + if (handle) { + torture_assert(tctx, + test_GetPrinterDriver2_level(tctx, b, handle, driver_name, environment, 3, version, 0, &info, &result), + "failed to get driver info level 3"); + } else { + torture_assert(tctx, + test_EnumPrinterDrivers_findone(tctx, b, server_name_slash, environment, 3, driver_name, &info), + "failed to get driver info level 3"); + } driver_path = strip_path(info.info3.driver_path); data_file = strip_path(info.info3.data_file); @@ -5292,7 +5311,7 @@ static bool test_DriverInfo_winreg(struct torture_context *tctx, torture_assert(tctx, test_winreg_OpenHKLM(tctx, b2, &hive_handle), ""); - ret = test_GetDriverInfo_winreg(tctx, b, handle, printer_name, driver_name, environment, version, b2, &hive_handle); + ret = test_GetDriverInfo_winreg(tctx, b, handle, printer_name, driver_name, environment, version, b2, &hive_handle, NULL); test_winreg_CloseKey(tctx, b2, &hive_handle); -- cgit