FBryant87
FBryant87

Reputation: 4605

Chef - Assert registry key exists

After Chef spins up my Windows box, I use the following Inspec test to assert a registry key exists:

describe registry_key('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Client') do
    it { should exist }
end

The test fails with "expected Registry Key to exist"

When I log onto the box I can clearly see the key does exist in that location. What could be the problem? Do I need to wait for a period of time after everything is up and running before performing the check?

Upvotes: 0

Views: 511

Answers (1)

Brandon Miller
Brandon Miller

Reputation: 5065

InSpec code is still Ruby. Try cancelling the backslashes.

describe registry_key('HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\SSL 2.0\\Client') do
  it { should exist }
end

Upvotes: 0

Related Questions