summaryrefslogtreecommitdiff
path: root/test/integration/targets
diff options
context:
space:
mode:
authorToshio Kuratomi <a.badger@gmail.com>2017-01-05 10:42:43 -0800
committerGitHub <noreply@github.com>2017-01-05 10:42:43 -0800
commit95df8977b640b243ded67f9829cb41846c0be4d6 (patch)
treec0cc4b834c432c2011739976d774cf7f41f4216c /test/integration/targets
parent22c9428776b10ff060fcb8c115c9ed1fe14d938b (diff)
downloadansible-95df8977b640b243ded67f9829cb41846c0be4d6.tar.gz
Fix yum install root (#19925)
* Reenable yum install root tests No need for sos to test installroot. Something with less deps works just as well. * Fix yum installroot. Fix module import to use fail_json when the modules aren't installed. Remove wildcard imports * Lsat task is supposed to remove sos so make that happen
Diffstat (limited to 'test/integration/targets')
-rw-r--r--test/integration/targets/yum/tasks/yum.yml5
-rw-r--r--test/integration/targets/yum/tasks/yuminstallroot.yml70
2 files changed, 39 insertions, 36 deletions
diff --git a/test/integration/targets/yum/tasks/yum.yml b/test/integration/targets/yum/tasks/yum.yml
index 8299ec587d..24880f8b76 100644
--- a/test/integration/targets/yum/tasks/yum.yml
+++ b/test/integration/targets/yum/tasks/yum.yml
@@ -227,5 +227,8 @@
- "'results' in yum_result"
- name: uninstall sos
- yum: name=sos installroot='/'
+ yum:
+ name: sos
+ installroot: '/'
+ state: removed
register: yum_result
diff --git a/test/integration/targets/yum/tasks/yuminstallroot.yml b/test/integration/targets/yum/tasks/yuminstallroot.yml
index 3cf0c110f2..3f50b4ab00 100644
--- a/test/integration/targets/yum/tasks/yuminstallroot.yml
+++ b/test/integration/targets/yum/tasks/yuminstallroot.yml
@@ -17,44 +17,44 @@
- name: Make a necessary directory
file:
- path: "/{{ yumroot.stdout }}/etc/yum/vars/"
+ path: "{{ yumroot.stdout }}/etc/yum/vars/"
state: directory
mode: 0755
-#- name: Populate directory
-# copy:
-# content: "{{ ansible_lsb.major_release }}\n"
-# dest: "/{{ yumroot.stdout }}/etc/yum/vars/releasever"
-#
-## This will drag in > 200 MB.
-#- name: attempt installroot
-# yum: name=sos installroot="/{{ yumroot.stdout }}/" disable_gpg_check=yes
-# register: yum_result
-#
-#- name: check sos with rpm in installroot
-# shell: rpm -q sos --root="/{{ yumroot.stdout }}/"
-# failed_when: False
-# register: rpm_result
-#
-#- debug: var=yum_result
-#- debug: var=rpm_result
-#
-#- name: verify installation of sos
-# assert:
-# that:
-# - "yum_result.rc == 0"
-# - "yum_result.changed"
-# - "rpm_result.rc == 0"
-#
-#- name: verify yum module outputs
-# assert:
-# that:
-# - "'changed' in yum_result"
-# - "'msg' in yum_result"
-# - "'rc' in yum_result"
-# - "'results' in yum_result"
-#
+- name: Populate directory
+ copy:
+ content: "{{ ansible_distribution_major_version }}\n"
+ dest: "/{{ yumroot.stdout }}/etc/yum/vars/releasever"
+
+# This will drag in > 200 MB.
+- name: attempt installroot
+ yum: name=zlib installroot="{{ yumroot.stdout }}/" disable_gpg_check=yes
+ register: yum_result
+
+- name: check sos with rpm in installroot
+ shell: rpm -q zlib --root="{{ yumroot.stdout }}/"
+ failed_when: False
+ register: rpm_result
+
+- debug: var=yum_result
+- debug: var=rpm_result
+
+- name: verify installation of sos
+ assert:
+ that:
+ - "yum_result.rc == 0"
+ - "yum_result.changed"
+ - "rpm_result.rc == 0"
+
+- name: verify yum module outputs
+ assert:
+ that:
+ - "'changed' in yum_result"
+ - "'msg' in yum_result"
+ - "'rc' in yum_result"
+ - "'results' in yum_result"
+
- name: cleanup installroot
file:
- path: "/{{ yumroot.stdout }}/"
+ path: "{{ yumroot.stdout }}/"
state: absent