mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-25 23:16:05 -03:30
Add Molecule to Docker role (#5129)
* Add Molecule for container-engine/docker * Add bootstrap-os to Molecule prepare stage
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import os
|
||||
|
||||
import testinfra.utils.ansible_runner
|
||||
|
||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
||||
|
||||
|
||||
def test_docker_service(host):
|
||||
docker = host.service("docker")
|
||||
assert docker.is_running
|
||||
assert docker.is_enabled
|
||||
|
||||
|
||||
def test_docker_run(host):
|
||||
with host.sudo():
|
||||
cmd = host.command("docker run hello-world")
|
||||
assert cmd.rc == 0
|
||||
assert "Hello from Docker!" in cmd.stdout
|
||||
Reference in New Issue
Block a user