Files
@ 31266c192d58
Branch filter:
Location: majic-ansible-roles/roles/ldap_server/molecule/default/tests/test_default_bullseye.py - annotation
31266c192d58
1.1 KiB
text/x-python
MAR-238: Preparing for release 8.0.1.
3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf 3d1e72c4cbaf | import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('parameters-*-bullseye')
def test_log_rotation_configuration(host):
"""
Tests if log rotation configuration file has been deployed correctly and has
valid syntax.
"""
config = host.file('/etc/logrotate.d/slapd')
assert config.is_file
assert config.user == 'root'
assert config.group == 'root'
assert config.mode == 0o644
with host.sudo():
assert host.run('logrotate /etc/logrotate.d/slapd').rc == 0
def test_syslog_configuration(host):
"""
Tests if syslog configuration file has been deployed, and log file was
created correctly (and is being logged to).
"""
config = host.file('/etc/rsyslog.d/slapd.conf')
assert config.is_file
assert config.user == 'root'
assert config.group == 'root'
assert config.mode == 0o644
with host.sudo():
log = host.file('/var/log/slapd.log')
assert log.is_file
assert 'slapd' in log.content_string
|