diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:04:21 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:04:21 +0000 |
commit | 8a754e0858d922e955e71b253c139e071ecec432 (patch) | |
tree | 527d16e74bfd1840c85efd675fdecad056c54107 /test/integration/targets/dpkg_selections/tasks/dpkg_selections.yaml | |
parent | Initial commit. (diff) | |
download | ansible-core-8a754e0858d922e955e71b253c139e071ecec432.tar.xz ansible-core-8a754e0858d922e955e71b253c139e071ecec432.zip |
Adding upstream version 2.14.3.upstream/2.14.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | test/integration/targets/dpkg_selections/tasks/dpkg_selections.yaml | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/test/integration/targets/dpkg_selections/tasks/dpkg_selections.yaml b/test/integration/targets/dpkg_selections/tasks/dpkg_selections.yaml new file mode 100644 index 0000000..080db26 --- /dev/null +++ b/test/integration/targets/dpkg_selections/tasks/dpkg_selections.yaml @@ -0,0 +1,89 @@ +- name: download and install old version of hello + apt: "deb=https://ci-files.testing.ansible.com/test/integration/targets/dpkg_selections/hello_{{ hello_old_version }}_amd64.deb" + +- name: freeze version for hello + dpkg_selections: + name: hello + selection: hold + +- name: get dpkg selections + shell: "dpkg --get-selections | grep hold" + register: result + +- debug: var=result + +- name: check that hello is marked as hold + assert: + that: + - "'hello' in result.stdout" + +- name: attempt to upgrade hello + apt: + name: hello + state: latest + ignore_errors: yes + +- name: check hello version + shell: dpkg -s hello | grep Version | awk '{print $2}' + register: hello_version + +- name: ensure hello was not upgraded + assert: + that: + - hello_version.stdout == hello_old_version + +- name: remove version freeze + dpkg_selections: + name: hello + selection: install + +- name: upgrade hello + apt: + name: hello + state: latest + +- name: check hello version + shell: dpkg -s hello | grep Version | awk '{print $2}' + register: hello_version + +- name: check that old version upgraded correctly + assert: + that: + - hello_version.stdout != hello_old_version + +- name: set hello to deinstall + dpkg_selections: + name: hello + selection: deinstall + +- name: get dpkg selections + shell: "dpkg --get-selections | grep deinstall" + register: result + +- debug: var=result + +- name: check that hello is marked as deinstall + assert: + that: + - "'hello' in result.stdout" + +- name: set hello to purge + dpkg_selections: + name: hello + selection: purge + +- name: get dpkg selections + shell: "dpkg --get-selections | grep purge" + register: result + +- debug: var=result + +- name: check that hello is marked as purge + assert: + that: + - "'hello' in result.stdout" + +- name: remove hello + apt: + name: hello + state: absent |