mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
3a076fd585
* Replaced ".changed ==" with "is [not] changed". Same for failed
* Mr Quote refused to go
(cherry picked from commit d7e55db99b
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
115 lines
3.2 KiB
YAML
115 lines
3.2 KiB
YAML
# state=present
|
|
|
|
- name: Test addition - {{ method }}
|
|
flatpak:
|
|
name: org.gnome.Characters
|
|
remote: flathub
|
|
state: present
|
|
method: "{{ method }}"
|
|
register: addition_result
|
|
|
|
- name: Verify addition test result - {{ method }}
|
|
assert:
|
|
that:
|
|
- addition_result is changed
|
|
msg: "state=present shall add flatpak when absent"
|
|
|
|
- name: Test idempotency of addition - {{ method }}
|
|
flatpak:
|
|
name: org.gnome.Characters
|
|
remote: flathub
|
|
state: present
|
|
method: "{{ method }}"
|
|
register: double_addition_result
|
|
|
|
- name: Verify idempotency of addition test result - {{ method }}
|
|
assert:
|
|
that:
|
|
- double_addition_result is not changed
|
|
msg: "state=present shall not do anything when flatpak is already present"
|
|
|
|
# state=absent
|
|
|
|
- name: Test removal - {{ method }}
|
|
flatpak:
|
|
name: org.gnome.Characters
|
|
state: absent
|
|
method: "{{ method }}"
|
|
register: removal_result
|
|
|
|
- name: Verify removal test result - {{ method }}
|
|
assert:
|
|
that:
|
|
- removal_result is changed
|
|
msg: "state=absent shall remove flatpak when present"
|
|
|
|
- name: Test idempotency of removal - {{ method }}
|
|
flatpak:
|
|
name: org.gnome.Characters
|
|
state: absent
|
|
method: "{{ method }}"
|
|
register: double_removal_result
|
|
|
|
- name: Verify idempotency of removal test result - {{ method }}
|
|
assert:
|
|
that:
|
|
- double_removal_result is not changed
|
|
msg: "state=absent shall not do anything when flatpak is not present"
|
|
|
|
# state=present with url as name
|
|
|
|
- name: Test addition with url - {{ method }}
|
|
flatpak:
|
|
name: https://flathub.org/repo/appstream/org.gnome.Characters.flatpakref
|
|
remote: flathub
|
|
state: present
|
|
method: "{{ method }}"
|
|
register: url_addition_result
|
|
|
|
- name: Verify addition test result - {{ method }}
|
|
assert:
|
|
that:
|
|
- url_addition_result is changed
|
|
msg: "state=present with url as name shall add flatpak when absent"
|
|
|
|
- name: Test idempotency of addition with url - {{ method }}
|
|
flatpak:
|
|
name: https://flathub.org/repo/appstream/org.gnome.Characters.flatpakref
|
|
remote: flathub
|
|
state: present
|
|
method: "{{ method }}"
|
|
register: double_url_addition_result
|
|
|
|
- name: Verify idempotency of addition with url test result - {{ method }}
|
|
assert:
|
|
that:
|
|
- double_url_addition_result is not changed
|
|
msg: "state=present with url as name shall not do anything when flatpak is already present"
|
|
|
|
# state=absent with url as name
|
|
|
|
- name: Test removal with url - {{ method }}
|
|
flatpak:
|
|
name: https://flathub.org/repo/appstream/org.gnome.Characters.flatpakref
|
|
state: absent
|
|
method: "{{ method }}"
|
|
register: url_removal_result
|
|
|
|
- name: Verify removal test result - {{ method }}
|
|
assert:
|
|
that:
|
|
- url_removal_result is changed
|
|
msg: "state=absent with url as name shall remove flatpak when present"
|
|
|
|
- name: Test idempotency of removal with url - {{ method }}
|
|
flatpak:
|
|
name: https://flathub.org/repo/appstream/org.gnome.Characters.flatpakref
|
|
state: absent
|
|
method: "{{ method }}"
|
|
register: double_url_removal_result
|
|
|
|
- name: Verify idempotency of removal with url test result - {{ method }}
|
|
assert:
|
|
that:
|
|
- double_url_removal_result is not changed
|
|
msg: "state=absent with url as name shall not do anything when flatpak is not present"
|