Sign inSign up

multimediabs/plumb_unit

By multimediabs

Updated over 6 years ago

Containers with ansible

Image
4

5.1K

multimediabs/plumb_unit repository overview

= plumb unit

image:https://travis-ci.org/multimediabs/plumb_unit.svg?branch=master[Build Status,link=https://travis-ci.org/multimediabs/plumb_unit]

Plumb unit creates https://www.ansible.com[ansible] roles with https://github.com/pgrange/bash_unit[bash_unit] testing framework or adds testing framework to existing role.

Launch the following command to create a skeleton to my-new-role for centos7. :

/path/to/plumb_unit/ansible_make_new_tested_role -D centos7 my_new_role

This will create a my_new_role directory with the following structure.

my_new_role
├── meta
│   └── main.yml
├── README.adoc
├── tasks
│   ├── interface.yml
│   └── main.yml
└── tests
    ├── ansible.cfg
    ├── bash_unit
    ├── run_tests_centos7.sh -> .run_tests.sh
    └── test_my_new_role_centos7

== Using default testing environment

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

cd tests ./run_tests_centos7.sh

This exemple will run tests in a centos7 container from https://hub.docker.com/r/multimediabs/plumb_unit/tags[docker hub]. It will run all tests found in files named with pattern _test_my-new-role*centos7.

== 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 from _test_my-new-role*jessie file.

== 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.

Tag summary

Content type

Image

Digest

Size

260.9 MB

Last updated

over 6 years ago

docker pull multimediabs/plumb_unit:debian8