Files
@ 13982172ed2e
Branch filter:
Location: majic-ansible-roles/roles/backup/molecule/default/tests/test_default.py - annotation
13982172ed2e
887 B
text/x-python
MAR-129: Updated mail_forwarder role for new Ansible and Molecule versions:
- Moved variables out of test playbook into group_vars.
- Fixed linting issues.
- Use top-level linting configuration file in tests.
- Updated how the hosts are referenced when executing the tests.
- Moved variables out of test playbook into group_vars.
- Fixed linting issues.
- Use top-level linting configuration file in tests.
- Updated how the hosts are referenced when executing the tests.
6354365357f2 6354365357f2 e1dd478473a2 6354365357f2 d0293eece376 6354365357f2 6354365357f2 d0293eece376 e1dd478473a2 e1dd478473a2 e1dd478473a2 e1dd478473a2 d0293eece376 e1dd478473a2 d0293eece376 e1dd478473a2 e1dd478473a2 e1dd478473a2 e1dd478473a2 e1dd478473a2 e1dd478473a2 e1dd478473a2 d0293eece376 e1dd478473a2 e1dd478473a2 e1dd478473a2 e1dd478473a2 d0293eece376 e1dd478473a2 d0293eece376 6354365357f2 e1dd478473a2 e1dd478473a2 e1dd478473a2 e1dd478473a2 | import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
'.molecule/ansible_inventory.yml').get_hosts('all')
def test_backup_patterns_file(host):
"""
Tests if deployed file with backup patterns has correct permissions.
"""
with host.sudo():
backup_pattern = host.file('/etc/duply/main/patterns/test')
assert backup_pattern.is_file
assert backup_pattern.user == 'root'
assert backup_pattern.group == 'root'
assert backup_pattern.mode == 0o600
def test_include_file(host):
"""
Tests if assembled include file has correct permissions.
"""
with host.sudo():
include = host.file('/etc/duply/main/include')
assert include.is_file
assert include.user == 'root'
assert include.group == 'root'
assert include.mode == 0o600
|