zuul-registry/playbooks/functional-test/podman.yaml
Ian Wienand 329f0a5195 podman: make sure we remove the pulled image
Currently we pull test/image here but do not clean it out.  This
interferes with the buildset-registry podman tests that happen
afterwards when using podman 3.4.  It's unclear if this is a feature
or a bug, see [1].

[1] https://github.com/containers/podman/issues/13383

Change-Id: I722ba599fbc690d6cb967070c05215b98a73dcaf
2022-03-04 06:45:21 +11:00

65 lines
2.0 KiB
YAML

# Test push and pull from the standard registry
- name: Start the registry
shell:
cmd: docker-compose up -d
chdir: "{{ ansible_user_dir }}/src/opendev.org/zuul/zuul-registry/playbooks/functional-test"
- name: Print list of images
command: podman image ls --all --digests --no-trunc
register: image_list
failed_when: "'test/image' in image_list.stdout"
- name: Copy the test image into local containers image storage
command: >
skopeo copy
docker-archive:{{ workspace }}/test.img
containers-storage:localhost:9000/test/image:latest
- name: Log in to registry
command: podman login localhost:9000 -u testuser -p testpass
- name: Push the test image to the registry
# Use a lot of concurrency to check registry with concurrent pushes
shell: printf "1\n2\n3\n4\n" | xargs -P 4 -I DNE podman push localhost:9000/test/image
args:
executable: /bin/bash
- name: Remove the test image from the local cache
command: podman rmi localhost:9000/test/image
- name: Clean up the local image cache
command: podman image prune -f
- name: Print list of images
command: podman image ls --all --digests --no-trunc
register: image_list
failed_when: "'test/image' in image_list.stdout"
- name: Pull the image from the registry
command: podman pull localhost:9000/test/image
- name: Print list of images
command: podman image ls --all --digests --no-trunc
register: image_list
failed_when: "'test/image' not in image_list.stdout"
- name: Remove the test image from the local cache, again
command: podman rmi localhost:9000/test/image
- name: Try to pull an image that does not exist
command: podman pull localhost:9000/test/dne
register: result
failed_when: result.rc != 125
- name: Stop the registry
shell:
cmd: docker-compose down
chdir: "{{ ansible_user_dir }}/src/opendev.org/zuul/zuul-registry/playbooks/functional-test"
- name: Clean up podman volumes
command: podman volume prune -f
- name: Log out of registry
command: podman logout localhost:9000