You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
474 B

  1. import os
  2. import testinfra.utils.ansible_runner
  3. testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
  4. os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
  5. def test_docker_service(host):
  6. docker = host.service("docker")
  7. assert docker.is_running
  8. assert docker.is_enabled
  9. def test_docker_run(host):
  10. with host.sudo():
  11. cmd = host.command("docker run hello-world")
  12. assert cmd.rc == 0
  13. assert "Hello from Docker!" in cmd.stdout