Skip to content

Commit 5a6b203

Browse files
committed
docs(readme): add Testing with Vagrant section
1 parent 6e094e2 commit 5a6b203

File tree

1 file changed

+63
-1
lines changed

1 file changed

+63
-1
lines changed

docs/README.rst

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ e.g. ``debian-9-2019-2-py3``.
325325
``bin/kitchen converge``
326326
^^^^^^^^^^^^^^^^^^^^^^^^
327327

328-
Creates the docker instance and runs the ``template`` main state, ready for testing.
328+
Creates the docker instance and runs the ``apache`` main states, ready for testing.
329329

330330
``bin/kitchen verify``
331331
^^^^^^^^^^^^^^^^^^^^^^
@@ -346,3 +346,65 @@ Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``veri
346346
^^^^^^^^^^^^^^^^^^^^^
347347

348348
Gives you SSH access to the instance for manual testing.
349+
350+
Testing with Vagrant
351+
--------------------
352+
353+
Windows/FreeBSD/OpenBSD testing is done with ``kitchen-salt``.
354+
355+
Requirements
356+
^^^^^^^^^^^^
357+
358+
* Ruby
359+
* Virtualbox
360+
* Vagrant
361+
362+
Setup
363+
^^^^^
364+
365+
.. code-block:: bash
366+
367+
$ gem install bundler
368+
$ bundle install --with=vagrant
369+
$ bin/kitchen test [platform]
370+
371+
Where ``[platform]`` is the platform name defined in ``kitchen.vagrant.yml``,
372+
e.g. ``windows-81-latest-py3``.
373+
374+
Note
375+
^^^^
376+
377+
When testing using Vagrant you must set the environment variable ``KITCHEN_LOCAL_YAML`` to ``kitchen.vagrant.yml``. For example:
378+
379+
.. code-block:: bash
380+
381+
$ KITCHEN_LOCAL_YAML=kitchen.vagrant.yml bin/kitchen test # Alternatively,
382+
$ export KITCHEN_LOCAL_YAML=kitchen.vagrant.yml
383+
$ bin/kitchen test
384+
385+
Then run the following commands as needed.
386+
387+
``bin/kitchen converge``
388+
^^^^^^^^^^^^^^^^^^^^^^^^
389+
390+
Creates the Vagrant instance and runs the ``apache`` main states, ready for testing.
391+
392+
``bin/kitchen verify``
393+
^^^^^^^^^^^^^^^^^^^^^^
394+
395+
Runs the ``inspec`` tests on the actual instance.
396+
397+
``bin/kitchen destroy``
398+
^^^^^^^^^^^^^^^^^^^^^^^
399+
400+
Removes the Vagrant instance.
401+
402+
``bin/kitchen test``
403+
^^^^^^^^^^^^^^^^^^^^
404+
405+
Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``.
406+
407+
``bin/kitchen login``
408+
^^^^^^^^^^^^^^^^^^^^^
409+
410+
Gives you RDP/SSH access to the instance for manual testing.

0 commit comments

Comments
 (0)