From: Ostap Batih Date: Tue, 28 Dec 2021 09:35:22 +0000 (+0000) Subject: [MOLECULE] Add testinfra tests for nginx role X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=c4648f2efb8744288ba9b0e5814c3a5eb39335e6;p=oom%2Foffline-installer.git [MOLECULE] Add testinfra tests for nginx role Issue-ID: OOM-2889 Signed-off-by: Ostap Batih Change-Id: I32960fbb425d65f934c9c91ffbc764fceafa90f5 --- diff --git a/ansible/roles/nginx/molecule/default/tests/test_default.py b/ansible/roles/nginx/molecule/default/tests/test_default.py new file mode 100644 index 00000000..6b4f50e1 --- /dev/null +++ b/ansible/roles/nginx/molecule/default/tests/test_default.py @@ -0,0 +1,14 @@ +def test_dir(host): + f = host.file('/cfg') + assert f.exists + assert f.is_directory + + +def test_simulated_hostname_file(host): + f = host.file('/cfg/nginx.conf') + assert f.exists + + +def test_nginx_container(host): + c = host.docker('nginx-server') + assert c.is_running diff --git a/ansible/roles/nginx/molecule/ubuntu/molecule.yml b/ansible/roles/nginx/molecule/ubuntu/molecule.yml index 1c1eaa9b..8555a902 100644 --- a/ansible/roles/nginx/molecule/ubuntu/molecule.yml +++ b/ansible/roles/nginx/molecule/ubuntu/molecule.yml @@ -31,3 +31,4 @@ provisioner: cleanup: ../default/cleanup.yml verifier: name: testinfra + directory: ../default/tests/