Files @ 18f93a9a8b05
Branch filter:

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

branko
MAR-24: Implemented tests for 'database_server' role:

- Added Molecule configuration for single platform and instance.
- Added test playbook that deploys database_server role for testing.
- Fixed mode setting by appending leading zero.
- Ignore task that immediatelly restarts MariaDB database server.
- Implemented tests for the role covering full functionality.
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 == ""