Test Kitchen Windows 2012r2 Inspec Verifier Error

Sean Horn -

Problem
----------

winrm-s < 0.3.5 gem cannot handle Negotiate winrm connections with windows 2012r2 systems.

Solutions
-----------

If you experience an error like the following running Test Kitchen 1.5.0 or below with kitchen-inspec and winrm-s < 0.3.5 when trying to run the kitchen-inspec verifier against windows 2012r2 systems, please do one of two things

1. Upgrade your chefDK with `chef gem install winrm-s -v 0.3.5`. Then, `chef gem install winrm -v 1.7.2`

2. Uninstall chefDK 0.11.0 to make sure the default set of gems is present and reinstall with Test Kitchen 1.6.0 when it comes out and the latest kitchen-inspec. Test-kitchen 1.6.0 is expected in the next version of chefDK, > 0.11.x

Notice the following InSpec test failures below look like they have something to do with a failed attempt at starting a winrm session with a Windows system using an InSpec runner. They sure do!

 

PS D:\code\chef\cookbooks\contributors> kitchen verify 
-----> Starting Kitchen (v1.5.0)
C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.6.0.1/lib/httpclient/webagent-cookie.rb:458: warning: a
lready initialized constant HTTPClient::CookieManager
C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.6.0.1/lib/httpclient/cookie.rb:8: warning: previous def
inition of CookieManager was here
-----> Verifying <default-windows2012-r2>...
FF

Failures:

1) File C:\Users\azure\AppData\Local\Temp\kitchen\cache\contributors.txt content
Failure/Error:
{ "#{NS_ADDRESSING}:To" => "#{@xfer.endpoint.to_s}",
"#{NS_ADDRESSING}:ReplyTo" => {
"#{NS_ADDRESSING}:Address" => 'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous',
:attributes! => {"#{NS_ADDRESSING}:Address" => {'mustUnderstand' => true}}},
"#{NS_WSMAN_DMTF}:MaxEnvelopeSize" => @max_env_sz,
"#{NS_ADDRESSING}:MessageID" => "uuid:#{SecureRandom.uuid.to_s.upcase}",
"#{NS_WSMAN_DMTF}:Locale/" => '',
"#{NS_WSMAN_MSFT}:DataLocale/" => '',
"#{NS_WSMAN_DMTF}:OperationTimeout" => @timeout,
:attributes! => {
NoMethodError:
undefined method `endpoint' for nil:NilClass

# ./test/integration/default/contributors_spec.rb:6:in `block (2 levels) in load'

2) File C:\Users\azure\AppData\Local\Temp\kitchen\cache\contributors.txt content
Failure/Error:
{ "#{NS_ADDRESSING}:To" => "#{@xfer.endpoint.to_s}",
"#{NS_ADDRESSING}:ReplyTo" => {
"#{NS_ADDRESSING}:Address" => 'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous',
:attributes! => {"#{NS_ADDRESSING}:Address" => {'mustUnderstand' => true}}},
"#{NS_WSMAN_DMTF}:MaxEnvelopeSize" => @max_env_sz,
"#{NS_ADDRESSING}:MessageID" => "uuid:#{SecureRandom.uuid.to_s.upcase}",
"#{NS_WSMAN_DMTF}:Locale/" => '',
"#{NS_WSMAN_MSFT}:DataLocale/" => '',
"#{NS_WSMAN_DMTF}:OperationTimeout" => @timeout,
:attributes! => {
NoMethodError:
undefined method `endpoint' for nil:NilClass

# ./test/integration/default/contributors_spec.rb:7:in `block (2 levels) in load'

Finished in 0.034 seconds (files took 1.21 seconds to load)
2 examples, 2 failures

Failed examples:

rspec # File C:\Users\azure\AppData\Local\Temp\kitchen\cache\contributors.txt content
rspec # File C:\Users\azure\AppData\Local\Temp\kitchen\cache\contributors.txt content

>>>>>> Verify failed on instance <default-windows2012-r2>.
>>>>>> Please see .kitchen/logs/default-windows2012-r2.log for more details
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Inspec Runner returns 1
>>>>>> ———————————
Have more questions? Submit a request

Comments

Powered by Zendesk