3 import testinfra.utils.ansible_runner
5 testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
6 os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
9 def test_helm_commands(host):
10 fc = host.file('/tmp/helm_simu_output').content_string
11 helm_release = host.ansible.get_variables()['helm_version']
12 if helm_release == 'v2':
14 elif helm_release == 'v3':
16 expected_content = content_str1 + """
17 init --upgrade --skip-refresh
18 version --tiller-connection-timeout 10
22 repo add local http://127.0.0.1:8879
23 install --name moleculetestapp local/moleculetestapp --namespace \
24 moleculetestapp -f /opt/moleculetestapp/helm_charts/onap/resources/\
25 overrides/onap-all.yaml -f /opt/moleculetestapp/override.yaml \
27 assert fc == expected_content
30 def test_helm_override_file(host):
31 fc = host.file('/opt/moleculetestapp/override.yaml').content_string
32 expected_content = """global:
33 cacert: 'this is dummy server certificate value
36 assert fc == expected_content