0ce552de40
This runs equivalent tests on the registry in the standard (ie, intermediate) configuration using both docker and podman. A later change will add the same for running the registry in the namespaced (ie, buildset) configuration. Change-Id: Ieeb1e7a75f6ca931d2275e3306f987aea2ba677f
59 lines
1.8 KiB
YAML
59 lines
1.8 KiB
YAML
# Test push and pull from the standard registry
|
|
|
|
- name: Start the standard registry
|
|
shell:
|
|
cmd: docker-compose -f standard-compose.yaml up -d
|
|
chdir: "{{ ansible_user_dir }}/src/opendev.org/zuul/zuul-registry/playbooks/functional-test"
|
|
|
|
- name: Print list of images
|
|
command: docker image ls --all --digests --no-trunc
|
|
register: image_list
|
|
failed_when: "'test/image' in image_list.stdout"
|
|
|
|
- name: Copy the test image into local docker image storage
|
|
command: >
|
|
skopeo copy
|
|
docker-archive:{{ workspace }}/test.img
|
|
docker-daemon:localhost:9000/test/image:latest
|
|
|
|
- name: Log in to registry
|
|
command: docker login localhost:9000 -u testuser -p testpass
|
|
|
|
- name: Push the test image to the standard registry
|
|
command: docker push localhost:9000/test/image
|
|
|
|
- name: Remove the test image from the local cache
|
|
command: docker rmi localhost:9000/test/image
|
|
|
|
- name: Clean up the local image cache
|
|
command: docker image prune -f
|
|
|
|
- name: Print list of images
|
|
command: docker image ls --all --digests --no-trunc
|
|
register: image_list
|
|
failed_when: "'test/image' in image_list.stdout"
|
|
|
|
- name: Pull the image from the standard registry
|
|
command: docker pull localhost:9000/test/image
|
|
|
|
- name: Print list of images
|
|
command: docker image ls --all --digests --no-trunc
|
|
register: image_list
|
|
failed_when: "'test/image' not in image_list.stdout"
|
|
|
|
- name: Try to pull an image that does not exist
|
|
command: docker pull localhost:9000/test/dne
|
|
register: result
|
|
failed_when: result.rc != 1
|
|
|
|
- name: Stop the standard registry
|
|
shell:
|
|
cmd: docker-compose -f standard-compose.yaml down
|
|
chdir: "{{ ansible_user_dir }}/src/opendev.org/zuul/zuul-registry/playbooks/functional-test"
|
|
|
|
- name: Clean up docker volumes
|
|
command: docker volume prune -f
|
|
|
|
- name: Log out of registry
|
|
command: docker logout localhost:9000
|