Files @ 0255167ebb5e
Branch filter:

Location: majic-ansible-roles/roles/backup/molecule/default/tests/test_parameters_optional.py

branko
MAR-132: Fixed creation of test LDAP entries mail_server role tests:

- Do not use the ldap_entries option of the ldap_server role.
- Invoke the ldap_entry and ldap_attr modules directly.
import os

import testinfra.utils.ansible_runner


testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
    os.environ['MOLECULE_INVENTORY_FILE']).get_hosts(['parameters-optional'])


def test_backup_patterns_content(host):
    """
    Tests if content of file containing backup patterns is correct.
    """

    with host.sudo():

        backup_pattern = host.file('/etc/duply/main/patterns/test')

        assert backup_pattern.content == "/etc/hosts\n/etc/ethers\n/var/log"


def test_include_content(host):
    """
    Tests if content of assembled include file containing backup patterns is
    correct.
    """

    with host.sudo():

        include = host.file('/etc/duply/main/include')

        assert include.content == "/etc/hosts\n/etc/ethers\n/var/log"