@pytest.fixture
def chrony_conf_file(host, os_family):
- conf = host.ansible('include_vars', 'file=../../defaults/main.yml')[
+ conf = host.ansible('include_vars', 'file=defaults/main.yml')[
'ansible_facts']['chrony']['conf'][os_family]['config_file']
return conf
name: testinfra
options:
verbose: true
- options:
- ignore: W291 # trailing whitespace
name: testinfra
options:
verbose: true
- options:
- ignore: W291 # trailing whitespace
directory: ../default/tests/
"eth0").addresses[0]
f = host.file(host_file)
assert f.exists
- assert f.content_string == \
+ assert f.content_string.strip() == \
"""/dockerdata-nfs """ + node2_ip + """(rw,sync,no_root_squash,no_subtree_check)""" # noqa: E501
def test_onap_repo(host):
os = host.system_info.distribution
if os == "centos":
- fc = host.file('/etc/yum.repos.d/moleculetestapp.repo').content_string
+ fc = host.file('/etc/yum.repos.d/moleculetestapp.repo'
+ ).content_string.strip()
expected_content = """[moleculetestapp]
baseurl = file:///opt/moleculetestapp/pkg/rpm
enabled = 1
assert fc == expected_content
elif os == "ubuntu":
fc = host.file('/etc/apt/sources.list.d/moleculetestapp.list')
- fc = fc.content_string
+ fc = fc.content_string.strip()
ec = "deb [trusted=yes] file:///opt/moleculetestapp/pkg/deb ./"
assert fc == ec
def test_onap_repo(host):
os = host.system_info.distribution
if os == "centos":
- fc = host.file('/etc/yum.repos.d/moleculetestapp.repo').content_string
+ fc = host.file('/etc/yum.repos.d/moleculetestapp.repo'
+ ).content_string.strip()
expected_content = """[moleculetestapp]
baseurl = http://repo.infra-server/rpm
enabled = 1
assert fc == expected_content
elif os == "ubuntu":
fc = host.file('/etc/apt/sources.list.d/moleculetestapp.list')
- fc = fc.content_string
+ fc = fc.content_string.strip()
ec = "deb [trusted=yes] http://repo.infra-server/deb ./"
assert fc == ec
---
app_data_path: /opt/moleculeapp
-aux_data_path: "{{ app_data_path }}/runtime_images_source_dir"
+aux_data_path: "/opt/moleculeapp/runtime_images_source_dir"
resources_dir: /data
resources_filename: resources_package.tar
aux_resources_filename: aux_resources_package.tar
@pytest.fixture
def group_vars(host):
- all_file = "file=group_vars/all.yml name=all"
+ all_file = "file=molecule/default/group_vars/all.yml name=all"
return host.ansible("include_vars", all_file)["ansible_facts"]["all"]
ENV container docker
# Install necessary packages
-RUN apt-get update && apt-get -y install dbus systemd openssh-server iproute2 python3-docker
+RUN apt-get update && apt-get -y install dbus systemd openssh-server iproute2 python3-docker python3-apt
# Create symlink python3 -> python
RUN ln -s /usr/bin/python3 /usr/bin/python