From bbc0f7b471ddcbc981cf0bb15aa08e1926a6cc3b Mon Sep 17 00:00:00 2001 From: Nicolas Rodriguez Date: Sun, 25 Aug 2019 22:22:10 +0200 Subject: [PATCH] docs(readme): add testing section --- docs/README.rst | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/docs/README.rst b/docs/README.rst index a05cfb7..b57254b 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -60,3 +60,48 @@ This state manages the file ``keepalived.conf`` under ``/etc/keepalived`` (templ ``keepalived.service`` ---------------------- This state ensures that keepalived service is running. + +Testing +------- + +Linux testing is done with ``kitchen-salt``. + +Requirements +^^^^^^^^^^^^ + +* Ruby +* Docker + +.. code-block:: bash + + $ gem install bundler + $ bundle install + $ bin/kitchen test [platform] + +Where ``[platform]`` is the platform name defined in ``kitchen.yml``, +e.g. ``debian-9-2019-2-py3``. + +``bin/kitchen converge`` +^^^^^^^^^^^^^^^^^^^^^^^^ + +Creates the docker instance and runs the ``keepalived`` main state, ready for testing. + +``bin/kitchen verify`` +^^^^^^^^^^^^^^^^^^^^^^ + +Runs the ``inspec`` tests on the actual instance. + +``bin/kitchen destroy`` +^^^^^^^^^^^^^^^^^^^^^^^ + +Removes the docker instance. + +``bin/kitchen test`` +^^^^^^^^^^^^^^^^^^^^ + +Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``. + +``bin/kitchen login`` +^^^^^^^^^^^^^^^^^^^^^ + +Gives you SSH access to the instance for manual testing.