diff options
author | Brian Coca <bcoca@ansible.com> | 2015-02-16 19:15:34 -0500 |
---|---|---|
committer | Brian Coca <bcoca@ansible.com> | 2015-02-16 19:15:34 -0500 |
commit | 1861be8f3122cfbce28032acf4024c4d83360364 (patch) | |
tree | 888206cc56ab42124c846fda24aa2895fe685c2f | |
parent | 6f6c6fb32a8a8824259dafeef8161ae7df6c0bfd (diff) | |
parent | 7e95da29303a007d9dd7ebe913f41425506eaa72 (diff) | |
download | ansible-1861be8f3122cfbce28032acf4024c4d83360364.tar.gz |
Merge pull request #9957 from hfinucane/apt-deb-tests
Add tests for using .deb files
-rw-r--r-- | test/integration/roles/test_apt/tasks/apt.yml | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/integration/roles/test_apt/tasks/apt.yml b/test/integration/roles/test_apt/tasks/apt.yml index 5457c2ef78..c02a1bd4a0 100644 --- a/test/integration/roles/test_apt/tasks/apt.yml +++ b/test/integration/roles/test_apt/tasks/apt.yml @@ -1,3 +1,5 @@ + + # UNINSTALL 'python-apt' # The `apt` module has the smarts to auto-install `python-apt`. To test, we # will first uninstall `python-apt`. @@ -101,3 +103,38 @@ - "apt_result.changed" - "dpkg_result.rc == 0" +- name: check hello version + shell: dpkg -s hello | grep Version | sed -r 's/Version:\s+([a-zA-Z0-9.-]+)\s*$/\1/' + register: hello_version +- name: check hello architecture + shell: dpkg -s hello | grep Architecture | sed -r 's/Architecture:\s+([a-zA-Z0-9.-]+)\s*$/\1/' + register: hello_architecture + +- name: uninstall hello with apt + apt: pkg=hello state=absent purge=yes + +- name: install deb file + apt: deb="/var/cache/apt/archives/hello_{{ hello_version.stdout }}_{{ hello_architecture.stdout }}.deb" + register: apt_initial + +- name: install deb file again + apt: deb="/var/cache/apt/archives/hello_{{ hello_version.stdout }}_{{ hello_architecture.stdout }}.deb" + register: apt_secondary + +- name: verify installation of hello + assert: + that: + - "apt_initial.changed" + - "not apt_secondary.changed" + +- name: uninstall hello with apt + apt: pkg=hello state=absent purge=yes + +- name: force install of deb + apt: deb="/var/cache/apt/archives/hello_{{ hello_version.stdout }}_{{ hello_architecture.stdout }}.deb" force=true + register: dpkg_force + +- name: verify installation of hello + assert: + that: + - "dpkg_force.changed" |