summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Doran <sdoran@redhat.com>2021-02-04 12:11:57 -0500
committerGitHub <noreply@github.com>2021-02-04 09:11:57 -0800
commitbeeaf10c9f40ed10b9423a0dd004360ca84b42c8 (patch)
tree396e169d04deafc63662f6290d3977020e1d1de4
parent21914b2ee3d1747f5e255747314be67134e307a1 (diff)
downloadansible-beeaf10c9f40ed10b9423a0dd004360ca84b42c8.tar.gz
[stable-2.8] Fix yum_repository tests for CentOS 8 (#64863) (#73466)
* [stable-2.8] Fix yum_repository tests for CentOS 8 (#64863) Refactor tests to run the same tasks with CentOS and Fedora using different variables.. (cherry picked from commit 05a7ce798d364d43860e20ce70b56ca4f922b77a) Co-authored-by: Sam Doran <sdoran@redhat.com> * Make yum_repository test more reliable (#73467) * Improve setup_rpm_repo - add handlers to remove repos - add variable to control whethere or not repos are created * Use local repo for all distros * Change repo creation script to module (cherry picked from commit 997b2d2a1955ccb4e70f805c18dc3e227e86c678) * Disable GPG check on install
-rw-r--r--test/integration/targets/setup_rpm_repo/defaults/main.yml1
-rw-r--r--test/integration/targets/setup_rpm_repo/handlers/main.yml5
-rw-r--r--test/integration/targets/setup_rpm_repo/library/create_repo.py94
-rw-r--r--test/integration/targets/setup_rpm_repo/meta/main.yml2
-rw-r--r--test/integration/targets/setup_rpm_repo/tasks/main.yml39
-rw-r--r--test/integration/targets/yum_repository/defaults/main.yml5
-rw-r--r--test/integration/targets/yum_repository/handlers/main.yml4
-rw-r--r--test/integration/targets/yum_repository/meta/main.yml4
-rw-r--r--test/integration/targets/yum_repository/tasks/main.yml211
-rw-r--r--test/integration/targets/yum_repository/tasks/yum_repository_centos.yml211
-rw-r--r--test/integration/targets/yum_repository/tasks/yum_repository_fedora.yml144
11 files changed, 324 insertions, 396 deletions
diff --git a/test/integration/targets/setup_rpm_repo/defaults/main.yml b/test/integration/targets/setup_rpm_repo/defaults/main.yml
new file mode 100644
index 0000000000..19c033b929
--- /dev/null
+++ b/test/integration/targets/setup_rpm_repo/defaults/main.yml
@@ -0,0 +1 @@
+install_repos: yes
diff --git a/test/integration/targets/setup_rpm_repo/handlers/main.yml b/test/integration/targets/setup_rpm_repo/handlers/main.yml
new file mode 100644
index 0000000000..a0af3c92d7
--- /dev/null
+++ b/test/integration/targets/setup_rpm_repo/handlers/main.yml
@@ -0,0 +1,5 @@
+- name: remove repos
+ yum_repository:
+ state: absent
+ name: "{{ item }}"
+ loop: "{{ repos }}"
diff --git a/test/integration/targets/setup_rpm_repo/library/create_repo.py b/test/integration/targets/setup_rpm_repo/library/create_repo.py
new file mode 100644
index 0000000000..6dc1e457c5
--- /dev/null
+++ b/test/integration/targets/setup_rpm_repo/library/create_repo.py
@@ -0,0 +1,94 @@
+#!/usr/bin/python
+
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
+import os
+import sys
+import tempfile
+
+from collections import namedtuple
+
+from ansible.module_utils.basic import AnsibleModule
+
+try:
+ from rpmfluff import SimpleRpmBuild
+ from rpmfluff import YumRepoBuild
+except ImportError:
+ from rpmfluff.rpmbuild import SimpleRpmBuild
+ from rpmfluff.yumrepobuild import YumRepoBuild
+
+try:
+ from rpmfluff import can_use_rpm_weak_deps
+except ImportError:
+ try:
+ from rpmfluff.utils import can_use_rpm_weak_deps
+ except ImportError:
+ can_use_rpm_weak_deps = None
+
+RPM = namedtuple('RPM', ['name', 'version', 'release', 'epoch', 'recommends'])
+
+
+SPECS = [
+ RPM('dinginessentail', '1.0', '1', None, None),
+ RPM('dinginessentail', '1.0', '2', '1', None),
+ RPM('dinginessentail', '1.1', '1', '1', None),
+ RPM('dinginessentail-olive', '1.0', '1', None, None),
+ RPM('dinginessentail-olive', '1.1', '1', None, None),
+ RPM('landsidescalping', '1.0', '1', None, None),
+ RPM('landsidescalping', '1.1', '1', None, None),
+ RPM('dinginessentail-with-weak-dep', '1.0', '1', None, ['dinginessentail-weak-dep']),
+ RPM('dinginessentail-weak-dep', '1.0', '1', None, None),
+]
+
+
+def create_repo(arch='x86_64'):
+ pkgs = []
+ for spec in SPECS:
+ pkg = SimpleRpmBuild(spec.name, spec.version, spec.release, [arch])
+ pkg.epoch = spec.epoch
+
+ if spec.recommends:
+ # Skip packages that require weak deps but an older version of RPM is being used
+ if not can_use_rpm_weak_deps or not can_use_rpm_weak_deps():
+ continue
+
+ for recommend in spec.recommends:
+ pkg.add_recommends(recommend)
+
+ pkgs.append(pkg)
+
+ repo = YumRepoBuild(pkgs)
+ repo.make(arch)
+
+ for pkg in pkgs:
+ pkg.clean()
+
+ return repo.repoDir
+
+
+def main():
+ module = AnsibleModule(
+ argument_spec={
+ 'arch': {'required': True},
+ 'tempdir': {'type': 'path'},
+ }
+ )
+
+ arch = module.params['arch']
+ tempdir = module.params['tempdir']
+
+ # Save current temp dir so we can set it back later
+ original_tempdir = tempfile.tempdir
+ tempfile.tempdir = tempdir
+
+ try:
+ repo_dir = create_repo(arch)
+ finally:
+ tempfile.tempdir = original_tempdir
+
+ module.exit_json(repo_dir=repo_dir, tmpfile=tempfile.gettempdir())
+
+
+if __name__ == "__main__":
+ main()
diff --git a/test/integration/targets/setup_rpm_repo/meta/main.yml b/test/integration/targets/setup_rpm_repo/meta/main.yml
new file mode 100644
index 0000000000..1810d4bec9
--- /dev/null
+++ b/test/integration/targets/setup_rpm_repo/meta/main.yml
@@ -0,0 +1,2 @@
+dependencies:
+ - setup_remote_tmp_dir
diff --git a/test/integration/targets/setup_rpm_repo/tasks/main.yml b/test/integration/targets/setup_rpm_repo/tasks/main.yml
index 21805109af..67a9ac0a10 100644
--- a/test/integration/targets/setup_rpm_repo/tasks/main.yml
+++ b/test/integration/targets/setup_rpm_repo/tasks/main.yml
@@ -53,18 +53,22 @@
when:
- ansible_distribution == 'RedHat' and ansible_distribution_major_version is version('8', '>=')
- - name: Copy script for creating a repo
- copy:
- src: create-repo.py
- dest: /tmp/create-repo.py
- mode: 0755
+ - set_fact:
+ repos:
+ - "fake-{{ ansible_architecture }}"
+ - "fake-i686"
+ - "fake-ppc64"
+ changed_when: yes
+ notify: remove repos
- name: Create RPMs and put them into a repo
- shell: "{{ansible_python_interpreter}} /tmp/create-repo.py {{ ansible_architecture }}"
+ create_repo:
+ arch: "{{ ansible_architecture }}"
+ tempdir: "{{ remote_tmp_dir }}"
register: repo
- set_fact:
- repodir: "{{ repo.stdout_lines[-1] }}"
+ repodir: "{{ repo.repo_dir }}"
- name: Install the repo
yum_repository:
@@ -72,6 +76,7 @@
description: "fake-{{ ansible_architecture }}"
baseurl: "file://{{ repodir }}"
gpgcheck: no
+ when: install_repos | bool
- name: Copy comps.xml file
copy:
@@ -83,11 +88,13 @@
command: createrepo -g {{ repodir_comps.dest | quote }} {{ repodir | quote }}
- name: Create RPMs and put them into a repo (i686)
- shell: "{{ansible_python_interpreter}} /tmp/create-repo.py i686"
+ create_repo:
+ arch: i686
+ tempdir: "{{ remote_tmp_dir }}"
register: repo_i686
- set_fact:
- repodir_i686: "{{ repo_i686.stdout_lines[-1] }}"
+ repodir_i686: "{{ repo_i686.repo_dir }}"
- name: Install the repo (i686)
yum_repository:
@@ -95,13 +102,16 @@
description: "fake-i686"
baseurl: "file://{{ repodir_i686 }}"
gpgcheck: no
+ when: install_repos | bool
- name: Create RPMs and put them into a repo (ppc64)
- shell: "{{ansible_python_interpreter}} /tmp/create-repo.py ppc64"
+ create_repo:
+ arch: ppc64
+ tempdir: "{{ remote_tmp_dir }}"
register: repo_ppc64
- set_fact:
- repodir_ppc64: "{{ repo_ppc64.stdout_lines[-1] }}"
+ repodir_ppc64: "{{ repo_ppc64.repo_dir }}"
- name: Install the repo (ppc64)
yum_repository:
@@ -109,11 +119,6 @@
description: "fake-ppc64"
baseurl: "file://{{ repodir_ppc64 }}"
gpgcheck: no
-
- - set_fact:
- repos:
- - "fake-{{ ansible_architecture }}"
- - "fake-i686"
- - "fake-ppc64"
+ when: install_repos | bool
when: ansible_distribution in ['RedHat', 'CentOS', 'ScientificLinux', 'Fedora']
diff --git a/test/integration/targets/yum_repository/defaults/main.yml b/test/integration/targets/yum_repository/defaults/main.yml
new file mode 100644
index 0000000000..4c1fbc652e
--- /dev/null
+++ b/test/integration/targets/yum_repository/defaults/main.yml
@@ -0,0 +1,5 @@
+yum_repository_test_package: dinginessentail
+yum_repository_test_repo:
+ name: fakerepo
+ description: Fake Repo
+ baseurl: "file://{{ repodir }}"
diff --git a/test/integration/targets/yum_repository/handlers/main.yml b/test/integration/targets/yum_repository/handlers/main.yml
new file mode 100644
index 0000000000..f96c23917b
--- /dev/null
+++ b/test/integration/targets/yum_repository/handlers/main.yml
@@ -0,0 +1,4 @@
+- name: remove listtest repo
+ yum_repository:
+ name: listtest
+ state: absent
diff --git a/test/integration/targets/yum_repository/meta/main.yml b/test/integration/targets/yum_repository/meta/main.yml
new file mode 100644
index 0000000000..56539a4f55
--- /dev/null
+++ b/test/integration/targets/yum_repository/meta/main.yml
@@ -0,0 +1,4 @@
+dependencies:
+ - role: setup_rpm_repo
+ vars:
+ install_repos: no
diff --git a/test/integration/targets/yum_repository/tasks/main.yml b/test/integration/targets/yum_repository/tasks/main.yml
index 6949a6ec65..24df61373a 100644
--- a/test/integration/targets/yum_repository/tasks/main.yml
+++ b/test/integration/targets/yum_repository/tasks/main.yml
@@ -1,24 +1,187 @@
-# (c) 2017, Red Hat <davidn@redhat.coms>
-
-# This file is part of Ansible
-#
-# Ansible is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Ansible is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
-
- - include: 'yum_repository_centos.yml'
- when: ansible_distribution in ['CentOS']
-
-# separate file for fedora because repos, package managers and packages are
-# different
- - include: 'yum_repository_fedora.yml'
- when: ansible_distribution in ['Fedora']
+- name: Run tests
+ when: ansible_facts.distribution in ['CentOS', 'Fedora']
+ block:
+ - name: ensure {{ yum_repository_test_package }} is uninstalled to begin with
+ action: "{{ ansible_facts.pkg_mgr }}"
+ args:
+ name: "{{ yum_repository_test_package }}"
+ state: absent
+
+ - name: disable {{ yum_repository_test_repo.name }}
+ yum_repository:
+ name: "{{ yum_repository_test_repo.name }}"
+ state: absent
+
+ - name: disable {{ yum_repository_test_repo.name }} (Idempotant)
+ yum_repository:
+ name: "{{ yum_repository_test_repo.name }}"
+ state: absent
+ register: test_repo_remove
+
+ - name: check return values
+ assert:
+ that:
+ - "test_repo_remove.repo == yum_repository_test_repo.name"
+ - "test_repo_remove.state == 'absent'"
+
+ - name: check Idempotant
+ assert:
+ that: not test_repo_remove.changed
+
+ - name: install {{ yum_repository_test_package }}, which should fail
+ action: "{{ ansible_facts.pkg_mgr }}"
+ args:
+ name: "{{ yum_repository_test_package }}"
+ state: present
+ ignore_errors: yes
+ register: test_package_result
+
+ - name: check that install failed
+ assert:
+ that:
+ - test_package_result.failed
+ - test_package_result.msg in expected_messages
+ vars:
+ expected_messages:
+ - No package matching '{{ yum_repository_test_package }}' found available, installed or updated
+ - Failed to install some of the specified packages
+
+ - name: re-add {{ yum_repository_test_repo.name }}
+ yum_repository:
+ name: "{{ yum_repository_test_repo.name }}"
+ description: "{{ yum_repository_test_repo.description }}"
+ baseurl: "{{ yum_repository_test_repo.baseurl }}"
+ state: present
+ register: test_repo_add
+
+ - name: check return values
+ assert:
+ that:
+ - test_repo_add.repo == yum_repository_test_repo.name
+ - test_repo_add.state == 'present'
+
+ - name: get repolist
+ shell: yum repolist
+ register: repolist
+ until: repolist.rc == 0
+ retries: 5
+ args:
+ warn: no
+
+ - name: ensure {{ yum_repository_test_repo.name }} was added
+ assert:
+ that:
+ - yum_repository_test_repo.name in repolist.stdout
+ - test_repo_add.changed
+
+ - name: install {{ yum_repository_test_package }}
+ action: "{{ ansible_facts.pkg_mgr }}"
+ args:
+ name: "{{ yum_repository_test_package }}"
+ state: present
+ disable_gpg_check: yes
+ register: test_package_result
+
+ - name: check that {{ yum_repository_test_package }} was successfully installed
+ assert:
+ that:
+ - test_package_result.changed
+
+ - name: remove {{ yum_repository_test_package }}
+ action: "{{ ansible_facts.pkg_mgr }}"
+ args:
+ name: "{{ yum_repository_test_package }}"
+ state: absent
+
+ - name: change configuration of {{ yum_repository_test_repo.name }} repo
+ yum_repository:
+ name: "{{ yum_repository_test_repo.name }}"
+ baseurl: "{{ yum_repository_test_repo.baseurl }}"
+ description: New description
+ async: no
+ enablegroups: no
+ file: "{{ yum_repository_test_repo.name ~ 2 }}"
+ ip_resolve: 4
+ keepalive: no
+ register: test_repo_add1
+
+ - name: check that options are correctly getting written to the repo file
+ assert:
+ that:
+ - "'async = 0' in repo_file_contents"
+ - "'name = New description' in repo_file_contents"
+ - "'enablegroups = 0' in repo_file_contents"
+ - "'ip_resolve = 4' in repo_file_contents"
+ - "'keepalive = 0' in repo_file_contents"
+ vars:
+ repo_file: "{{ '/etc/yum.repos.d/' ~ yum_repository_test_repo.name ~ '2.repo' }}"
+ repo_file_contents: "{{ lookup('file', repo_file) }}"
+
+ - name: check new config doesn't change (Idempotant)
+ yum_repository:
+ name: "{{ yum_repository_test_repo.name }}"
+ baseurl: "{{ yum_repository_test_repo.baseurl }}"
+ description: New description
+ async: no
+ enablegroups: no
+ file: "{{ yum_repository_test_repo.name ~ 2 }}"
+ ip_resolve: 4
+ keepalive: no
+ register: test_repo_add2
+
+ - name: check Idempotant
+ assert:
+ that:
+ - test_repo_add1 is changed
+ - test_repo_add2 is not changed
+
+ - name: re-enable the {{ yum_repository_test_repo.name }} repo
+ yum_repository:
+ name: "{{ yum_repository_test_repo.name }}"
+ description: "{{ yum_repository_test_repo.description }}"
+ baseurl: "{{ yum_repository_test_repo.baseurl }}"
+ state: present
+
+ - name: re-enable the {{ yum_repository_test_repo.name }} repo (Idempotant)
+ yum_repository:
+ name: "{{ yum_repository_test_repo.name }}"
+ description: "{{ yum_repository_test_repo.description }}"
+ baseurl: "{{ yum_repository_test_repo.baseurl }}"
+ state: present
+ register: test_repo_add
+
+ - name: check Idempotant
+ assert:
+ that: test_repo_add is not changed
+
+ - name: Test list options
+ yum_repository:
+ name: listtest
+ description: Testing list feature
+ baseurl:
+ - "{{ yum_repository_test_repo.baseurl }}"
+ - "{{ yum_repository_test_repo.baseurl | replace('download[0-9]?\\.', 'download2\\.', 1) }}"
+ gpgkey:
+ - gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-{{ ansible_facts.distribution_major_version }}
+ - gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG2-KEY-EPEL-{{ ansible_facts.distribution_major_version }}
+ exclude:
+ - aaa
+ - bbb
+ includepkgs:
+ - ccc
+ - ddd
+ notify: remove listtest repo
+
+ - name: Assert that lists were properly inserted
+ assert:
+ that:
+ - url_hostname in repofile
+ - url_hostname2 in repofile
+ - "'RPM-GPG-KEY-EPEL' in repofile"
+ - "'RPM-GPG2-KEY-EPEL' in repofile"
+ - "'aaa bbb' in repofile"
+ - "'ccc ddd' in repofile"
+ vars:
+ repofile: "{{ lookup('file', '/etc/yum.repos.d/listtest.repo') }}"
+ url_hostname: "{{ yum_repository_test_repo.baseurl | urlsplit('hostname') }}"
+ url_hostname2: "{{ url_hostname | replace('download[0-9]?\\.', 'download2\\.', 1) }}"
diff --git a/test/integration/targets/yum_repository/tasks/yum_repository_centos.yml b/test/integration/targets/yum_repository/tasks/yum_repository_centos.yml
deleted file mode 100644
index 4c518c27d4..0000000000
--- a/test/integration/targets/yum_repository/tasks/yum_repository_centos.yml
+++ /dev/null
@@ -1,211 +0,0 @@
----
-- name: ensure sl is uninstalled to begin with
- yum:
- name: sl
- state: absent
-
-- name: disable epel
- yum_repository:
- name: epel
- state: absent
-
-- name: disable epel (Idempotant)
- yum_repository:
- name: epel
- state: absent
- register: epel_remove
-
-- name: check return values
- assert:
- that:
- - "epel_remove.repo == 'epel'"
- - "epel_remove.state == 'absent'"
-
-- name: check Idempotant
- assert:
- that: not epel_remove.changed
-
-- name: install sl, which should fail
- yum:
- name: sl
- state: present
- ignore_errors: yes
- register: sl_result
-
-- debug: var=sl_result
-
-- name: check that install failed
- assert:
- that:
- - sl_result.failed
- - "sl_result.msg==\"No package matching 'sl' found available, installed or updated\""
-
-- name: Determine EPEL baseurl (archived versions)
- set_fact:
- epel_baseurl: https://archives.fedoraproject.org/pub/archive/epel/{{ ansible_distribution_major_version }}/$basearch
- when: ansible_distribution_major_version|int == 6
-
-- name: Determine EPEL baseurl (live versions)
- set_fact:
- epel_baseurl: https://download.fedoraproject.org/pub/epel/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/
- when: ansible_distribution_major_version|int > 6
-
-- name: re-add epel
- yum_repository:
- name: epel
- description: EPEL yum repo
- baseurl: "{{ epel_baseurl }}"
- state: present
- register: epel_add
-
-- name: check return values
- assert:
- that:
- - "epel_add.repo == 'epel'"
- - "epel_add.state == 'present'"
-
-
-- name: get repolist
- shell: yum repolist
- register: repolist
-
-- name: ensure epel was added
- assert:
- that:
- - "'epel' in repolist.stdout"
- - epel_add.changed
-
-- name: install sl
- yum:
- name: sl
- state: present
- register: sl_result
-
-- name: check that sl was successfully installed
- assert:
- that:
- - sl_result.changed
-
-- name: remove sl
- yum:
- name: sl
- state: absent
-
-- name: change configuration of epel repo
- yum_repository:
- name: epel
- baseurl: "{{ epel_baseurl }}"
- description: New description
- async: no
- enablegroups: no
- file: epel2
- ip_resolve: 4
- keepalive: no
- register: epel_add
-
-- set_fact:
- repofile: "{{ lookup('file', '/etc/yum.repos.d/epel2.repo') }}"
-
-- debug: var=repofile
-
-- name: check that options are correctly getting written to the repo file
- assert:
- that:
- - "'async = 0' in repofile"
- - "'name = New description' in repofile"
- - "'enablegroups = 0' in repofile"
- - "'ip_resolve = 4' in repofile"
- - "'keepalive = 0' in repofile"
-
-- name: check new config doesn't change (Idempotant)
- yum_repository:
- name: epel
- baseurl: "{{ epel_baseurl }}"
- description: New description
- async: no
- enablegroups: no
- file: epel2
- ip_resolve: 4
- keepalive: no
- register: epel_add
-
-- name: check Idempotant
- assert:
- that: not epel_add.changed
-
-- name: re-enable the epel repo
- yum_repository:
- name: epel
- description: EPEL yum repo
- baseurl: "{{ epel_baseurl }}"
- state: present
-
-- name: re-enable the epel repo (Idempotant)
- yum_repository:
- name: epel
- description: EPEL yum repo
- baseurl: "{{ epel_baseurl }}"
- state: present
- register: epel_add
-
-- name: check Idempotant
- assert:
- that: not epel_add.changed
-
-- name: Test list options
- yum_repository:
- name: listtest
- description: Testing list feature
- baseurl:
- # We don't install anything right after this test, so we don't have to
- # account for archived epel versions ({{ epel_baseurl }}) here.
- - https://download.fedoraproject.org/pub/epel/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/
- - https://download2.fedoraproject.org/pub/epel/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/
- gpgkey:
- - gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}
- - gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG2-KEY-EPEL-{{ ansible_distribution_major_version }}
- exclude:
- - aaa
- - bbb
- includepkgs:
- - ccc
- - ddd
-
-- set_fact:
- repofile: "{{ lookup('file', '/etc/yum.repos.d/listtest.repo') }}"
-
-- name: Assert that lists were properly inserted
- assert:
- that:
- - "'download.fedoraproject.org' in repofile"
- - "'download2.fedoraproject.org' in repofile"
- - "'RPM-GPG-KEY-EPEL' in repofile"
- - "'RPM-GPG2-KEY-EPEL' in repofile"
- - "'aaa bbb' in repofile"
- - "'ccc ddd' in repofile"
-
-- name: Cleanup list test repo
- yum_repository:
- name: listtest
- state: absent
-
-- name: disable epel (clean up)
- yum_repository:
- name: epel
- state: absent
-
-- name: add epel
- yum_repository:
- name: epel
- description: EPEL yum repo
- baseurl: "{{ epel_baseurl }}"
- state: present
- gpgcheck: no
-
-- set_fact:
- repofile: "{{ lookup('file', '/etc/yum.repos.d/epel.repo') }}"
-
-- name: check for gpgcheck=0
- assert:
- that:
- - "'gpgcheck = 0' in repofile"
diff --git a/test/integration/targets/yum_repository/tasks/yum_repository_fedora.yml b/test/integration/targets/yum_repository/tasks/yum_repository_fedora.yml
deleted file mode 100644
index 3eda4ab273..0000000000
--- a/test/integration/targets/yum_repository/tasks/yum_repository_fedora.yml
+++ /dev/null
@@ -1,144 +0,0 @@
----
-- name: ensure libbdplus is uninstalled to begin with
- dnf:
- name: libbdplus
- state: absent
-
-- name: disable rpmfusion
- yum_repository:
- name: rpmfusion-free
- state: absent
-
-- name: disable rpmfusion (Idempotant)
- yum_repository:
- name: rpmfusion-free
- state: absent
- register: fusion_remove
-
-- name: check return values
- assert:
- that:
- - "fusion_remove.repo == 'rpmfusion-free'"
- - "fusion_remove.state == 'absent'"
-
-- name: check Idempotant
- assert:
- that: not fusion_remove.changed
-
-- name: install libbdplus, which should fail
- dnf:
- name: libbdplus
- state: present
- ignore_errors: yes
- register: lib_result
-
-- name: check that install failed
- assert:
- that:
- - lib_result.failed
- - "lib_result.msg=='Failed to install some of the specified packages'"
-
-- name: re-add rpmfusion
- yum_repository:
- name: rpmfusion-free
- description: RPM Fusion for Fedora 25 - Free
- baseurl: http://download1.rpmfusion.org/free/fedora/releases/{{ ansible_distribution_major_version }}/Everything/{{ ansible_architecture }}/os/
- state: present
- register: fusion_add
-
-- name: check return values
- assert:
- that:
- - "fusion_add.repo == 'rpmfusion-free'"
- - "fusion_add.state == 'present'"
-
-- name: get repolist
- shell: dnf repolist
- register: repolist
-
-- name: ensure rpm fusion was added
- assert:
- that:
- - "'rpmfusion-free' in repolist.stdout"
- - fusion_add.changed
-
-- name: install libbdplus
- dnf:
- name: libbdplus
- state: present
- disable_gpg_check: yes
- register: lib_result
-
-- name: check that libbdplus was successfully installed
- assert:
- that:
- - lib_result.changed
-
-- name: remove libbdplus
- dnf:
- name: libbdplus
- state: absent
-
-- name: change configuration of rpmfusion repo
- yum_repository:
- name: rpmfusion-free
- description: New description
- baseurl: http://download1.rpmfusion.org/free/fedora/releases/{{ ansible_distribution_major_version }}/Everything/{{ ansible_architecture }}/os/
- async: no
- enablegroups: no
- file: fusion2
- exclude:
- - libbdplus
- ip_resolve: 4
- keepalive: no
- register: fusion_add
-
-- set_fact:
- repofile: "{{ lookup('file', '/etc/yum.repos.d/fusion2.repo') }}"
-
-- name: check that options are correctly getting written to the repo file
- assert:
- that:
- - "'async = 0' in repofile"
- - "'name = New description' in repofile"
- - "'enablegroups = 0' in repofile"
- - "'exclude = libbdplus' in repofile"
- - "'ip_resolve = 4' in repofile"
- - "'keepalive = 0' in repofile"
-
-- name: check new config doesn't change (Idempotant)
- yum_repository:
- name: rpmfusion-free
- description: New description
- baseurl: http://download1.rpmfusion.org/free/fedora/releases/{{ ansible_distribution_major_version }}/Everything/{{ ansible_architecture }}/os/
- async: no
- enablegroups: no
- file: fusion2
- exclude:
- - libbdplus
- ip_resolve: 4
- keepalive: no
- register: fusion_add
-
-- name: check Idempotant
- assert:
- that: not fusion_add.changed
-
-- name: re-add rpmfusion
- yum_repository:
- name: rpmfusion-free
- description: RPM Fusion for Fedora 25 - Free
- baseurl: http://download1.rpmfusion.org/free/fedora/releases/{{ ansible_distribution_major_version }}/Everything/{{ ansible_architecture }}/os/
- state: present
-
-- name: re-add rpmfusion
- yum_repository:
- name: rpmfusion-free
- description: RPM Fusion for Fedora 25 - Free
- baseurl: http://download1.rpmfusion.org/free/fedora/releases/{{ ansible_distribution_major_version }}/Everything/{{ ansible_architecture }}/os/
- state: present
- register: fusion_add
-
-- name: check Idempotant
- assert:
- that: not fusion_add.changed