Merge pull request #1373 from moreati/issue1118-new-os-releases

CI: Expand test coverage of OS releases
pull/1356/merge
Alex Willmer 1 week ago committed by GitHub
commit f556ec12b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -34,7 +34,7 @@ ANSIBLE_TESTS_HOSTS_DIR = os.path.join(GIT_ROOT, 'tests/ansible/hosts')
ANSIBLE_TESTS_TEMPLATES_DIR = os.path.join(GIT_ROOT, 'tests/ansible/templates')
DISTRO_SPECS = os.environ.get(
'MITOGEN_TEST_DISTRO_SPECS',
'centos6 centos8-py3 debian9 debian11 ubuntu1604 ubuntu2004',
'alma9-py3 centos5 centos8-py3 debian9 debian12-py3 ubuntu1604 ubuntu2404-py3',
)
IMAGE_PREP_DIR = os.path.join(GIT_ROOT, 'tests/image_prep')
IMAGE_TEMPLATE = os.environ.get(

@ -23,6 +23,10 @@ In progress (unreleased)
* :gh:issue:`1118` CI: Use 2025.02 test images, keeping same OS releases
* :gh:issue:`1358` CI: Bump deprecated macOS 13 runner to macOS 15
* :gh:issue:`1118` CI: Add OS release coverage: AlmaLinux 9
* :gh:issue:`1118` CI: Add OS release coverage: CentOS 5
* :gh:issue:`1118` CI: Add OS release coverage: Debian 12
* :gh:issue:`1118` CI: Add OS release coverage: Ubuntu 22.04, Ubuntu 24.04
v0.3.33 (2025-11-22)

@ -76,6 +76,7 @@ ssh_args =
-o ControlPersist=60s
-o ForwardAgent=yes
-o HostKeyAlgorithms=+ssh-rsa
-o KexAlgorithms=+diffie-hellman-group1-sha1
-o PubkeyAcceptedKeyTypes=+ssh-rsa
-o UserKnownHostsFile=/dev/null
pipelining = True

@ -35,3 +35,11 @@ become_unpriv_available: >-
-}}
pkg_mgr_python_interpreter: python
virtualenv_create_argv:
- virtualenv
- -p
- "{{ virtualenv_python }}"
- "{{ virtualenv_path }}"
virtualenv_path: /path/intentionally/left/invalid
virtualenv_python: /path/intentionally/left/invalid

@ -0,0 +1,8 @@
pkg_mgr_python_interpreter: python3
# Alma Linux 9, RHEL 9, etc. lack a virtualenv package
virtualenv_create_argv:
- "{{ virtualenv_python }}"
- -m
- venv
- "{{ virtualenv_path }}"

@ -0,0 +1,2 @@
become_doas_available: true
pkg_mgr_python_interpreter: python3

@ -0,0 +1,2 @@
become_doas_available: true
pkg_mgr_python_interpreter: python3

@ -0,0 +1,2 @@
become_doas_available: true
pkg_mgr_python_interpreter: python3

@ -47,6 +47,7 @@
-o, ControlPersist=60s,
-o, ForwardAgent=yes,
-o, HostKeyAlgorithms=+ssh-rsa,
-o, KexAlgorithms=+diffie-hellman-group1-sha1,
-o, PubkeyAcceptedKeyTypes=+ssh-rsa,
-o, UserKnownHostsFile=/dev/null,
],
@ -75,6 +76,7 @@
-o, ControlPersist=60s,
-o, ForwardAgent=yes,
-o, HostKeyAlgorithms=+ssh-rsa,
-o, KexAlgorithms=+diffie-hellman-group1-sha1,
-o, PubkeyAcceptedKeyTypes=+ssh-rsa,
-o, UserKnownHostsFile=/dev/null,
],

