17 lines
426 B
Python
17 lines
426 B
Python
|
import os
|
||
|
|
||
|
import testinfra.utils.ansible_runner
|
||
|
|
||
|
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||
|
os.environ["MOLECULE_INVENTORY_FILE"]
|
||
|
).get_hosts("all")
|
||
|
|
||
|
|
||
|
def test_chrony_running_and_enabled(host):
|
||
|
command = "XDG_RUNTIME_DIR=/run/user/$(id -u) systemctl --user is-enabled chrony.service"
|
||
|
|
||
|
with host.sudo(user="chrony"):
|
||
|
status = host.check_output(command)
|
||
|
|
||
|
assert status == "enabled"
|