[MOLECULE] Add testinfra tests for nginx role 84/126384/2
authorOstap Batih <o.batih@samsung.com>
Tue, 28 Dec 2021 09:35:22 +0000 (09:35 +0000)
committerOstap Batih <o.batih@samsung.com>
Mon, 3 Jan 2022 13:26:32 +0000 (13:26 +0000)
Issue-ID: OOM-2889
Signed-off-by: Ostap Batih <o.batih@samsung.com>
Change-Id: I32960fbb425d65f934c9c91ffbc764fceafa90f5

ansible/roles/nginx/molecule/default/tests/test_default.py [new file with mode: 0644]
ansible/roles/nginx/molecule/ubuntu/molecule.yml

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 (file)
index 0000000..6b4f50e
--- /dev/null
@@ -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
index 1c1eaa9..8555a90 100644 (file)
@@ -31,3 +31,4 @@ provisioner:
     cleanup: ../default/cleanup.yml
 verifier:
   name: testinfra
+  directory: ../default/tests/