summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOstap Batih <o.batih@samsung.com>2021-12-28 09:35:22 +0000
committerOstap Batih <o.batih@samsung.com>2022-01-03 13:26:32 +0000
commitc4648f2efb8744288ba9b0e5814c3a5eb39335e6 (patch)
tree73ef905edf20cbe978ace0a8dcd66c7abf8443bc
parent9127db9adba9051c9a0f07f3c29f3bd0113e62c5 (diff)
[MOLECULE] Add testinfra tests for nginx role
Issue-ID: OOM-2889 Signed-off-by: Ostap Batih <o.batih@samsung.com> Change-Id: I32960fbb425d65f934c9c91ffbc764fceafa90f5
-rw-r--r--ansible/roles/nginx/molecule/default/tests/test_default.py14
-rw-r--r--ansible/roles/nginx/molecule/ubuntu/molecule.yml1
2 files changed, 15 insertions, 0 deletions
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/