Skip to content

Commit 208e31b

Browse files
committed
docs(readme): add Testing with Vagrant section
1 parent 16ec625 commit 208e31b

1 file changed

Lines changed: 63 additions & 1 deletion

File tree

docs/README.rst

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Requirements
105105
``kitchen converge``
106106
^^^^^^^^^^^^^^^^^^^^
107107

108-
Creates the docker instance and runs the ``template`` main state, ready for testing.
108+
Creates the docker instance and runs the ``vault`` main states, ready for testing.
109109

110110
``kitchen verify``
111111
^^^^^^^^^^^^^^^^^^
@@ -126,3 +126,65 @@ Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``veri
126126
^^^^^^^^^^^^^^^^^
127127

128128
Gives you SSH access to the instance for manual testing.
129+
130+
Testing with Vagrant
131+
--------------------
132+
133+
Windows/FreeBSD/OpenBSD testing is done with ``kitchen-salt``.
134+
135+
Requirements
136+
^^^^^^^^^^^^
137+
138+
* Ruby
139+
* Virtualbox
140+
* Vagrant
141+
142+
Setup
143+
^^^^^
144+
145+
.. code-block:: bash
146+
147+
$ gem install bundler
148+
$ bundle install --with=vagrant
149+
$ bin/kitchen test [platform]
150+
151+
Where ``[platform]`` is the platform name defined in ``kitchen.vagrant.yml``,
152+
e.g. ``windows-81-latest-py3``.
153+
154+
Note
155+
^^^^
156+
157+
When testing using Vagrant you must set the environment variable ``KITCHEN_LOCAL_YAML`` to ``kitchen.vagrant.yml``. For example:
158+
159+
.. code-block:: bash
160+
161+
$ KITCHEN_LOCAL_YAML=kitchen.vagrant.yml bin/kitchen test # Alternatively,
162+
$ export KITCHEN_LOCAL_YAML=kitchen.vagrant.yml
163+
$ bin/kitchen test
164+
165+
Then run the following commands as needed.
166+
167+
``bin/kitchen converge``
168+
^^^^^^^^^^^^^^^^^^^^^^^^
169+
170+
Creates the Vagrant instance and runs the ``vault`` main states, ready for testing.
171+
172+
``bin/kitchen verify``
173+
^^^^^^^^^^^^^^^^^^^^^^
174+
175+
Runs the ``inspec`` tests on the actual instance.
176+
177+
``bin/kitchen destroy``
178+
^^^^^^^^^^^^^^^^^^^^^^^
179+
180+
Removes the Vagrant instance.
181+
182+
``bin/kitchen test``
183+
^^^^^^^^^^^^^^^^^^^^
184+
185+
Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``.
186+
187+
``bin/kitchen login``
188+
^^^^^^^^^^^^^^^^^^^^^
189+
190+
Gives you RDP/SSH access to the instance for manual testing.

0 commit comments

Comments
 (0)