From db9e52ce8e083e529c0a3af001b91aeb3f1dbb0d Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Fri, 22 Apr 2022 18:08:54 +0100 Subject: [PATCH] tests: Run containers on macOS with podman, instead of Docker --- .../issue_655__wait_for_connection_error.yml | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/tests/ansible/regression/issue_655__wait_for_connection_error.yml b/tests/ansible/regression/issue_655__wait_for_connection_error.yml index 307dead5..cf0ff359 100644 --- a/tests/ansible/regression/issue_655__wait_for_connection_error.yml +++ b/tests/ansible/regression/issue_655__wait_for_connection_error.yml @@ -13,36 +13,33 @@ - name: set up test container and run tests inside it block: - name: install deps - block: - - name: install docker - shell: | - # NOTE: for tracking purposes: https://github.com/docker/for-mac/issues/2359 - # using docker for mac CI workaround: https://github.com/drud/ddev/pull/1748/files#diff-19288f650af2dabdf1dcc5b354d1f245 - DOCKER_URL=https://download.docker.com/mac/stable/31259/Docker.dmg && - curl -O -sSL $DOCKER_URL && - open -W Docker.dmg && cp -r /Volumes/Docker/Docker.app /Applications - sudo /Applications/Docker.app/Contents/MacOS/Docker --quit-after-install --unattended && - ln -s /Applications/Docker.app/Contents/Resources/bin/docker /usr/local/bin/docker && - nohup /Applications/Docker.app/Contents/MacOS/Docker --unattended & - # wait 2 min for docker to come up - counter=0 && - while ! /usr/local/bin/docker ps 2>/dev/null ; do - if [ $counter -lt 24 ]; then - let counter=counter+1 - else - exit 1 - fi - sleep 5 - done + homebrew: + name: + - podman + state: present + + - name: start machine + command: + cmd: "{{ item.cmd }}" + loop: + - cmd: podman machine init + - cmd: podman machine start + - cmd: podman info + timeout: 300 + register: podman_machine + + - debug: + var: podman_machine # python bindings (docker_container) aren't working on this host, so gonna shell out - - name: create docker container - shell: /usr/local/bin/docker run --name testMitogen -d --rm centos:8 bash -c "sleep infinity & wait" + - name: create container + command: + cmd: podman run --name testMitogen -d --rm centos:8 bash -c "sleep infinity & wait" - name: add container to inventory add_host: name: testMitogen - ansible_connection: docker + ansible_connection: podman ansible_user: root changed_when: false environment: @@ -82,6 +79,10 @@ PATH: /usr/local/bin/:{{ ansible_env.PATH }} - name: remove test container - shell: /usr/local/bin/docker stop testMitogen + command: + cmd: "{{ item.cmd }}" + loop: + - cmd: podman stop testMitogen + - cmd: podman machine stop tags: - issue_655