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
533 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_run_pod(host):
  6. run_command = "/usr/local/bin/crictl run --with-pull /tmp/container.json /tmp/sandbox.json"
  7. with host.sudo():
  8. cmd = host.command(run_command)
  9. assert cmd.rc == 0
  10. with host.sudo():
  11. log_f = host.file("/tmp/cri-dockerd1.0.log")
  12. assert log_f.exists
  13. assert b"Hello from Docker" in log_f.content