Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
None
-
Phoenix
-
1
-
Phoenix 2022-03-16
-
Needs Assessment
-
47102
-
1
-
Bug Fix
-
Fixes a bug that prevented pdk unit tests from working when trying to test a resource with a Windows provider, such as "service" resources.
-
Needs Assessment
Description
The file lib/puppet/util/windows.rb defines a set of constants that should be available on all platforms, such as Puppet::Util::Windows, Puppet::Util::Windows::Service and Puppet::Util::Windows::Service::DEFAULT_TIMEOUT.
It also requires Windows-specific code that is only safe to load on Windows, because the code tries to load native libraries, such as user32.dll.
The problem is when puppet is running on a non-Windows platform, then lib/puppet/util/windows.rb is never loaded. As a result, trying to test a service resource using rspec-puppet fails when trying to reference the Puppet::Util::Windows constant. See PDK-1760 for steps to reproduce.
A quicker reproduction is:
$ bundle exec ruby -e "require 'puppet'; puts Puppet::Util::Windows"
|
Traceback (most recent call last):
|
-e:1:in `<main>': uninitialized constant Puppet::Util::Windows (NameError)
|
Attachments
Issue Links
- blocks
-
PDK-1760 Puppet versions bundled with PDK 2.3.0 fail basic module unit tests for Windows
-
- Open
-