2019-05-12 14:13:18 +00:00
|
|
|
import os
|
|
|
|
|
|
|
|
import testinfra.utils.ansible_runner
|
|
|
|
|
|
|
|
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
2021-06-07 20:28:38 +00:00
|
|
|
os.environ["MOLECULE_INVENTORY_FILE"]
|
|
|
|
).get_hosts("all")
|
2019-05-12 14:13:18 +00:00
|
|
|
|
|
|
|
|
2019-10-16 20:00:10 +00:00
|
|
|
def test_docker_is_installed(host):
|
|
|
|
docker = host.package("docker")
|
|
|
|
assert docker.is_installed
|
|
|
|
|
2019-05-12 14:13:18 +00:00
|
|
|
|
2019-10-16 20:00:10 +00:00
|
|
|
def test_docker_running_and_enabled(host):
|
|
|
|
docker = host.service("docker")
|
|
|
|
assert docker.is_running
|
|
|
|
assert docker.is_enabled
|