@ -84,6 +84,7 @@
-o, ControlPersist=60s,
-o, ForwardAgent=yes,
-o, HostKeyAlgorithms=+ssh-rsa,
-o, KexAlgorithms=+diffie-hellman-group1-sha1,
-o, PubkeyAcceptedKeyTypes=+ssh-rsa,
-o, UserKnownHostsFile=/dev/null,
],
@ -128,6 +129,7 @@
-o, ControlPersist=60s,
-o, ForwardAgent=yes,
-o, HostKeyAlgorithms=+ssh-rsa,
-o, KexAlgorithms=+diffie-hellman-group1-sha1,
-o, PubkeyAcceptedKeyTypes=+ssh-rsa,
-o, UserKnownHostsFile=/dev/null,
],
@ -183,6 +185,7 @@
-o, ControlPersist=60s,
-o, ForwardAgent=yes,
-o, HostKeyAlgorithms=+ssh-rsa,
-o, KexAlgorithms=+diffie-hellman-group1-sha1,
-o, PubkeyAcceptedKeyTypes=+ssh-rsa,
-o, UserKnownHostsFile=/dev/null,
],
@ -227,6 +230,7 @@
-o, ControlPersist=60s,
-o, ForwardAgent=yes,
-o, HostKeyAlgorithms=+ssh-rsa,
-o, KexAlgorithms=+diffie-hellman-group1-sha1,
-o, PubkeyAcceptedKeyTypes=+ssh-rsa,
-o, UserKnownHostsFile=/dev/null,
],
@ -255,6 +259,7 @@
-o, ControlPersist=60s,
-o, ForwardAgent=yes,
-o, HostKeyAlgorithms=+ssh-rsa,
-o, KexAlgorithms=+diffie-hellman-group1-sha1,
-o, PubkeyAcceptedKeyTypes=+ssh-rsa,
-o, UserKnownHostsFile=/dev/null,
],
@ -309,6 +314,7 @@
-o, ControlPersist=60s,
-o, ForwardAgent=yes,
-o, HostKeyAlgorithms=+ssh-rsa,
-o, KexAlgorithms=+diffie-hellman-group1-sha1,
-o, PubkeyAcceptedKeyTypes=+ssh-rsa,
-o, UserKnownHostsFile=/dev/null,
],
@ -354,6 +360,7 @@
-o, ControlPersist=60s,
-o, ForwardAgent=yes,
-o, HostKeyAlgorithms=+ssh-rsa,
-o, KexAlgorithms=+diffie-hellman-group1-sha1,
-o, PubkeyAcceptedKeyTypes=+ssh-rsa,
-o, UserKnownHostsFile=/dev/null,
],

@ -1,58 +1,20 @@
# ripped and ported from https://github.com/ansible/ansible/pull/50163/files, when interpreter discovery was added to ansible
---
- name: integration/interpreter_discovery/ansible_2_8_tests.yml, baseline
hosts: test-targets
strategy: linear
tasks:
- meta: clear_facts
- name: Discover interpreter, linear, auto
vars:
ansible_python_interpreter: auto
ping:
register: linear_auto_result
- name: integration/interpreter_discovery/ansible_2_8_tests.yml
hosts: test-targets
gather_facts: true
vars:
DISCOVERED_INTERPRETER_EXPECTED_MAP__ANSIBLE_lt_2_12:
centos:
'6': /usr/bin/python
'7': /usr/bin/python
'8': /usr/libexec/platform-python
debian:
'9': /usr/bin/python
'10': /usr/bin/python3
'11': /usr/bin/python3
'NA': /usr/bin/python # Debian 11, Ansible <= 7 (ansible-core <= 2.14)
'bullseye/sid': /usr/bin/python # Debian 11, Ansible 8 - 9 (ansible-core 2.15 - 2.16)
ubuntu:
'16': /usr/bin/python3
'18': /usr/bin/python3
'20': /usr/bin/python3
DISCOVERED_INTERPRETER_EXPECTED_MAP__ANSIBLE_2_12_to_2_16:
centos:
'6': /usr/bin/python
'7': /usr/bin/python
'8': /usr/libexec/platform-python
debian:
'9': /usr/bin/python
'10': /usr/bin/python3
'11': /usr/bin/python3
'NA': /usr/bin/python3.9 # Debian 11, Ansible <= 7 (ansible-core <= 2.14)
'bullseye/sid': /usr/bin/python3.9 # Debian 11, Ansible 8 - 9 (ansible-core 2.15 - 2.16)
ubuntu:
'16': /usr/bin/python3
'18': /usr/bin/python3
'20': /usr/bin/python3
DISCOVERED_INTERPRETER_EXPECTED_MAP__ANSIBLE_ge_2_17:
debian:
'10': /usr/bin/python3.7
'11': /usr/bin/python3.9
'bullseye/sid': /usr/bin/python3.9
ubuntu:
'20': /usr/bin/python3.8
discovered_interpreter_expected: >-
{%- if ansible_version_major_minor is version('2.12', '<', strict=True) -%}
{{ DISCOVERED_INTERPRETER_EXPECTED_MAP__ANSIBLE_lt_2_12[distro][distro_major] }}
{%- elif ansible_version_major_minor is version('2.17', '<', strict=True) -%}
{{ DISCOVERED_INTERPRETER_EXPECTED_MAP__ANSIBLE_2_12_to_2_16[distro][distro_major] }}
{%- else -%}
{{ DISCOVERED_INTERPRETER_EXPECTED_MAP__ANSIBLE_ge_2_17[distro][distro_major] }}
{%- endif -%}
tasks:
- name: can only run these tests on ansible >= 2.8.0
block:
@ -65,12 +27,6 @@
fail_msg: "'ansible_python_interpreter' appears to be set at a high precedence to {{ ansible_python_interpreter }},
which breaks this test."
- name: snag some facts to validate for later
set_fact:
distro: '{{ ansible_facts.distribution | lower }}'
distro_major: '{{ ansible_facts.distribution_major_version }}'
system: '{{ ansible_facts.system }}'
- name: test that python discovery is working and that fact persistence makes it only run once
block:
- name: clear facts to force interpreter discovery to run
@ -215,16 +171,10 @@
- name: Check discovered interpreter matches expected
assert:
that:
- auto_out.ansible_facts.discovered_interpreter_python == discovered_interpreter_expected
- auto_out.ansible_facts.discovered_interpreter_python == linear_auto_result.ansible_facts.discovered_interpreter_python
fail_msg: |
distro={{ distro }}
distro_major= {{ distro_major }}
system={{ system }}
auto_out={{ auto_out }}
discovered_interpreter_expected={{ discovered_interpreter_expected }}
ansible_version.full={{ ansible_version.full }}
when:
- system in ['Linux']
linear_auto_result={{ linear_auto_result }}
always:
- meta: clear_facts

