[MOLECULE] Add testinfra tests for dns role 64/126364/2
authorOstap Batih <o.batih@samsung.com>
Wed, 22 Dec 2021 09:13:33 +0000 (09:13 +0000)
committerOstap Batih <o.batih@samsung.com>
Wed, 22 Dec 2021 11:44:04 +0000 (11:44 +0000)
Issue-ID: OOM-2889
Signed-off-by: Ostap Batih <o.batih@samsung.com>
Change-Id: I9c653bdaa8cfcd1a8e187cbf899c060a6299457c

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

index c3ed309..131c887 100644 (file)
@@ -27,9 +27,5 @@ provisioner:
     host_vars:
       infrastructure-server:
         cluster_ip: 127.0.0.1
-    group_vars:
-      all:
-        app_name: onap
-        app_data_path: "/opt/{{ app_name }}"
 verifier:
   name: testinfra
diff --git a/ansible/roles/dns/molecule/default/tests/test_default.py b/ansible/roles/dns/molecule/default/tests/test_default.py
new file mode 100644 (file)
index 0000000..76700d4
--- /dev/null
@@ -0,0 +1,12 @@
+def test_dir(host):
+    f = host.file('/cfg')
+    assert f.exists
+    assert f.is_directory
+
+
+def test_hostname_file(host):
+    assert host.file('/cfg/simulated_hosts').exists
+
+
+def test_dns_container(host):
+    assert host.docker('dns-server').is_running
index 191da95..0a9fbad 100644 (file)
@@ -31,9 +31,5 @@ provisioner:
     host_vars:
       infrastructure-server:
         cluster_ip: 127.0.0.1
-    group_vars:
-      all:
-        app_name: onap
-        app_data_path: "/opt/{{ app_name }}"
 verifier:
   name: testinfra