summaryrefslogtreecommitdiff
path: root/test/integration/targets/apt
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/apt')
-rw-r--r--test/integration/targets/apt/aliases1
-rw-r--r--test/integration/targets/apt/tasks/apt.yml51
-rw-r--r--test/integration/targets/apt/tasks/repo.yml2
3 files changed, 52 insertions, 2 deletions
diff --git a/test/integration/targets/apt/aliases b/test/integration/targets/apt/aliases
index 5f892f9c..20c87093 100644
--- a/test/integration/targets/apt/aliases
+++ b/test/integration/targets/apt/aliases
@@ -1,6 +1,5 @@
shippable/posix/group2
destructive
skip/freebsd
-skip/osx
skip/macos
skip/rhel
diff --git a/test/integration/targets/apt/tasks/apt.yml b/test/integration/targets/apt/tasks/apt.yml
index d273eda7..a0bc1992 100644
--- a/test/integration/targets/apt/tasks/apt.yml
+++ b/test/integration/targets/apt/tasks/apt.yml
@@ -372,7 +372,7 @@
- libcaca-dev
- libslang2-dev
-# https://github.com/ansible/ansible/issues/38995
+# # https://github.com/ansible/ansible/issues/38995
- name: build-dep for a package
apt:
name: tree
@@ -524,6 +524,55 @@
- "allow_change_held_packages_no_update is not changed"
- "allow_change_held_packages_hello_version.stdout == allow_change_held_packages_hello_version_again.stdout"
+# Remove pkg on hold
+- name: Put hello on hold
+ shell: apt-mark hold hello
+
+- name: Get hold list
+ shell: apt-mark showhold
+ register: hello_hold
+
+- name: Check that the package hello is on the hold list
+ assert:
+ that:
+ - "'hello' in hello_hold.stdout"
+
+- name: Try removing package hello
+ apt:
+ name: hello
+ state: absent
+ register: package_removed
+ ignore_errors: true
+
+- name: verify the package is not removed with dpkg
+ shell: dpkg -l hello
+ register: dpkg_result
+
+- name: Verify that package was not removed
+ assert:
+ that:
+ - package_removed is failed
+ - dpkg_result is success
+
+- name: Try removing package (allow_change_held_packages=yes)
+ apt:
+ name: hello
+ state: absent
+ allow_change_held_packages: yes
+ register: package_removed
+
+- name: verify the package is removed with dpkg
+ shell: dpkg -l hello
+ register: dpkg_result
+ ignore_errors: true
+
+- name: Verify that package removal was succesfull
+ assert:
+ that:
+ - package_removed is success
+ - dpkg_result is failed
+ - package_removed.changed
+
# Virtual package
- name: Install a virtual package
apt:
diff --git a/test/integration/targets/apt/tasks/repo.yml b/test/integration/targets/apt/tasks/repo.yml
index d4cce78a..b1d08afa 100644
--- a/test/integration/targets/apt/tasks/repo.yml
+++ b/test/integration/targets/apt/tasks/repo.yml
@@ -400,6 +400,8 @@
- { upgrade_type: safe, force_apt_get: True }
- { upgrade_type: full, force_apt_get: True }
+ - include_tasks: "upgrade_scenarios.yml"
+
- name: Remove aptitude if not originally present
apt:
pkg: aptitude