* Add integration test for #35900 * Fix cleanup
This commit is contained in:
parent
8199b448e8
commit
f666208b75
3 changed files with 52 additions and 1 deletions
|
@ -34,9 +34,39 @@
|
||||||
- "dpkg_result is success"
|
- "dpkg_result is success"
|
||||||
- "'1.0.1' in dpkg_result.stdout"
|
- "'1.0.1' in dpkg_result.stdout"
|
||||||
|
|
||||||
|
# https://github.com/ansible/ansible/issues/35900
|
||||||
|
- name: Clean up
|
||||||
|
apt:
|
||||||
|
name: foo
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Install foobar, installs foo as a dependency
|
||||||
|
apt:
|
||||||
|
name: foobar=1.0.0
|
||||||
|
allow_unauthenticated: yes
|
||||||
|
|
||||||
|
- name: Upgrade foobar to a version which does not depend on foo, autoremove should remove foo
|
||||||
|
apt:
|
||||||
|
upgrade: dist
|
||||||
|
autoremove: yes
|
||||||
|
force: yes # workaround for --allow-unauthenticated used along with upgrade
|
||||||
|
|
||||||
|
- name: Check foo with dpkg
|
||||||
|
shell: dpkg-query -l foo
|
||||||
|
register: dpkg_result
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
|
- name: Check that foo was removed by autoremove
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- "dpkg_result is failed"
|
||||||
|
|
||||||
always:
|
always:
|
||||||
- name: Clean up
|
- name: Clean up
|
||||||
apt:
|
apt:
|
||||||
name: foo
|
name: "{{ item }}"
|
||||||
state: absent
|
state: absent
|
||||||
allow_unauthenticated: yes
|
allow_unauthenticated: yes
|
||||||
|
with_items:
|
||||||
|
- foo
|
||||||
|
- foobar
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
Section: misc
|
||||||
|
Priority: optional
|
||||||
|
Standards-Version: 2.3.3
|
||||||
|
|
||||||
|
Package: foobar
|
||||||
|
Version: 1.0.0
|
||||||
|
Section: system
|
||||||
|
Depends: foo
|
||||||
|
Maintainer: John Doe <john@doe.com>
|
||||||
|
Architecture: all
|
||||||
|
Description: Dummy package
|
|
@ -0,0 +1,10 @@
|
||||||
|
Section: misc
|
||||||
|
Priority: optional
|
||||||
|
Standards-Version: 2.3.3
|
||||||
|
|
||||||
|
Package: foobar
|
||||||
|
Version: 1.0.1
|
||||||
|
Section: system
|
||||||
|
Maintainer: John Doe <john@doe.com>
|
||||||
|
Architecture: all
|
||||||
|
Description: Dummy package
|
Loading…
Reference in a new issue