Skip to content

Commit 05c942e

Browse files
committed
docs(readme): add Testing with Vagrant section
1 parent f1066d6 commit 05c942e

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

docs/README.rst

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,64 @@ Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``veri
162162

163163
Gives you SSH access to the instance for manual testing.
164164

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

0 commit comments

Comments
 (0)