diff options
Diffstat (limited to 'ansible/roles/package-repository/molecule/default/tests')
-rw-r--r-- | ansible/roles/package-repository/molecule/default/tests/test_infrastructure-server.py | 13 | ||||
-rw-r--r-- | ansible/roles/package-repository/molecule/default/tests/test_kubernetes-node-1.py | 13 |
2 files changed, 20 insertions, 6 deletions
diff --git a/ansible/roles/package-repository/molecule/default/tests/test_infrastructure-server.py b/ansible/roles/package-repository/molecule/default/tests/test_infrastructure-server.py index 9fb1a4f9..5b3fce4d 100644 --- a/ansible/roles/package-repository/molecule/default/tests/test_infrastructure-server.py +++ b/ansible/roles/package-repository/molecule/default/tests/test_infrastructure-server.py @@ -7,10 +7,17 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( def test_onap_repo(host): - fc = host.file('/etc/yum.repos.d/moleculetestapp.repo').content_string - expected_content = """[moleculetestapp] + os = host.system_info.distribution + if os == "centos": + fc = host.file('/etc/yum.repos.d/moleculetestapp.repo').content_string + expected_content = """[moleculetestapp] baseurl = file:///opt/moleculetestapp/pkg/rpm enabled = 1 gpgcheck = 0 name = MOLECULETESTAPP offline repository""" - assert fc == expected_content + assert fc == expected_content + elif os == "ubuntu": + fc = host.file('/etc/apt/sources.list.d/moleculetestapp.list') + fc = fc.content_string + ec = "deb [trusted=yes] file:///opt/moleculetestapp/pkg/deb ./" + assert fc == ec diff --git a/ansible/roles/package-repository/molecule/default/tests/test_kubernetes-node-1.py b/ansible/roles/package-repository/molecule/default/tests/test_kubernetes-node-1.py index fda85e8d..c1831f70 100644 --- a/ansible/roles/package-repository/molecule/default/tests/test_kubernetes-node-1.py +++ b/ansible/roles/package-repository/molecule/default/tests/test_kubernetes-node-1.py @@ -7,10 +7,17 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( def test_onap_repo(host): - fc = host.file('/etc/yum.repos.d/moleculetestapp.repo').content_string - expected_content = """[moleculetestapp] + os = host.system_info.distribution + if os == "centos": + fc = host.file('/etc/yum.repos.d/moleculetestapp.repo').content_string + expected_content = """[moleculetestapp] baseurl = http://repo.infra-server/rpm enabled = 1 gpgcheck = 0 name = MOLECULETESTAPP offline repository""" - assert fc == expected_content + assert fc == expected_content + elif os == "ubuntu": + fc = host.file('/etc/apt/sources.list.d/moleculetestapp.list') + fc = fc.content_string + ec = "deb [trusted=yes] http://repo.infra-server/deb ./" + assert fc == ec |