Skip to content

Commit d46189c

Browse files
committed
Verify that the docker-cli and containerd are installed properly
1 parent 74681ef commit d46189c

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import os
2+
import testinfra.utils.ansible_runner
3+
4+
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
5+
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
6+
7+
8+
def test_containerd_installed(host):
9+
10+
assert host.package('containerd.io').is_installed
11+
12+
13+
def test_containerd_service(host):
14+
15+
s = host.service('containerd')
16+
assert s.is_running
17+
assert s.is_enabled
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import os
2+
import testinfra.utils.ansible_runner
3+
4+
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
5+
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
6+
7+
8+
def test_docker_cli_installed(host):
9+
10+
assert host.package('docker-ce-cli').is_installed

molecule/resources/tests/test_docker_engine.py

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
55
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
66

7+
debian_os = ['debian', 'ubuntu']
8+
rhel_os = ['redhat', 'centos']
9+
710

811
def test_docker_ce_config(host):
912

0 commit comments

Comments
 (0)