[MOLECULE] Add testinfra tests for cert-manager role 46/126146/3
authorOstap Batih <o.batih@samsung.com>
Wed, 8 Dec 2021 09:50:52 +0000 (09:50 +0000)
committerOstap Batih <o.batih@samsung.com>
Fri, 10 Dec 2021 09:21:45 +0000 (09:21 +0000)
Issue-ID: OOM-2889
Change-Id: Ida4349ea463b3da182502ccc10927c2f22d684b9
Signed-off-by: Ostap Batih <o.batih@samsung.com>
ansible/roles/cert-manager/molecule/default/tests/test_default.py [new file with mode: 0644]

diff --git a/ansible/roles/cert-manager/molecule/default/tests/test_default.py b/ansible/roles/cert-manager/molecule/default/tests/test_default.py
new file mode 100644 (file)
index 0000000..2bac602
--- /dev/null
@@ -0,0 +1,23 @@
+def test_helm_value_file(host):
+    f = host.file('/opt/onap/cert_manager.yaml')
+    assert f.exists
+    assert f.user == 'root'
+    assert f.group == 'root'
+    assert f.content_string.strip() == "installCRDs: true"
+
+
+def test_cmctl(host):
+    f = host.file('/usr/local/bin/cmctl')
+    assert f.exists
+    assert f.user == 'root'
+    assert f.group == 'root'
+    assert host.run('cmctl').rc == 0
+
+
+def test_bash_completion(host):
+    assert host.package("bash-completion").is_installed
+
+
+def test_bash_completion_cmctl(host):
+    f = host.file('/etc/bash_completion.d/cmctl')
+    assert f.exists