Search code examples
automated-testschef-infrachef-recipetest-kitchenserverspec

Is it possible to run kitchen tests against a server without using any drivers?


I just want to see if it's possible to run kitchen tests against a server that's always on.

I know that testing cookbooks against VMs that you can create and destroy at will would be ideal, but I would expect there to be some stripped down way of converging and running tests against a box using just WinRM or SSH.


Solution

  • I'll assume you want to run tests using Serverspec or InSpec. It depends on verifier, driver and provisioner sections of .kitchen.yml are optional. If you skip them test-kitchen will use dummy driver. So without driver kitchen list will look like:

    $ kitchen list
    Instance                          Driver  Provisioner  Verifier    Transport  Last Action
    ...
    ci-server-ubuntu-1604             Dummy   ChefSolo     Serverspec  Ssh        <Not Created>
    

    And if verifier supports ssh or winrm you can run kitchen verify. Serverspec verifier can do it, Inspec verifier can do it as well.

    However, I'm not sure if need the whole test-kitchen if you want to just run tests on the machine. Both InSpec and Serverspec can be run standalone.