Files @ 0004ec73b902
Branch filter:

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

branko
MAR-28: Implemented scaffolding for testing the mail_server role:

- Added Molecule configuration.
- Added test playbook.
- Restart Postfix for truststore changes.
- Added test data (private keys and certificates).
- Fixed small documentation inaccuracy.
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 == ""