1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-02-04 07:11:49 +00:00
ansible-podman-collections/tests/integration/targets/podman_image_info/tasks/main.yml
Sergey f41939d8d8
Replace image in tests from quay.io (#948)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-07-12 16:38:54 +03:00

76 lines
2.4 KiB
YAML

- name: Test podman_image_info
block:
- name: Get info on images when no images
containers.podman.podman_image_info:
executable: "{{ test_executable | default('podman') }}"
register: info_0
- name: Check results for no images
assert:
that:
- info_0.images | length == 0
- name: Pull image
command: podman pull quay.io/coreos/etcd:v3.5.19
- name: Get info on all images
containers.podman.podman_image_info:
executable: "{{ test_executable | default('podman') }}"
register: all_image_result
- name: Pull another image
command: podman pull quay.io/sshnaidm1/python:3.12-slim
- name: Get info on specific image
containers.podman.podman_image_info:
executable: "{{ test_executable | default('podman') }}"
name: quay.io/sshnaidm1/python:3.12-slim
register: named_image_result
- name: Check results
assert:
that:
- all_image_result.images | length > 0
- named_image_result.images | length == 1
- "'quay.io/sshnaidm1/python:3.12-slim' in named_image_result.images[0]['RepoTags'][0]"
- name: Get info on single image that does not exist
containers.podman.podman_image_info:
executable: "{{ test_executable | default('podman') }}"
name: nope
register: single_nonexistent
- name: Get info on multiple images that do not exist
containers.podman.podman_image_info:
executable: "{{ test_executable | default('podman') }}"
name:
- nope
- reallynope
register: multiple_nonexistent
- name: Get info with one image that does not exist
containers.podman.podman_image_info:
executable: "{{ test_executable | default('podman') }}"
name:
- quay.io/sshnaidm1/python:3.12-slim
- nope
- quay.io/coreos/etcd:v3.5.19
register: mixed_nonexistent
- name: Ensure image info was returned when non-existent image info was requisted
assert:
that:
- single_nonexistent.images | length == 0
- multiple_nonexistent.images | length == 0
- mixed_nonexistent.images | length == 2
always:
- name: Remove images
containers.podman.podman_image:
executable: "{{ test_executable | default('podman') }}"
name: "{{ item }}"
state: absent
loop:
- quay.io/coreos/etcd:v3.5.19
- quay.io/sshnaidm1/python:3.12-slim