@ -14,7 +14,7 @@
ANSIBLE_CALLBACK_RESULT_FORMAT=json
ANSIBLE_LOAD_CALLBACK_PLUGINS=false
ANSIBLE_STRATEGY=mitogen_linear
ANSIBLE_SSH_ARGS="-o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa"
ANSIBLE_SSH_ARGS="-o HostKeyAlgorithms=+ssh-rsa -o KexAlgorithms=+diffie-hellman-group1-sha1 -o PubkeyAcceptedKeyTypes=+ssh-rsa"
ANSIBLE_VERBOSITY="{{ ansible_verbosity }}"
ansible -m shell -c local -a whoami
{% for inv in ansible_inventory_sources %}

@ -35,7 +35,7 @@
ssh_no_password_result.msg is search('SSH password was requested, but none specified')
or ssh_no_password_result.msg is search('SSH password is incorrect')
or ssh_no_password_result.msg is search('Invalid/incorrect password')
or ssh_no_password_result.msg is search('Permission denied \(publickey,password(,keyboard-interactive)?\)')
or ssh_no_password_result.msg is search('Permission denied \(publickey(,gssapi-keyex)?(,gssapi-with-mic)?,password(,keyboard-interactive)?\)')
fail_msg: |
ssh_no_password_result={{ ssh_no_password_result }}
@ -72,6 +72,6 @@
- >-
ssh_wrong_password_result.msg is search('SSH password is incorrect')
or ssh_wrong_password_result.msg is search('Invalid/incorrect password')
or ssh_wrong_password_result.msg is search('Permission denied \(publickey,password(,keyboard-interactive)?\)')
or ssh_no_password_result.msg is search('Permission denied \(publickey(,gssapi-keyex)?(,gssapi-with-mic)?,password(,keyboard-interactive)?\)')
fail_msg: |
ssh_wrong_password_result={{ ssh_wrong_password_result }}

