xoxys.dockerengine/molecule/default/tests/test_default.py

19 lines
422 B
Python
Raw Normal View History

2024-01-25 09:04:31 +00:00
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
2024-02-15 09:29:24 +00:00
def test_docker_is_installed(host):
docker = host.package("docker-ce")
assert docker.is_installed
2024-01-25 09:04:31 +00:00
2024-02-15 09:29:24 +00:00
def test_docker_running_and_enabled(host):
docker = host.service("docker")
assert docker.is_running
assert docker.is_enabled