Debian Codegraph @

ansible_collections/containers/podman/tests/integration/targets/podman_login_info/tasks/main.yml

raw
1 - name: Test podman_login_info
2 block:
3
4 - name: Print podman version
5 command: podman version
6
7 - name: Get login info with invalid executable
8 containers.podman.podman_login_info:
9 executable: podman_invalid
10 registry: quay.io
11 register: invalid_executable
12 ignore_errors: true
13
14 - name: Check invalid executable results
15 assert:
16 that:
17 - invalid_executable is failed
18
19 - name: Get login info without specifying registry
20 containers.podman.podman_login_info:
21 executable: podman_invalid
22 register: missing_registry
23 ignore_errors: true
24
25 - name: Check missing registry results
26 assert:
27 that:
28 - missing_registry is failed
29
30 - name: Get login info for a non-existing registry
31 containers.podman.podman_login_info:
32 executable: "{{ test_executable | default('podman') }}"
33 registry: non-existing.registry
34 register: non_existing_registry
35
36 - name: Check non-existing registry results
37 assert:
38 that:
39 - "'login' in non_existing_registry"
40 - non_existing_registry.login is not none
41 - non_existing_registry.login != {}
42 - non_existing_registry.login | length > 0
43 - "'registry' in non_existing_registry.login"
44 - "'username' in non_existing_registry.login"
45 - "'logged_in' in non_existing_registry.login"
46 - "non_existing_registry.login.registry == 'non-existing.registry'"
47 - "non_existing_registry.login.username == ''"
48 - "non_existing_registry.login.logged_in == False"
49
50 - name: Get login info for a non-existing authfile
51 # This will return not logged in even if logged in via different authfile
52 containers.podman.podman_login_info:
53 executable: "{{ test_executable | default('podman') }}"
54 registry: quay.io
55 authfile: non-existing.authfile.json
56 register: non_existing_authfile
57
58 - name: Check non-existing authfile results
59 assert:
60 that:
61 - "'login' in non_existing_authfile"
62 - non_existing_authfile.login is not none
63 - non_existing_authfile.login != {}
64 - non_existing_authfile.login | length > 0
65 - "'username' in non_existing_authfile.login"
66 - "'logged_in' in non_existing_authfile.login"
67 - "non_existing_authfile.login.username == ''"
68 - "non_existing_authfile.login.logged_in == False"