From eb65a01598f83c88d3782827362dabc533bd3bf1 Mon Sep 17 00:00:00 2001 From: Rick Elrod Date: Wed, 29 Apr 2020 17:00:35 -0500 Subject: [PATCH] Enable dnf integration tests on CentOS 8 Change: We were only testing dnf on RHEL previously. Test on CentOS 8 as well. Test Plan: Ran locally in docker. Signed-off-by: Rick Elrod --- test/integration/targets/dnf/tasks/dnfinstallroot.yml | 3 ++- test/integration/targets/dnf/tasks/main.yml | 8 ++++---- test/integration/targets/dnf/vars/CentOS.yml | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 test/integration/targets/dnf/vars/CentOS.yml diff --git a/test/integration/targets/dnf/tasks/dnfinstallroot.yml b/test/integration/targets/dnf/tasks/dnfinstallroot.yml index 25ec80a727b..b5e0901166e 100644 --- a/test/integration/targets/dnf/tasks/dnfinstallroot.yml +++ b/test/integration/targets/dnf/tasks/dnfinstallroot.yml @@ -11,7 +11,8 @@ - name: Populate directory copy: - content: "{{ ansible_distribution_version }}\n" + # We need '8' for CentOS, but '8.x' for RHEL. + content: "{{ ansible_distribution_version|int if ansible_distribution != 'RedHat' else ansible_distribution_version }}\n" dest: "/{{ dnfroot.stdout }}/etc/dnf/vars/releasever" # This will drag in > 200 MB. diff --git a/test/integration/targets/dnf/tasks/main.yml b/test/integration/targets/dnf/tasks/main.yml index 1135509f94d..9369b5b0cd4 100644 --- a/test/integration/targets/dnf/tasks/main.yml +++ b/test/integration/targets/dnf/tasks/main.yml @@ -21,15 +21,15 @@ - include_tasks: dnf.yml when: (ansible_distribution == 'Fedora' and ansible_distribution_major_version is version('23', '>=')) or - (ansible_distribution == 'RedHat' and ansible_distribution_major_version is version('8', '>=')) + (ansible_distribution in ['RedHat', 'CentOS'] and ansible_distribution_major_version is version('8', '>=')) - include_tasks: repo.yml when: (ansible_distribution == 'Fedora' and ansible_distribution_major_version is version('23', '>=')) or - (ansible_distribution == 'RedHat' and ansible_distribution_major_version is version('8', '>=')) + (ansible_distribution in ['RedHat', 'CentOS'] and ansible_distribution_major_version is version('8', '>=')) - include_tasks: dnfinstallroot.yml when: (ansible_distribution == 'Fedora' and ansible_distribution_major_version is version('23', '>=')) or - (ansible_distribution == 'RedHat' and ansible_distribution_major_version is version('8', '>=')) + (ansible_distribution in ['RedHat', 'CentOS'] and ansible_distribution_major_version is version('8', '>=')) # Attempting to install a different RHEL release in a tmpdir doesn't work (rhel8 beta) - include_tasks: dnfreleasever.yml @@ -39,4 +39,4 @@ - include_tasks: modularity.yml when: (ansible_distribution == 'Fedora' and ansible_distribution_major_version is version('29', '>=')) or - (ansible_distribution == 'RedHat' and ansible_distribution_major_version is version('8', '>=')) + (ansible_distribution in ['RedHat', 'CentOS'] and ansible_distribution_major_version is version('8', '>=')) diff --git a/test/integration/targets/dnf/vars/CentOS.yml b/test/integration/targets/dnf/vars/CentOS.yml new file mode 100644 index 00000000000..c70d8538d81 --- /dev/null +++ b/test/integration/targets/dnf/vars/CentOS.yml @@ -0,0 +1,2 @@ +astream_name: '@php:7.2/minimal' +astream_name_no_stream: '@php/minimal'