From e5aca936e5d77ca1d5db8d196b0f6c1ed9be1162 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Wed, 12 Mar 2025 15:20:33 -0600 Subject: [PATCH] test: do not need to install from epel or pip The tests should not install anything from outside of the distribution unless absolutely necessary, like the copr repos. All of the EPEL dependencies have been removed or replaced with coprs. We do not need to install pytest from pip since it is available as `pytest-3` from `python3-pytest`. We do not need `git` or `rsync` in the tests. Signed-off-by: Rich Megginson --- .ostree/packages-testing-CentOS-8.txt | 4 +- .ostree/packages-testing-Fedora.txt | 4 +- .ostree/packages-testing-RedHat-8.txt | 4 +- .../playbooks/integration_pytest_python3.yml | 13 +--- .../create_test_interfaces_with_dhcp.yml | 2 +- tests/tasks/el_repo_setup.yml | 3 - tests/tasks/enable_epel.yml | 59 ------------------- 7 files changed, 7 insertions(+), 82 deletions(-) delete mode 100644 tests/tasks/enable_epel.yml diff --git a/.ostree/packages-testing-CentOS-8.txt b/.ostree/packages-testing-CentOS-8.txt index 3d48923..8c2ba9a 100644 --- a/.ostree/packages-testing-CentOS-8.txt +++ b/.ostree/packages-testing-CentOS-8.txt @@ -1,5 +1,3 @@ dbus-tools -git network-scripts -python3-pip -rsync +python3-pytest diff --git a/.ostree/packages-testing-Fedora.txt b/.ostree/packages-testing-Fedora.txt index c224c1d..6706166 100644 --- a/.ostree/packages-testing-Fedora.txt +++ b/.ostree/packages-testing-Fedora.txt @@ -1,12 +1,10 @@ dbus-tools ethtool -git hostapd NetworkManager network-scripts openssl procps-ng -python3-pip -rsync +python3-pytest systemd-resolved wpa_supplicant diff --git a/.ostree/packages-testing-RedHat-8.txt b/.ostree/packages-testing-RedHat-8.txt index 8f737c9..9df60b3 100644 --- a/.ostree/packages-testing-RedHat-8.txt +++ b/.ostree/packages-testing-RedHat-8.txt @@ -1,10 +1,8 @@ dbus-tools ethtool -git hostapd NetworkManager network-scripts openssl procps-ng -python3-pip -rsync +python3-pytest diff --git a/tests/playbooks/integration_pytest_python3.yml b/tests/playbooks/integration_pytest_python3.yml index cd17ca2..267dd7a 100644 --- a/tests/playbooks/integration_pytest_python3.yml +++ b/tests/playbooks/integration_pytest_python3.yml @@ -4,9 +4,7 @@ hosts: all vars: rpmdependencies: - - git - - python3-pip - - rsync + - python3-pytest tasks: - name: Install rpm dependencies @@ -16,11 +14,6 @@ use: "{{ (__network_is_ostree | d(false)) | ternary('ansible.posix.rhel_rpm_ostree', omit) }}" - - name: Install Pytest - command: "pip3 install pytest" - changed_when: false - - # Import needed in order to install initscripts dependencies on the remote # system. - name: Import the playbook '../tests_default_initscripts.yml' @@ -135,7 +128,7 @@ block: - name: Run pytest with nm command: > - pytest + pytest-3 {{ _rundir.path }}/{{ tests_directory | basename }}/integration/ --provider=nm register: playbook_run @@ -157,7 +150,7 @@ ternary('ansible.posix.rhel_rpm_ostree', omit) }}" - name: Run pytest with initscripts command: > - pytest + pytest-3 {{ _rundir.path }}/{{ tests_directory | basename }}/integration/ --provider=initscripts register: playbook_run diff --git a/tests/tasks/create_test_interfaces_with_dhcp.yml b/tests/tasks/create_test_interfaces_with_dhcp.yml index 110353e..6567f56 100644 --- a/tests/tasks/create_test_interfaces_with_dhcp.yml +++ b/tests/tasks/create_test_interfaces_with_dhcp.yml @@ -9,7 +9,7 @@ register: __install_status # sometimes the rpm download returns a 403 - I think it is when too # many parallel jobs attempt the download from the same controller in - # too short a period of time, so the epel server throttles additional + # too short a period of time, so the server throttles additional # downloads - use a retry here to mitigate until: __install_status is success retries: 6 diff --git a/tests/tasks/el_repo_setup.yml b/tests/tasks/el_repo_setup.yml index bd37c32..a492940 100644 --- a/tests/tasks/el_repo_setup.yml +++ b/tests/tasks/el_repo_setup.yml @@ -50,6 +50,3 @@ when: - ansible_distribution == 'CentOS' - ansible_distribution_major_version == '6' -- name: Include the task 'enable_epel.yml' - include_tasks: enable_epel.yml - when: not __network_is_ostree | d(false) diff --git a/tests/tasks/enable_epel.yml b/tests/tasks/enable_epel.yml deleted file mode 100644 index 9834d67..0000000 --- a/tests/tasks/enable_epel.yml +++ /dev/null @@ -1,59 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause ---- -- name: Create EPEL yum repo and Enable EPEL - when: - - ansible_distribution in ['RedHat', 'CentOS'] - - ansible_distribution_major_version in ['7', '8'] - block: - - name: Create EPEL {{ ansible_distribution_major_version }} - vars: - __epel_7: - "https://dl.fedoraproject.org/pub/archive/epel/7/x86_64/\ - Packages/e/epel-release-7-14.noarch.rpm" - __epel: https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ - ansible_distribution_major_version }}.noarch.rpm - __epel_url: "{{ - __epel_7 if ansible_distribution_major_version == '7' - else __epel }}" - command: - cmd: rpm -iv {{ __epel_url }} - # noqa command-instead-of-module - creates: /etc/yum.repos.d/epel.repo - register: __epel_status - # sometimes the rpm download returns a 403 - I think it is when too - # many parallel jobs attempt the download from the same controller in - # too short a period of time, so the epel server throttles additional - # downloads - use a retry here to mitigate - until: __epel_status is success - retries: 6 - delay: 10 - - - name: Install yum-utils package - package: - state: present - name: yum-utils - when: ansible_distribution_major_version == '7' - - - name: Enable EPEL 7 - command: yum-config-manager --enable epel - when: ansible_distribution_major_version == '7' - changed_when: false - - - name: Enable EPEL 8 - command: dnf config-manager --set-enabled epel - when: ansible_distribution_major_version == '8' - changed_when: false - -- name: Enable EPEL 6 - copy: - dest: /etc/yum.repos.d/epel.repo - content: | - [epel] - name=Extra Packages for Enterprise Linux 6 - $basearch - baseurl=https://archives.fedoraproject.org/pub/archive/epel/6/$basearch - enabled=1 - gpgcheck=0 - mode: "0644" - when: - - ansible_distribution in ['RedHat', 'CentOS'] - - ansible_distribution_major_version == '6'