Files
@ da53a3aa5208
Branch filter:
Location: majic-ansible-roles/roles/backup/molecule/default/tests/test_default.py - annotation
da53a3aa5208
911 B
text/x-python
MAR-218: Fix the test run logic in test runner script:
- Linter tests should _always_ be run.
- Test report files should be appended to when using tee.
- Get rid of excess molecule destroy (probably not required any
longer). This will reduce the output and speed up things a little
bit.
- Linter tests should _always_ be run.
- Test report files should be appended to when using tee.
- Get rid of excess molecule destroy (probably not required any
longer). This will reduce the output and speed up things a little
bit.
19b29f0c7e7e 19b29f0c7e7e 6354365357f2 6354365357f2 e1dd478473a2 6354365357f2 d62b3adec462 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 os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('parameters-*')
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
|