Windows in the Kitchen #324

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

maxlinc commented Jun 4, 2014

I'm sending two related PRs. I thought it would be a little clearer and easier to discuss than a single PR.

This PR continues the work started in #289 to setup development/testing tools. So this PR is good for discussion about "how do we want to test travis-cookbooks" and windows support specifically.

Note that I've created a "worker_windows" which is basically a copy of "worker_standard". They might be merge together into a platform agnostic "worker_standard", pending discussing on the other PR.

test-kitchen is looking promising, but there are a number of workarounds necessary to use windows in the kitchen:

  • test-kitchen/kitchen-vagrant do not currently support windows over winrm, but @docwhat created a workaround driver that uses vagrant for provisioning
  • test-kitchen has serverspec support, but it only supports transferring suites over SSH and running them on the guest machine. I want to run serverspec on the host machine and use the WinRM transport. So although I followed the test-kitchen layout, I am not using test-kitchen to run serverspec (i.e. you currently can do kitchen converge but not kitchen verify or kitchen test... run the tests directly via rspec)
  • vagrant-berkshelf isn't working for me. I'm manually doing a berks vendor and setting the cookbooks_path to use berks-cookbooks

Other notes:

  • I found packer-windows, which is working well. It can build more Windows images, but currently install OpenSSH (which I don't really want). I'm currently testing with both Windows 2012 Server Core (including OpenSSH) built via packer-windows, and with Windows 8.1 built manually (without OpenSSH)

maxlinc referenced this pull request Jun 4, 2014

Closed

Cooking Windows (messily) #325

Contributor

maxlinc commented Jun 4, 2014

Since it may not be obvious and I didn't include a README update or any Rake tasks, here's how you would currently test:

  • bundle install, of course ;)
  • Build one or both Windows Vagrant boxes:
    • You can create either image with packer-windows... they will have OpenSSH unless you remove it.
    • Or you can follow the instructions from vagrant-windows and use images from modern.ie (at least for win8)
  • vagrant box add ... the images created above
  • Once the boxes are imported, run kitchen list to make sure everything is working okay. You should see something like:
Instance                        Driver            Provisioner  Last Action
worker-windows-precise          Vagrant           ChefSolo     <Not Created>
worker-windows-trusty           Vagrant           ChefSolo     <Not Created>
worker-windows-win2012-r2-core  VagrantProvision  ChefSolo     <Not Created>
worker-windows-win8             VagrantProvision  ChefSolo     <Not Created>
  • Choose which windows instance you want to test (I'll assume win8), and run kitchen converge win8 (in the future, you'll hopefully be able to do kitchen test win8, but kitchen can't run the tests right now)
  • Once it finishes converging, you can run bundle exec rspec rspec test/integration/worker_windows/serverspec/ (in the future this will hopefully be part of kitchen verify)

If you want to successfully converge and test, you'll need to merge #325 or something similar :)

henrikhodne added the windows label Aug 5, 2014

meatballhat self-assigned this Nov 25, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment