mike-senin / mk-post-deployment-checks

in progress
BSD 2-Clause "Simplified" License
1 stars 8 forks source link

Salt MK Verificator

This is salt-based set of tools for basic verification of mk* deployments

How to start

1) Copy repo to **cfg-*** node or clone it:

   # root@cfg-01:~/# git clone https://github.com/msenin94/mk-post-deployment-checks 
   # cd mk-post-deployment-checks/

Use git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080 if needed.

2) Install virtualenv

   # curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-X.X.tar.gz
   # tar xvfz virtualenv-X.X.tar.gz
   # cd virtualenv-X.X
   # sudo python setup.py install

3) Create virtualenv and install requirements and package:

   # virtualenv --system-site-packages .venv
   # source .venv/bin/activate
   # pip install --proxy http://$PROXY:8678 -r requirements.txt
   # python setup.py install
   # python setup.py develop

4) Prepare test state (you need to create it in your env folder):

   # mkdir /srv/salt/env/prd/test_state/
   # cat mk_verificator/tests/state_checker/init.sls.example > /srv/salt/env/prd/test_state/init.sls

Please change this state according to your environment (add services/packages).

5) Start tests (make sure you are root):

   # pytest --tb=short -sv mk_verificator/tests/

6) Also you can use some scripts from mk_verificator/scripts: