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_logout/tasks/main.yml
Sergey 9cffa671c8
Fix podman logout for newer Podman (#969)
Fix #935

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-08-18 23:15:41 +03:00

55 lines
1.5 KiB
YAML

- name: Test podman_logout
block:
- name: Print podman version
command: podman version
- name: Logout from docker if it exists
command: docker logout
ignore_errors: true
- name: Log out with invalid executable
containers.podman.podman_logout:
executable: podman_invalid
register: invalid_executable
ignore_errors: true
- name: Check invalid executable results
assert:
that:
- invalid_executable is failed
- name: Log out of non-existing registry
containers.podman.podman_logout:
executable: "{{ test_executable | default('podman') }}"
register: non_existing_registry
- name: Check results
assert:
that:
- "'changed' in non_existing_registry"
- "non_existing_registry.changed == False"
- name: Log out with invalid authfile
containers.podman.podman_logout:
executable: "{{ test_executable | default('podman') }}"
authfile: authfile_invalid.json
register: invalid_authfile
ignore_errors: true
- name: Check invalid authfile results
assert:
that:
- invalid_authfile is failed
- name: Log out of all registries
containers.podman.podman_logout:
executable: "{{ test_executable | default('podman') }}"
all: true
register: all_registries
- name: Check results
assert:
that:
- "'changed' in all_registries"
- "all_registries.changed == True"