mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
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
This commit is contained in:
parent
669b135b49
commit
232273bfac
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user