Skip to content

mgodlewski/plumb_unit

Repository files navigation

plumb unit

Build Status

Plumb unit creates roles with testing framework or adds testing framework to existing role.

Place yourself in the root dir of your roles and launch :

/path/to/plumb_unit/ansible_make_new_tested_role my-new-role

This will create a roles directory in which the my_new_role is created. The role itself only contains an empty tasks/main.yml and a tests directory.

Using default testing environment

To run tests for your role, you can then go to the tests directory and run them :

cd roles/my-new-role/tests
./run_tests.sh

This exemple will run tests in a centos6 container. It will run all tests found in files named test_my-new-role*_centos6.

specifying distribution and version

To run test on a specific distribution, make a link for run_tests.sh ending with _distribution :

ln -s run_tests.sh run_tests_jessie.sh
./run_tests_jessie.sh

This will run tests in test_my-new-role*_jessie.

cluster tests

cluster tests will be run by adding _cluster suffix to link and tests files :

ln -s run_tests.sh run_tests_jessie_cluster.sh
./run_tests_jessie_cluster.sh

This will run tests in test_my-new-role*_jessie_cluster.

Note that in this particular mode, tests are played from outside the containers. Tests then needs docker exec commands to access the container and check things within.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages