Add molecule tests to containerd role (#6037)

This commit is contained in:
Maxime Guyot
2020-04-29 18:08:25 +02:00
committed by GitHub
parent db5f83f8c9
commit e4c820c35e
5 changed files with 74 additions and 3 deletions

View File

@@ -0,0 +1,21 @@
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_service(host):
svc = host.service("containerd")
assert svc.is_running
assert svc.is_enabled
def test_run(host):
crictl = "/usr/local/bin/crictl"
path = "unix:///var/run/containerd/containerd.sock"
with host.sudo():
cmd = host.command(crictl + " --runtime-endpoint " + path + " version")
assert cmd.rc == 0
assert "RuntimeName: containerd" in cmd.stdout