Sunday 15 April 2012

chef - How to setup test preconditions before a ServerSpec test? -


I am writing a simple kitchenbook that will be used to deploy an SSL proxy to the server. This cookbook will eventually be used by other cookbooks, which deploys web services to establish an SSL proxy in front of them, but there is no such service behind it for the purpose of testing proxy kitchen book. My basic test strategy for this cookbook is as follows:

  1. Unify the box with the test-kitchen
    1. Testing with the kitchen ServerSpec ( Or possibly a bulb)
      1. Set up the test by starting a Python SimpleHTTPServer on the box entry on the port which was configured to forward the proxy, and tested it for index.html file I went.
      2. Say that when I got the file which is serving SimpleHTTpserver
      3. Tell us a few more things about the proxy (all of which require that there is a service behind it).
    2. Turndown

    So my question is, what is the correct way to set such a pre-test using test-kitchen and ServerSpec and / or Bat?

If Setup and TeDown are not really part of what I'm testing, then I usually Just do this in Ruby, which runs before each Ruby (often, in spec_helper.rb). Since the server pc is just really running a ruby ​​code line on the line of an exam-kitchen, it does not seem necessary for me to do anything in ServerPack which provides setup / trade functionality (in other words, any ordering issues Or repeat tests are not required to call a setup or tudown method).


No comments:

Post a Comment