@ -22,7 +22,7 @@
ANSIBLE_CALLBACK_RESULT_FORMAT=json
ANSIBLE_LOAD_CALLBACK_PLUGINS=false
ANSIBLE_STRATEGY=mitogen_linear
ANSIBLE_SSH_ARGS="-o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa"
ANSIBLE_SSH_ARGS="-o HostKeyAlgorithms=+ssh-rsa -o KexAlgorithms=+diffie-hellman-group1-sha1 -o PubkeyAcceptedKeyTypes=+ssh-rsa"
ANSIBLE_VERBOSITY="{{ ansible_verbosity }}"
ansible -m shell -a whoami
{% for inv in ansible_inventory_sources %}
@ -42,7 +42,7 @@
ANSIBLE_CALLBACK_RESULT_FORMAT=json
ANSIBLE_LOAD_CALLBACK_PLUGINS=false
ANSIBLE_STRATEGY=mitogen_linear
ANSIBLE_SSH_ARGS="-o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa"
ANSIBLE_SSH_ARGS="-o HostKeyAlgorithms=+ssh-rsa -o KexAlgorithms=+diffie-hellman-group1-sha1 -o PubkeyAcceptedKeyTypes=+ssh-rsa"
ANSIBLE_VERBOSITY="{{ ansible_verbosity }}"
ansible -m shell -a whoami
{% for inv in ansible_inventory_sources %}

@ -1,26 +1,29 @@
- name: regression/issue_152__virtualenv_python_fails.yml
gather_facts: true
hosts: test-targets
vars:
virtualenv_path: /tmp/issue_152_virtualenv
virtualenv_python: "{{ ansible_facts.python.executable }}"
tasks:
- custom_python_detect_environment:
register: lout
# Can't use pip module because it can't create virtualenvs, must call it
# directly.
- name: Create /tmp/issue_152_virtualenv
- name: Create temporary virtualenv
environment:
https_proxy: "{{ lookup('env', 'https_proxy')|default('') }}"
no_proxy: "{{ lookup('env', 'no_proxy')|default('') }}"
PATH: "{{ lookup('env', 'PATH') }}"
command:
cmd: virtualenv -p "{{ ansible_facts.python.executable }}" /tmp/issue_152_virtualenv
creates: /tmp/issue_152_virtualenv
argv: "{{ virtualenv_create_argv }}"
creates: "{{ virtualenv_path }}"
when:
- lout.python.version.full is version('2.7', '>=', strict=True)
- custom_python_detect_environment:
vars:
ansible_python_interpreter: /tmp/issue_152_virtualenv/bin/python
ansible_python_interpreter: "{{ virtualenv_path }}/bin/python"
register: out
when:
- lout.python.version.full is version('2.7', '>=', strict=True)
@ -28,7 +31,7 @@
- name: Check virtualenv was used
# On macOS runners a symlink /tmp -> /private/tmp has been seen
vars:
requested_executable: /tmp/issue_152_virtualenv/bin/python
requested_executable: "{{ virtualenv_path }}/bin/python"
expected_executables:
- "{{ requested_executable }}"
- "{{ requested_executable.replace('/tmp', out.fs['/tmp'].resolved) }}"
@ -40,9 +43,9 @@
when:
- lout.python.version.full is version('2.7', '>=', strict=True)
- name: Cleanup /tmp/issue_152_virtualenv
- name: Cleanup temporary virtualenv
file:
path: /tmp/issue_152_virtualenv
path: "{{ virtualenv_path }}"
state: absent
when:
- lout.python.version.full is version('2.7', '>=', strict=True)

@ -12,8 +12,12 @@ class MyError(Exception):
def get_sentinel_value():
# Some proof we're even talking to the mitogen-test Docker image
with open('/etc/sentinel', 'rb') as f:
return f.read().decode()
f = open('/etc/sentinel', 'rb')
try:
value = f.read().decode()
finally:
f.close()
return value
def add(x, y):

@ -3,3 +3,4 @@ docker_base: almalinux:9
packages:
- perl-JSON
- procps-ng

