From dad6f077319d993c0fa440dd426174a54f034c53 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Mon, 17 Jun 2024 16:17:04 -0700 Subject: [PATCH] ansible-test - Update tested platforms (#83446) * ansible-test - Update tested platforms * Add work-around for Alpine tests * Fix prepare_http_tests on Fedora * Fix deb-src setup for Ubuntu 24.04+ * Set multiarch_test_pkg for Ubuntu 24.04 * Update AZP test matrix --- .azure-pipelines/azure-pipelines.yml | 57 ++++++++++--------- .../ansible-test-platform-updates.yml | 6 ++ .../targets/ansible-test-container/runme.py | 18 +++++- .../targets/apt/vars/Ubuntu-24.yml | 1 + .../prepare_http_tests/tasks/default.yml | 2 +- .../targets/setup_deb_repo/tasks/main.yml | 7 +++ .../ansible_test/_data/completion/docker.txt | 8 +-- .../ansible_test/_data/completion/remote.txt | 7 ++- .../_util/target/setup/bootstrap.sh | 15 +---- 9 files changed, 71 insertions(+), 50 deletions(-) create mode 100644 changelogs/fragments/ansible-test-platform-updates.yml create mode 100644 test/integration/targets/apt/vars/Ubuntu-24.yml diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index 19604ba1b38..e7c46239b59 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -79,10 +79,10 @@ stages: targets: - name: macOS 14.3 test: macos/14.3 - - name: RHEL 9.3 py39 - test: rhel/9.3@3.9 - - name: RHEL 9.3 py311 - test: rhel/9.3@3.11 + - name: RHEL 9.4 py39 + test: rhel/9.4@3.9 + - name: RHEL 9.4 py312 + test: rhel/9.4@3.12 - name: FreeBSD 13.3 test: freebsd/13.3 - name: FreeBSD 14.0 @@ -95,8 +95,8 @@ stages: targets: - name: macOS 14.3 test: macos/14.3 - - name: RHEL 9.3 - test: rhel/9.3 + - name: RHEL 9.4 + test: rhel/9.4 - name: FreeBSD 13.3 test: freebsd/13.3 - name: FreeBSD 14.0 @@ -108,44 +108,45 @@ stages: - template: templates/matrix.yml # context/controller (ansible-test container management) parameters: targets: - - name: Alpine 3.19 - test: alpine/3.19 - - name: Fedora 39 - test: fedora/39 - - name: RHEL 9.3 - test: rhel/9.3 - - name: Ubuntu 22.04 - test: ubuntu/22.04 + - name: Alpine 3.20 + test: alpine/3.20 + - name: Fedora 40 + test: fedora/40 + - name: RHEL 9.4 + test: rhel/9.4 +# Temporarily disabled to unblock merging of other Ubuntu 24.04 changes. +# - name: Ubuntu 24.04 +# test: ubuntu/24.04 groups: - 6 - stage: Docker dependsOn: [] jobs: - - template: templates/matrix.yml + - template: templates/matrix.yml # context/target parameters: testFormat: linux/{0} targets: - - name: Alpine 3.19 - test: alpine319 - - name: Fedora 39 - test: fedora39 - - name: Ubuntu 20.04 - test: ubuntu2004 + - name: Alpine 3.20 + test: alpine320 + - name: Fedora 40 + test: fedora40 - name: Ubuntu 22.04 test: ubuntu2204 + - name: Ubuntu 24.04 + test: ubuntu2404 groups: - 1 - 2 - - template: templates/matrix.yml + - template: templates/matrix.yml # context/controller parameters: testFormat: linux/{0} targets: - - name: Alpine 3.19 - test: alpine319 - - name: Fedora 39 - test: fedora39 - - name: Ubuntu 22.04 - test: ubuntu2204 + - name: Alpine 3.20 + test: alpine320 + - name: Fedora 40 + test: fedora40 + - name: Ubuntu 24.04 + test: ubuntu2404 groups: - 3 - 4 diff --git a/changelogs/fragments/ansible-test-platform-updates.yml b/changelogs/fragments/ansible-test-platform-updates.yml new file mode 100644 index 00000000000..623bd249fff --- /dev/null +++ b/changelogs/fragments/ansible-test-platform-updates.yml @@ -0,0 +1,6 @@ +minor_changes: + - ansible-test - Replace Fedora 39 container and remote with Fedora 40. + - ansible-test - Replace Alpine 3.19 container and remote with Alpine 3.20. + - ansible-test - Replace Ubuntu 20.04 container with Ubuntu 24.04 container. + - ansible-test - Add Ubuntu 24.04 remote. + - ansible-test - Replace RHEL 9.3 remote with RHEL 9.4. diff --git a/test/integration/targets/ansible-test-container/runme.py b/test/integration/targets/ansible-test-container/runme.py index 9cfdd0e3d3a..b29e18344d6 100755 --- a/test/integration/targets/ansible-test-container/runme.py +++ b/test/integration/targets/ansible-test-container/runme.py @@ -320,7 +320,23 @@ def run_test(scenario: TestScenario) -> TestResult: run_command('update-crypto-policies', '--set', 'DEFAULT:SHA1') for test_command in test_commands: - retry_command(lambda: run_command(*test_command)) + def run_test_command() -> SubprocessResult: + if os_release.id == 'alpine' and scenario.user_scenario.actual.name != 'root': + # Make sure rootless networking works on Alpine. + # NOTE: The path used below differs slightly from the referenced issue. + # See: https://gitlab.alpinelinux.org/alpine/aports/-/issues/16137 + actual_pwnam = scenario.user_scenario.actual.pwnam + root_path = pathlib.Path(f'/tmp/storage-run-{actual_pwnam.pw_uid}') + run_path = root_path / 'containers/networks/rootless-netns/run' + run_path.mkdir(mode=0o755, parents=True, exist_ok=True) + + while run_path.is_relative_to(root_path): + os.chown(run_path, actual_pwnam.pw_uid, actual_pwnam.pw_gid) + run_path = run_path.parent + + return run_command(*test_command) + + retry_command(run_test_command) except SubprocessError as ex: message = str(ex) display.error(f'{scenario} {message}') diff --git a/test/integration/targets/apt/vars/Ubuntu-24.yml b/test/integration/targets/apt/vars/Ubuntu-24.yml new file mode 100644 index 00000000000..6a6bb8e6b94 --- /dev/null +++ b/test/integration/targets/apt/vars/Ubuntu-24.yml @@ -0,0 +1 @@ +multiarch_test_pkg: libunistring5 diff --git a/test/integration/targets/prepare_http_tests/tasks/default.yml b/test/integration/targets/prepare_http_tests/tasks/default.yml index 2fb26a12480..50e3978860c 100644 --- a/test/integration/targets/prepare_http_tests/tasks/default.yml +++ b/test/integration/targets/prepare_http_tests/tasks/default.yml @@ -1,6 +1,6 @@ - name: RedHat - Enable the dynamic CA configuration feature command: update-ca-trust force-enable - when: ansible_os_family == 'RedHat' + when: ansible_os_family == 'RedHat' and ansible_distribution != "Fedora" - name: RedHat - Retrieve test cacert get_url: diff --git a/test/integration/targets/setup_deb_repo/tasks/main.yml b/test/integration/targets/setup_deb_repo/tasks/main.yml index 3e640f69e86..434fa7b3f72 100644 --- a/test/integration/targets/setup_deb_repo/tasks/main.yml +++ b/test/integration/targets/setup_deb_repo/tasks/main.yml @@ -72,5 +72,12 @@ with_items: - '' - -updates + when: ansible_distribution_version is version('24.04', '<') + + - name: Enable deb-src in ubuntu.sources + # see: https://askubuntu.com/questions/1512042/ubuntu-24-04-getting-error-you-must-put-some-deb-src-uris-in-your-sources-list + command: | + sed -i 's/^Types: deb$/Types: deb deb-src/' /etc/apt/sources.list.d/ubuntu.sources + when: ansible_distribution_version is version('24.04', '>=') when: ansible_distribution in ['Ubuntu', 'Debian'] diff --git a/test/lib/ansible_test/_data/completion/docker.txt b/test/lib/ansible_test/_data/completion/docker.txt index 5d750e77973..1f209a1fb14 100644 --- a/test/lib/ansible_test/_data/completion/docker.txt +++ b/test/lib/ansible_test/_data/completion/docker.txt @@ -1,7 +1,7 @@ base image=quay.io/ansible/base-test-container:7.1.0 python=3.12,3.8,3.9,3.10,3.11,3.13 default image=quay.io/ansible/default-test-container:10.1.0 python=3.12,3.8,3.9,3.10,3.11,3.13 context=collection default image=quay.io/ansible/ansible-core-test-container:10.1.0 python=3.12,3.8,3.9,3.10,3.11,3.13 context=ansible-core -alpine319 image=quay.io/ansible/alpine319-test-container:7.1.0 python=3.11 cgroup=none audit=none -fedora39 image=quay.io/ansible/fedora39-test-container:7.1.0 python=3.12 -ubuntu2004 image=quay.io/ansible/ubuntu2004-test-container:7.1.0 python=3.8 -ubuntu2204 image=quay.io/ansible/ubuntu2204-test-container:7.1.0 python=3.10 +alpine320 image=quay.io/ansible/alpine320-test-container:8.0.0 python=3.12 cgroup=none audit=none +fedora40 image=quay.io/ansible/fedora40-test-container:8.0.0 python=3.12 +ubuntu2204 image=quay.io/ansible/ubuntu2204-test-container:8.0.0 python=3.10 +ubuntu2404 image=quay.io/ansible/ubuntu2404-test-container:8.0.0 python=3.12 diff --git a/test/lib/ansible_test/_data/completion/remote.txt b/test/lib/ansible_test/_data/completion/remote.txt index cad7fa4192d..0f5ed001430 100644 --- a/test/lib/ansible_test/_data/completion/remote.txt +++ b/test/lib/ansible_test/_data/completion/remote.txt @@ -1,13 +1,14 @@ -alpine/3.19 python=3.11 become=doas_sudo provider=aws arch=x86_64 +alpine/3.20 python=3.12 become=doas_sudo provider=aws arch=x86_64 alpine become=doas_sudo provider=aws arch=x86_64 -fedora/39 python=3.12 become=sudo provider=aws arch=x86_64 +fedora/40 python=3.12 become=sudo provider=aws arch=x86_64 fedora become=sudo provider=aws arch=x86_64 freebsd/13.3 python=3.9,3.11 python_dir=/usr/local/bin become=su_sudo provider=aws arch=x86_64 freebsd/14.0 python=3.9,3.11 python_dir=/usr/local/bin become=su_sudo provider=aws arch=x86_64 freebsd python_dir=/usr/local/bin become=su_sudo provider=aws arch=x86_64 macos/14.3 python=3.11 python_dir=/usr/local/bin become=sudo provider=parallels arch=x86_64 macos python_dir=/usr/local/bin become=sudo provider=parallels arch=x86_64 -rhel/9.3 python=3.9,3.11 become=sudo provider=aws arch=x86_64 +rhel/9.4 python=3.9,3.12 become=sudo provider=aws arch=x86_64 rhel become=sudo provider=aws arch=x86_64 ubuntu/22.04 python=3.10 become=sudo provider=aws arch=x86_64 +ubuntu/24.04 python=3.12 become=sudo provider=aws arch=x86_64 ubuntu become=sudo provider=aws arch=x86_64 diff --git a/test/lib/ansible_test/_util/target/setup/bootstrap.sh b/test/lib/ansible_test/_util/target/setup/bootstrap.sh index 69a826ac8a7..709d7f6e64d 100644 --- a/test/lib/ansible_test/_util/target/setup/bootstrap.sh +++ b/test/lib/ansible_test/_util/target/setup/bootstrap.sh @@ -268,19 +268,12 @@ bootstrap_remote_rhel_9() packages=" gcc ${py_pkg_prefix}-devel + ${py_pkg_prefix}-pip " - # pip is not included in the Python devel package under Python 3.11 - if [ "${python_version}" != "3.9" ]; then - packages=" - ${packages} - ${py_pkg_prefix}-pip - " - fi - # Jinja2 is not installed with an OS package since the provided version is too old. # Instead, ansible-test will install it using pip. - # packaging and resolvelib are missing for Python 3.11 (and possible later) so we just + # packaging and resolvelib are missing for controller supported Python versions, so we just # skip them and let ansible-test install them from PyPI. if [ "${controller}" ]; then packages=" @@ -329,10 +322,6 @@ bootstrap_remote_ubuntu() # For these ansible-test will use pip to install the requirements instead. # Only the platform is checked since Ubuntu shares Python packages across Python versions. case "${platform_version}" in - "20.04") - jinja2_pkg="" # too old - resolvelib_pkg="" # not available - ;; esac packages="