Files @ 01f4b619cfa6
Branch filter:

Location: majic-ansible-roles/roles/backup_server/tests/test_parameters_mandatory.py

branko
MAR-27: Update mail_forwarder role/tests:

- Install swaks on mail-server instance for testing SMTP.
- Install procmail via mail_forwarder role (needed to be explicit for Debian
Stretch).
- Introduce small sleep when mails are sent to localhost for delivery to remote
hosts before checking the logs in order to allow Postfix to process the
queue.
import testinfra.utils.ansible_runner


testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
    '.molecule/ansible_inventory').get_hosts('parameters-mandatory')


def test_firewall_configuration(File, Sudo):
    """
    Tests if the firewall configuration file has been deployed correctly.
    """

    with Sudo():

        firewall_config = File('/etc/ferm/conf.d/40-backup.conf')

        assert firewall_config.is_file
        assert firewall_config.user == 'root'
        assert firewall_config.group == 'root'
        assert firewall_config.mode == 0o640
        assert firewall_config.content == ""