ansible-role-keepalived/molecule/default/tests/test_default.py

22 lines
589 B
Python
Raw Normal View History

2020-03-28 21:31:50 +00:00
import testinfra.utils.ansible_runner
def test_packages(host):
package = host.package('keepalived')
assert package.is_installed
def test_config_file(host):
path = host.file('/etc/keepalived/keepalived.conf')
assert path.exists
assert path.is_file
assert path.user == 'root'
assert path.group == 'root'
assert path.mode == 0o600
assert path.contains('priority 200')
assert path.contains('interval 10')
2021-11-05 09:06:32 +00:00
assert path.contains('track_file master {')
2020-03-28 21:31:50 +00:00
def test_service(host):
service = host.service('keepalived')
assert service.is_running
assert service.is_enabled