Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

registry_key test failing on Windows 2008 R2 #767

Closed
jdgoins opened this issue May 24, 2016 · 2 comments
Closed

registry_key test failing on Windows 2008 R2 #767

jdgoins opened this issue May 24, 2016 · 2 comments

Comments

@jdgoins
Copy link

jdgoins commented May 24, 2016

Description

The registry_key test is not finding the key in Windows Server 2008 R2. It is returning nil when searching for any key.

InSpec and Platform Version

Running using Git Bash on Windows 7. Tests running on Windows Server 2008 R2 local VM.

$ chef gem list inspec

*** LOCAL GEMS ***

debug_inspector (0.0.2)
inspec (0.22.1)
kitchen-inspec (0.13.0, 0.12.3)

Replication Case

Example:

control 'autoplay_disabled' do
  impact 0.3
  title 'Autoplay/Autorun Disabled'
  desc 'Ensures autorun and autoplay are disabled.'
  describe registry_key('HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\Explorer') do
    its('NoDriveTypeAutoRun') { should eq 1 }
  end
end

Stacktrace

 20) Registry Key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\Explorer No
DriveTypeAutoRun should eq 1
      Failure/Error: DEFAULT_FAILURE_NOTIFIER = lambda { |failure, _opts| raise failure }

        expected: 1
             got: nil

        (compared using ==)
      # ./test/integration/default/config_spec.rb:191:in `block (3 levels) in load'
      # C:/Users/jamgoins/.chefdk/gem/ruby/2.1.0/gems/inspec-0.22.1/lib/inspec/runner_rspec.rb:66:in
 `run'
      # C:/Users/jamgoins/.chefdk/gem/ruby/2.1.0/gems/kitchen-inspec-0.13.0/lib/kitchen/verifier/ins
pec.rb:50:in `call'
      # C:/Users/jamgoins/.chefdk/gem/ruby/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/instance.rb:423
:in `block in verify_action'
      # C:/Users/jamgoins/.chefdk/gem/ruby/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/instance.rb:513
:in `call'
      # C:/Users/jamgoins/.chefdk/gem/ruby/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/instance.rb:513
:in `synchronize_or_call'
      # C:/Users/jamgoins/.chefdk/gem/ruby/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/instance.rb:478
:in `block in action'
      # C:/Users/jamgoins/.chefdk/gem/ruby/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/instance.rb:477
:in `action'
      # C:/Users/jamgoins/.chefdk/gem/ruby/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/instance.rb:415
:in `verify_action'
      # C:/Users/jamgoins/.chefdk/gem/ruby/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/instance.rb:348
:in `block in transition_to'
      # C:/Users/jamgoins/.chefdk/gem/ruby/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/instance.rb:347
:in `each'
      # C:/Users/jamgoins/.chefdk/gem/ruby/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/instance.rb:347
:in `transition_to'
      # C:/Users/jamgoins/.chefdk/gem/ruby/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/instance.rb:160
:in `verify'
      # C:/Users/jamgoins/.chefdk/gem/ruby/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/command.rb:176:
in `public_send'
      # C:/Users/jamgoins/.chefdk/gem/ruby/2.1.0/gems/test-kitchen-1.8.0/lib/kitchen/command.rb:176:
in `block (2 levels) in run_action'

@chris-rock
Copy link
Contributor

@jdgoins Thanks for reporting that issue. Could you verify which version of Powershell you are using? Windows 2008 requires Windows Management Framework 5.0
https://www.microsoft.com/en-us/download/details.aspx?id=50395

@jdgoins
Copy link
Author

jdgoins commented May 24, 2016

@chris-rock That resolved my issue. Thank you!

@jdgoins jdgoins closed this as completed May 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants