2

I'm trying to get test-kitchen working with a guest Windows VM. I've followed a lot of Matt Wrock's excellent blog posts. I've set up a working Windows Vagrant box, used the right test-kitchen and kitchen-vagrant branches and have managed to get kitchen create to work.

At this point I'm stuck on getting kitchen converge to work. I'll do a converge and run into:

$ kitchen converge
-----> Starting Kitchen (v1.3.2.dev)
-----> Converging <default-windows-7>...
       Preparing files for transfer
       Preparing dna.json
       Resolving cookbook dependencies with Berkshelf 3.1.3...
       Removing non-cookbook files before transfer
       Preparing validation.pem
       Preparing client.rb
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #converge action: [[Kitchen::Transport::Winrm] WinRM::WinRMAuthorizationError using shell: [powershell] and command: [ $ProgressPreference='SilentlyContinue';   if (-Not (Test-Path "/tmp/kitchen")) {
    mkdir "/tmp/kitchen" | Out-Null
  }
if ( Test-Path '/tmp/kitchen/data' ) { rm -r '/tmp/kitchen/data' };if ( Test-Path '/tmp/kitchen/data_bags' ) { rm -r '/tmp/kitchen/data_bags' };if ( Test-Path '/tmp/kitchen/environments' ) { rm -r '/tmp/kitchen/environments' };if ( Test-Path '/tmp/kitchen/roles' ) { rm -r '/tmp/kitchen/roles' };if ( Test-Path '/tmp/kitchen/clients' ) { rm -r '/tmp/kitchen/clients' };
  if (-Not (Test-Path "/tmp/kitchen")) {
    mkdir "/tmp/kitchen" | Out-Null
  }
if ( Test-Path '/tmp/kitchen/data' ) { rm -r '/tmp/kitchen/data' };if ( Test-Path '/tmp/kitchen/data_bags' ) { rm -r '/tmp/kitchen/data_bags' };if ( Test-Path '/tmp/kitchen/environments' ) { rm -r '/tmp/kitchen/environments' };if ( Test-Path '/tmp/kitchen/roles' ) { rm -r '/tmp/kitchen/roles' };if ( Test-Path '/tmp/kitchen/clients' ) { rm -r '/tmp/kitchen/clients' };
  if (-Not (Test-Path "/tmp/kitchen")) {
    mkdir "/tmp/kitchen" | Out-Null
  }
if ( Test-Path '/tmp/kitchen/data' ) { rm -r '/tmp/kitchen/data' };if ( Test-Path '/tmp/kitchen/data_bags' ) { rm -r '/tmp/kitchen/data_bags' };if ( Test-Path '/tmp/kitchen/environments' ) { rm -r '/tmp/kitchen/environments' };if ( Test-Path '/tmp/kitchen/roles' ) { rm -r '/tmp/kitchen/roles' };if ( Test-Path '/tmp/kitchen/clients' ) { rm -r '/tmp/kitchen/clients' };
  if (-Not (Test-Path "/tmp/kitchen")) {
    mkdir "/tmp/kitchen" | Out-Null
  }
if ( Test-Path '/tmp/kitchen/data' ) { rm -r '/tmp/kitchen/data' };if ( Test-Path '/tmp/kitchen/data_bags' ) { rm -r '/tmp/kitchen/data_bags' };if ( Test-Path '/tmp/kitchen/environments' ) { rm -r '/tmp/kitchen/environments' };if ( Test-Path '/tmp/kitchen/roles' ) { rm -r '/tmp/kitchen/roles' };if ( Test-Path '/tmp/kitchen/clients' ) { rm -r '/tmp/kitchen/clients' };
  if (-Not (Test-Path "/tmp/kitchen")) {
    mkdir "/tmp/kitchen" | Out-Null
  }
if ( Test-Path '/tmp/kitchen/data' ) { rm -r '/tmp/kitchen/data' };if ( Test-Path '/tmp/kitchen/data_bags' ) { rm -r '/tmp/kitchen/data_bags' };if ( Test-Path '/tmp/kitchen/environments' ) { rm -r '/tmp/kitchen/environments' };if ( Test-Path '/tmp/kitchen/roles' ) { rm -r '/tmp/kitchen/roles' };if ( Test-Path '/tmp/kitchen/clients' ) { rm -r '/tmp/kitchen/clients' };
  if (-Not (Test-Path "/tmp/kitchen")) {
    mkdir "/tmp/kitchen" | Out-Null
  }
if ( Test-Path '/tmp/kitchen/data' ) { rm -r '/tmp/kitchen/data' };if ( Test-Path '/tmp/kitchen/data_bags' ) { rm -r '/tmp/kitchen/data_bags' };if ( Test-Path '/tmp/kitchen/environments' ) { rm -r '/tmp/kitchen/environments' };if ( Test-Path '/tmp/kitchen/roles' ) { rm -r '/tmp/kitchen/roles' };if ( Test-Path '/tmp/kitchen/clients' ) { rm -r '/tmp/kitchen/clients' };]]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

At this point I'm at a loss, I'm able to run vagrant up and have the shell provisioner create a file, so the powershell permissions seem to be set correctly. I have more details with all the config files in a gist.

1

The branches for windows support has been recently merged into the latest version. My Gemfile (below) pointing to test master branch of both test-kitchen and kitchen-vagrant works for me. Hopefully it'll work for you as well.

PS: Finally signed in after years of using it and this is my first reply :-)

source 'https://rubygems.org'

group :development do
  gem "test-kitchen", :git => 'https://github.com/test-kitchen/test-kitchen.git', :branch => 'master'
  gem 'kitchen-vagrant', git: 'https://github.com/test-kitchen/kitchen-vagrant.git', :branch => 'master'
  gem "berkshelf"
  gem "vagrant-wrapper", ">= 2.0"
end
  • 1
    Thanks for reminding me about this, I actually got it all to converge with the beta releases. I'll post back with an answer and a sample .kitchen.yml – Arthur Maltson Mar 26 '15 at 0:28
  • @ArthurMaltson Were you able to create a sample .kitchen.yaml file? – spuder May 30 '15 at 5:21
0

I ran into the exact same issue. kitchen create worked fine, but converge failed with that error. I was running version 1.7.2 of Vagrant. I downgraded to Vagrant 1.6.3 and that seemed to fix the issue.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.