[MOLECULE] Remove separate helm cases from 'application' role verifier
[oom/offline-installer.git] / ansible / roles / application / molecule / default / tests / test_default.py
1 import os
2
3 import testinfra.utils.ansible_runner
4
5 testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
6     os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
7
8
9 def test_helm_commands(host):
10     fc = host.file('/tmp/helm_simu_output').content_string.strip()
11     expected_content = """env
12 repo list
13 repo add local http://127.0.0.1:8879
14 deploy moleculetestapp local/moleculetestapp --namespace \
15 moleculetestapp -f /opt/moleculetestapp/helm_charts/onap/resources/\
16 overrides/onap-all.yaml -f /opt/moleculetestapp/override.yaml \
17 --timeout 1800s"""
18     expected_plugin_path = '/root/.local/share/helm/plugins/deploy/' +\
19                            'deploy.sh'
20     assert fc == expected_content
21     assert host.file(expected_plugin_path).exists
22
23
24 def test_helm_override_file(host):
25     fc = host.file('/opt/moleculetestapp/override.yaml').content_string.strip()
26     expected_content = """global:
27     cacert: 'this is dummy server certificate value
28
29         '"""
30     assert fc == expected_content