Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
def test_ntp_is_installed(host):
p = host.package("ntp")
assert p.is_installed
def test_systemd_timesyncd_override(host):
f = host.file(
"/lib/systemd/system/systemd-timesyncd.service.d/disable-with-time-daemon.conf"
)
assert f.exists
assert f.contains("[Unit]")
assert f.contains("ConditionFileIsExecutable=!")
def test_systemd_timesyncd_disabled(host):
s = host.service("systemd-timesyncd")
assert not s.is_running
assert not s.is_enabled
def test_ntp_service(host):
s = host.service("ntp")
assert s.is_running
assert s.is_enabled