summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Krizek <martin.krizek@gmail.com>2019-10-23 21:02:25 +0200
committerGitHub <noreply@github.com>2019-10-23 21:02:25 +0200
commit18b9ce8b823aaca25e36bab63792d2117a2a8851 (patch)
tree48544c4754a8864f4fac549e56d334def71d7ecb
parentd620a209a5935aff190e74057ad4e30fa9dcefb4 (diff)
downloadansible-18b9ce8b823aaca25e36bab63792d2117a2a8851.tar.gz
Integration tests: prevent loop squashing (#63847)
1. the feature will be deprecated in 2.11 2. these modules support passing lists 3. loop squashing does not work with collections
-rw-r--r--test/integration/targets/apt/tasks/apt.yml9
-rw-r--r--test/integration/targets/dnf/tasks/dnf.yml4
-rw-r--r--test/integration/targets/pip/tasks/pip.yml10
-rw-r--r--test/integration/targets/yum/tasks/repo.yml18
-rw-r--r--test/integration/targets/yum/tasks/yum.yml5
-rw-r--r--test/integration/targets/yum/tasks/yum_group_remove.yml18
6 files changed, 29 insertions, 35 deletions
diff --git a/test/integration/targets/apt/tasks/apt.yml b/test/integration/targets/apt/tasks/apt.yml
index 9a51a7609e..f9fcdfe3d0 100644
--- a/test/integration/targets/apt/tasks/apt.yml
+++ b/test/integration/targets/apt/tasks/apt.yml
@@ -283,11 +283,12 @@
- name: Clean up
apt:
- name: "{{ item }}"
+ name: "{{ pkgs }}"
state: absent
- with_items:
- - libcaca-dev
- - libslang2-dev
+ vars:
+ pkgs:
+ - libcaca-dev
+ - libslang2-dev
# https://github.com/ansible/ansible/issues/38995
- name: build-dep for a package
diff --git a/test/integration/targets/dnf/tasks/dnf.yml b/test/integration/targets/dnf/tasks/dnf.yml
index 0b013d0e10..9ae8f84796 100644
--- a/test/integration/targets/dnf/tasks/dnf.yml
+++ b/test/integration/targets/dnf/tasks/dnf.yml
@@ -197,9 +197,7 @@
- name: install non-existent rpm
dnf:
- name: "{{ item }}"
- with_items:
- - does-not-exist
+ name: does-not-exist
register: non_existent_rpm
ignore_errors: True
diff --git a/test/integration/targets/pip/tasks/pip.yml b/test/integration/targets/pip/tasks/pip.yml
index 3ff453289c..3dd451a630 100644
--- a/test/integration/targets/pip/tasks/pip.yml
+++ b/test/integration/targets/pip/tasks/pip.yml
@@ -80,16 +80,8 @@
- name: now put it back in case someone wanted it (like us!)
pip:
- name: "{{ item }}"
+ name: "{{ pip_test_packages }}"
state: present
- with_items: "{{ pip_test_packages }}"
- register: squash_param
-
-- name: check that list has been condensed
- assert:
- that:
- - squash_param.results|length == 1
- - squash_param.results[0].name|sort == pip_test_packages|sort
# Test virtualenv installations
diff --git a/test/integration/targets/yum/tasks/repo.yml b/test/integration/targets/yum/tasks/repo.yml
index 6334a385fd..630659d4a9 100644
--- a/test/integration/targets/yum/tasks/repo.yml
+++ b/test/integration/targets/yum/tasks/repo.yml
@@ -385,11 +385,12 @@
- name: install dinginessentail both archs
yum:
- name: "{{ item }}"
+ name: "{{ pkgs }}"
state: present
- with_items:
- - "{{ repodir }}/dinginessentail-1.1-1.x86_64.rpm"
- - "{{ repodir_i686 }}/dinginessentail-1.1-1.i686.rpm"
+ vars:
+ pkgs:
+ - "{{ repodir }}/dinginessentail-1.1-1.x86_64.rpm"
+ - "{{ repodir_i686 }}/dinginessentail-1.1-1.i686.rpm"
- name: try to install lower version of dinginessentail from rpm file, without allow_downgrade, just one arch
yum:
@@ -424,11 +425,12 @@
- name: install dinginessentail both archs
yum:
- name: "{{ item }}"
+ name: "{{ pkgs }}"
state: present
- with_items:
- - "{{ repodir }}/dinginessentail-1.0-1.x86_64.rpm"
- - "{{ repodir_i686 }}/dinginessentail-1.0-1.i686.rpm"
+ vars:
+ pkgs:
+ - "{{ repodir }}/dinginessentail-1.0-1.x86_64.rpm"
+ - "{{ repodir_i686 }}/dinginessentail-1.0-1.i686.rpm"
- name: Update both arch in one task using rpm files
yum:
diff --git a/test/integration/targets/yum/tasks/yum.yml b/test/integration/targets/yum/tasks/yum.yml
index bf70882ed0..e2683e2280 100644
--- a/test/integration/targets/yum/tasks/yum.yml
+++ b/test/integration/targets/yum/tasks/yum.yml
@@ -301,9 +301,8 @@
yum: name=sos,bc state=removed
- name: install non-existent rpm
- yum: name="{{ item }}"
- with_items:
- - does-not-exist
+ yum:
+ name: does-not-exist
register: non_existent_rpm
ignore_errors: True
diff --git a/test/integration/targets/yum/tasks/yum_group_remove.yml b/test/integration/targets/yum/tasks/yum_group_remove.yml
index 5a681c70d4..22c6dcb11c 100644
--- a/test/integration/targets/yum/tasks/yum_group_remove.yml
+++ b/test/integration/targets/yum/tasks/yum_group_remove.yml
@@ -1,19 +1,21 @@
- name: install a group to test and yum-utils
yum:
- name: "{{ item }}"
+ name: "{{ pkgs }}"
state: present
- with_items:
- - "@Custom Group"
- - yum-utils
+ vars:
+ pkgs:
+ - "@Custom Group"
+ - yum-utils
when: ansible_pkg_mgr == "yum"
- name: install a group to test and dnf-utils
yum:
- name: "{{ item }}"
+ name: "{{ pkgs }}"
state: present
- with_items:
- - "@Custom Group"
- - dnf-utils
+ vars:
+ pkgs:
+ - "@Custom Group"
+ - dnf-utils
when: ansible_pkg_mgr == "dnf"
- name: check mode remove the group