@ -53,7 +53,7 @@ LOG = logging.getLogger(__name__)
DISTRO_SPECS = os.environ.get(
'MITOGEN_TEST_DISTRO_SPECS',
'centos6 centos8-py3 debian9 debian11 ubuntu1604 ubuntu2004',
'alma9-py3 centos5 centos8-py3 debian9 debian12-py3 ubuntu1604 ubuntu2404-py3',
)
IMAGE_TEMPLATE = os.environ.get(
'MITOGEN_TEST_IMAGE_TEMPLATE',
@ -725,6 +725,7 @@ class DockerMixin(RouterMixin):
# - tests/testlib.py
'ssh_args': [
'-o', 'HostKeyAlgorithms +ssh-rsa',
'-o', 'KexAlgorithms +diffie-hellman-group1-sha1',
'-o', 'PubkeyAcceptedKeyTypes +ssh-rsa',
],
'python_path': self.dockerized_ssh.python_path,

@ -123,31 +123,18 @@ setenv =
ans{2.10,3,4,5}: ANSIBLE_STDOUT_CALLBACK=yaml
# Print warning on the first occurence at each module:linenno in Mitogen. Available Python 2.7, 3.2+.
PYTHONWARNINGS=default:::ansible_mitogen,default:::mitogen
ans{2.10,3,4,5}: MITOGEN_TEST_DISTRO_SPECS=centos6 centos8-py3 debian9 debian11 ubuntu1604 ubuntu2004
ans{2.10,3,4,5}: MITOGEN_TEST_DISTRO_SPECS=alma9-py3 centos6 centos8-py3 debian9 debian12-py3 ubuntu1604 ubuntu2204-py3
# Ansible 6 - 8 (ansible-core 2.13 - 2.15) require Python 2.7 or >= 3.5 on targets
ans{6,7,8}: MITOGEN_TEST_DISTRO_SPECS=centos7 centos8-py3 debian9 debian10 debian11 ubuntu1604 ubuntu1804 ubuntu2004
ans{6,7,8}: MITOGEN_TEST_DISTRO_SPECS=alma9-py3 centos7 centos8-py3 debian9 debian10 debian12-py3 ubuntu1604 ubuntu1804 ubuntu2404-py3
# Ansible 9 (ansible-core 2.16) requires Python 2.7 or >= 3.6 on targets
ans9: MITOGEN_TEST_DISTRO_SPECS=centos7 centos8-py3 debian9 debian10 debian11 ubuntu1804 ubuntu2004
ans9: MITOGEN_TEST_DISTRO_SPECS=alma9-py3 centos7 centos8-py3 debian9 debian10 debian12-py3 ubuntu1804 ubuntu2404-py3
# Ansible 10 (ansible-core 2.17) requires Python >= 3.7 on targets
ans10: MITOGEN_TEST_DISTRO_SPECS=debian10-py3 debian11-py3 ubuntu2004-py3
ans10: MITOGEN_TEST_DISTRO_SPECS=alma9-py3 debian10-py3 debian12-py3 ubuntu2404-py3
# Ansible 11 (ansible-core 2.18) requires Python >= 3.8 on targets
ans11: MITOGEN_TEST_DISTRO_SPECS=debian11-py3 ubuntu2004-py3
ans12: MITOGEN_TEST_DISTRO_SPECS=debian11-py3 ubuntu2004-py3
ans11: MITOGEN_TEST_DISTRO_SPECS=alma9-py3 debian12-py3 ubuntu2004-py3
ans12: MITOGEN_TEST_DISTRO_SPECS=alma9-py3 debian12-py3 ubuntu2404-py3
# Ansible 13 (ansible-core 2.20) requires Python >= 3.9 on targets
ans13: MITOGEN_TEST_DISTRO_SPECS=debian11-py3
distros_centos: MITOGEN_TEST_DISTRO_SPECS=centos6 centos7 centos8-py3
distros_centos5: MITOGEN_TEST_DISTRO_SPECS=centos5
distros_centos6: MITOGEN_TEST_DISTRO_SPECS=centos6
distros_centos7: MITOGEN_TEST_DISTRO_SPECS=centos7
distros_centos8: MITOGEN_TEST_DISTRO_SPECS=centos8-py3
distros_debian: MITOGEN_TEST_DISTRO_SPECS=debian9 debian10 debian11
distros_debian9: MITOGEN_TEST_DISTRO_SPECS=debian9
distros_debian10: MITOGEN_TEST_DISTRO_SPECS=debian10
distros_debian11: MITOGEN_TEST_DISTRO_SPECS=debian11
distros_ubuntu: MITOGEN_TEST_DISTRO_SPECS=ubuntu1604 ubuntu1804 ubuntu2004
distros_ubuntu1604: MITOGEN_TEST_DISTRO_SPECS=ubuntu1604
distros_ubuntu1804: MITOGEN_TEST_DISTRO_SPECS=ubuntu1804
distros_ubuntu2004: MITOGEN_TEST_DISTRO_SPECS=ubuntu2004
ans13: MITOGEN_TEST_DISTRO_SPECS=alma9-py3 debian12-py3 ubuntu2404-py3
m_ans: MODE=ansible
m_ans: ANSIBLE_SKIP_TAGS=resource_intensive
m_ans: ANSIBLE_CALLBACK_WHITELIST=profile_tasks

Loading…
Cancel
Save