Skip to content

Commit 5727848

Browse files
committed
docs(readme): add Testing with Vagrant section [skip ci]
1 parent 13591c6 commit 5727848

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

docs/README.rst

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,3 +169,65 @@ Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``veri
169169
^^^^^^^^^^^^^^^^^^^^^
170170

171171
Gives you SSH access to the instance for manual testing.
172+
173+
Testing with Vagrant
174+
--------------------
175+
176+
Windows/FreeBSD/OpenBSD testing is done with ``kitchen-salt``.
177+
178+
Requirements
179+
^^^^^^^^^^^^
180+
181+
* Ruby
182+
* Virtualbox
183+
* Vagrant
184+
185+
Setup
186+
^^^^^
187+
188+
.. code-block:: bash
189+
190+
$ gem install bundler
191+
$ bundle install --with=vagrant
192+
$ bin/kitchen test [platform]
193+
194+
Where ``[platform]`` is the platform name defined in ``kitchen.vagrant.yml``,
195+
e.g. ``windows-81-latest-py3``.
196+
197+
Note
198+
^^^^
199+
200+
When testing using Vagrant you must set the environment variable ``KITCHEN_LOCAL_YAML`` to ``kitchen.vagrant.yml``. For example:
201+
202+
.. code-block:: bash
203+
204+
$ KITCHEN_LOCAL_YAML=kitchen.vagrant.yml bin/kitchen test # Alternatively,
205+
$ export KITCHEN_LOCAL_YAML=kitchen.vagrant.yml
206+
$ bin/kitchen test
207+
208+
Then run the following commands as needed.
209+
210+
``bin/kitchen converge``
211+
^^^^^^^^^^^^^^^^^^^^^^^^
212+
213+
Creates the Vagrant instance and runs the ``nginx`` main state, ready for testing.
214+
215+
``bin/kitchen verify``
216+
^^^^^^^^^^^^^^^^^^^^^^
217+
218+
Runs the ``inspec`` tests on the actual instance.
219+
220+
``bin/kitchen destroy``
221+
^^^^^^^^^^^^^^^^^^^^^^^
222+
223+
Removes the Vagrant instance.
224+
225+
``bin/kitchen test``
226+
^^^^^^^^^^^^^^^^^^^^
227+
228+
Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``.
229+
230+
``bin/kitchen login``
231+
^^^^^^^^^^^^^^^^^^^^^
232+
233+
Gives you RDP/SSH access to the instance for manual testing.

0 commit comments

Comments
 (0)