summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorJustin Stephenson <jstephen@redhat.com>2018-11-20 11:25:49 -0500
committerBjoern Jacke <bjacke@samba.org>2019-01-28 19:34:41 +0100
commit232273bfac3e65e69c4b9f4527f93cdfe4724f6b (patch)
tree638677bd4b6af623dbb318ab1041ad3211550105 /source4/torture
parent669b135b49db0bb7e89dfe44073ae9dd70500f97 (diff)
downloadsamba-232273bfac3e65e69c4b9f4527f93cdfe4724f6b.tar.gz
s4:torture: Enforce Printer Class
Ensure that the provided inf defines Class=Printer for driver installation to succeed. Some driver packages(HP Universal Print Driver) include inf files with other device types such as Class=USB. Attempting to install these will fail when tested against Windows Server 2016 Print server using iremotewinspool RPC calls. Signed-off-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Bjoern Jacke <bjacke@samba.org> Autobuild-User(master): Björn Jacke <bjacke@samba.org> Autobuild-Date(master): Mon Jan 28 19:34:41 CET 2019 on sn-devel-144
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/iremotewinspool_driver.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source4/torture/rpc/iremotewinspool_driver.c b/source4/torture/rpc/iremotewinspool_driver.c
index 0045818e7ff..8090076f1ca 100644
--- a/source4/torture/rpc/iremotewinspool_driver.c
+++ b/source4/torture/rpc/iremotewinspool_driver.c
@@ -564,6 +564,13 @@ static bool test_init_driver_info(struct torture_context *tctx,
drv_info->core_driver_inf, &drv_info->info);
torture_assert_goto(tctx, ok, ok, done, "Failed to parse inf driver");
+ /* Ensure that we are trying to install the correct device class:
+ * https://docs.microsoft.com/en-us/windows-hardware/drivers/install/system-defined-device-setup-classes-available-to-vendors
+ */
+ if (!(drv_info->info->printer_driver_attributes & PRINTER_DRIVER_CLASS)) {
+ ok = false;
+ torture_fail_goto(tctx, done, "Inf file Class value must be Printer");
+ }
done:
return ok;