Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible-test - Update tested platforms #83446

Merged
merged 6 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 29 additions & 28 deletions .azure-pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions changelogs/fragments/ansible-test-platform-updates.yml
Original file line number Diff line number Diff line change
@@ -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.
18 changes: 17 additions & 1 deletion test/integration/targets/ansible-test-container/runme.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}')
Expand Down
1 change: 1 addition & 0 deletions test/integration/targets/apt/vars/Ubuntu-24.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
multiarch_test_pkg: libunistring5
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
7 changes: 7 additions & 0 deletions test/integration/targets/setup_deb_repo/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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']
8 changes: 4 additions & 4 deletions test/lib/ansible_test/_data/completion/docker.txt
Original file line number Diff line number Diff line change
@@ -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
7 changes: 4 additions & 3 deletions test/lib/ansible_test/_data/completion/remote.txt
Original file line number Diff line number Diff line change
@@ -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
15 changes: 2 additions & 13 deletions test/lib/ansible_test/_util/target/setup/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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="
Expand Down Expand Up @@ -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="
Expand Down
Loading