From 0bafbd501cf55d568c4ae54b3801fa11ac8df023 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Tue, 25 Nov 2025 14:57:08 +0000 Subject: [PATCH 1/7] tests: Remove unused distros_* Tox factors --- tox.ini | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/tox.ini b/tox.ini index b2974332..3270f10a 100644 --- a/tox.ini +++ b/tox.ini @@ -135,19 +135,6 @@ setenv = ans12: MITOGEN_TEST_DISTRO_SPECS=debian11-py3 ubuntu2004-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 m_ans: MODE=ansible m_ans: ANSIBLE_SKIP_TAGS=resource_intensive m_ans: ANSIBLE_CALLBACK_WHITELIST=profile_tasks From 1cbd1777bc0bc5ef9636353d3974aae1de8b4e92 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Tue, 25 Nov 2025 16:07:01 +0000 Subject: [PATCH 2/7] tests: Check Mitogen+Ansible discovered interpreter fresh Ansible result Previously this test used a manually compiled list of results, which is fragile and an ongoing maintenance burden. New method should 'just work' and be more transparent. This technique might be more widely applicable in the test suite. --- .../ansible_2_8_tests.yml | 76 ++++--------------- 1 file changed, 13 insertions(+), 63 deletions(-) diff --git a/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml b/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml index 403f7848..fd82d2ea 100644 --- a/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml +++ b/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml @@ -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 From e044893a8864acb876b7d3f6438a8b28a80154fa Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Wed, 26 Nov 2025 13:21:21 +0000 Subject: [PATCH 3/7] tests: Variabalize virtualenv creation in isssue 152 regression test Prep for AlamaLinux 9 introduction --- tests/ansible/hosts/group_vars/all.yml | 8 ++++++++ .../issue_152__virtualenv_python_fails.yml | 17 ++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/tests/ansible/hosts/group_vars/all.yml b/tests/ansible/hosts/group_vars/all.yml index 42a087ce..ca96f25f 100644 --- a/tests/ansible/hosts/group_vars/all.yml +++ b/tests/ansible/hosts/group_vars/all.yml @@ -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 diff --git a/tests/ansible/regression/issue_152__virtualenv_python_fails.yml b/tests/ansible/regression/issue_152__virtualenv_python_fails.yml index 43b00de5..c90f63d2 100644 --- a/tests/ansible/regression/issue_152__virtualenv_python_fails.yml +++ b/tests/ansible/regression/issue_152__virtualenv_python_fails.yml @@ -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) From e0103eb66c3669ae5cc729655bf4adceb6c487e4 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Wed, 26 Nov 2025 13:24:00 +0000 Subject: [PATCH 4/7] CI: Add OS release coverage: AlmaLinux 9 --- .ci/ci_lib.py | 2 +- docs/changelog.rst | 1 + tests/ansible/hosts/group_vars/alma9.yml | 8 ++++++++ tests/ansible/integration/ssh/password.yml | 4 ++-- tests/image_prep/host_vars/alma9.yml | 1 + tests/testlib.py | 2 +- tox.ini | 14 +++++++------- 7 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 tests/ansible/hosts/group_vars/alma9.yml diff --git a/.ci/ci_lib.py b/.ci/ci_lib.py index eace0b71..7289f173 100644 --- a/.ci/ci_lib.py +++ b/.ci/ci_lib.py @@ -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 centos6 centos8-py3 debian9 debian11 ubuntu1604 ubuntu2004', ) IMAGE_PREP_DIR = os.path.join(GIT_ROOT, 'tests/image_prep') IMAGE_TEMPLATE = os.environ.get( diff --git a/docs/changelog.rst b/docs/changelog.rst index edfc1ceb..2692cc07 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -23,6 +23,7 @@ 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 v0.3.33 (2025-11-22) diff --git a/tests/ansible/hosts/group_vars/alma9.yml b/tests/ansible/hosts/group_vars/alma9.yml new file mode 100644 index 00000000..25fd10bd --- /dev/null +++ b/tests/ansible/hosts/group_vars/alma9.yml @@ -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 }}" diff --git a/tests/ansible/integration/ssh/password.yml b/tests/ansible/integration/ssh/password.yml index ca08fa5b..5301c084 100644 --- a/tests/ansible/integration/ssh/password.yml +++ b/tests/ansible/integration/ssh/password.yml @@ -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 }} diff --git a/tests/image_prep/host_vars/alma9.yml b/tests/image_prep/host_vars/alma9.yml index 63279e0c..430d6bf2 100644 --- a/tests/image_prep/host_vars/alma9.yml +++ b/tests/image_prep/host_vars/alma9.yml @@ -3,3 +3,4 @@ docker_base: almalinux:9 packages: - perl-JSON + - procps-ng diff --git a/tests/testlib.py b/tests/testlib.py index 803159a3..6577f30b 100644 --- a/tests/testlib.py +++ b/tests/testlib.py @@ -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 centos6 centos8-py3 debian9 debian11 ubuntu1604 ubuntu2004', ) IMAGE_TEMPLATE = os.environ.get( 'MITOGEN_TEST_IMAGE_TEMPLATE', diff --git a/tox.ini b/tox.ini index 3270f10a..d660054d 100644 --- a/tox.ini +++ b/tox.ini @@ -123,18 +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 debian11 ubuntu1604 ubuntu2004 # 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 debian11 ubuntu1604 ubuntu1804 ubuntu2004 # 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 debian11 ubuntu1804 ubuntu2004 # 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 debian11-py3 ubuntu2004-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 debian11-py3 ubuntu2004-py3 + ans12: MITOGEN_TEST_DISTRO_SPECS=alma9-py3 debian11-py3 ubuntu2004-py3 # Ansible 13 (ansible-core 2.20) requires Python >= 3.9 on targets - ans13: MITOGEN_TEST_DISTRO_SPECS=debian11-py3 + ans13: MITOGEN_TEST_DISTRO_SPECS=alma9-py3 debian11-py3 m_ans: MODE=ansible m_ans: ANSIBLE_SKIP_TAGS=resource_intensive m_ans: ANSIBLE_CALLBACK_WHITELIST=profile_tasks From 1fe55f1c67fa0b283be0967970c88b2b08d87aa3 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Wed, 26 Nov 2025 14:08:35 +0000 Subject: [PATCH 5/7] CI: Add OS release coverage: CentOS 5 Only the Mitogen unit tests will run against CentOS 5, providing atleast some Python 2.4test coverage. There is no version of Ansible that supports Python 2.4 that is also supported by Mitogen 0.3. The SSH key exchange argument is to persuade newer SSH clients to talk with such an old SSH server. See https://www.openssh.org/legacy.html --- .ci/ci_lib.py | 2 +- docs/changelog.rst | 1 + tests/ansible/ansible.cfg | 1 + .../connection_delegation/delegate_to_template.yml | 2 ++ .../connection_delegation/stack_construction.yml | 7 +++++++ tests/ansible/integration/process/unix_socket_cleanup.yml | 2 +- tests/ansible/integration/ssh/variables.yml | 4 ++-- tests/data/plain_old_module.py | 8 ++++++-- tests/testlib.py | 3 ++- 9 files changed, 23 insertions(+), 7 deletions(-) diff --git a/.ci/ci_lib.py b/.ci/ci_lib.py index 7289f173..82a78b02 100644 --- a/.ci/ci_lib.py +++ b/.ci/ci_lib.py @@ -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', - 'alma9-py3 centos6 centos8-py3 debian9 debian11 ubuntu1604 ubuntu2004', + 'alma9-py3 centos5 centos8-py3 debian9 debian11 ubuntu1604 ubuntu2004', ) IMAGE_PREP_DIR = os.path.join(GIT_ROOT, 'tests/image_prep') IMAGE_TEMPLATE = os.environ.get( diff --git a/docs/changelog.rst b/docs/changelog.rst index 2692cc07..db6c1c38 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -24,6 +24,7 @@ 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 v0.3.33 (2025-11-22) diff --git a/tests/ansible/ansible.cfg b/tests/ansible/ansible.cfg index 4060d9ea..533c58a9 100644 --- a/tests/ansible/ansible.cfg +++ b/tests/ansible/ansible.cfg @@ -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 diff --git a/tests/ansible/integration/connection_delegation/delegate_to_template.yml b/tests/ansible/integration/connection_delegation/delegate_to_template.yml index 8cd50f98..d46103d6 100644 --- a/tests/ansible/integration/connection_delegation/delegate_to_template.yml +++ b/tests/ansible/integration/connection_delegation/delegate_to_template.yml @@ -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, ], diff --git a/tests/ansible/integration/connection_delegation/stack_construction.yml b/tests/ansible/integration/connection_delegation/stack_construction.yml index 58abac7b..b38d835b 100644 --- a/tests/ansible/integration/connection_delegation/stack_construction.yml +++ b/tests/ansible/integration/connection_delegation/stack_construction.yml @@ -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, ], diff --git a/tests/ansible/integration/process/unix_socket_cleanup.yml b/tests/ansible/integration/process/unix_socket_cleanup.yml index 4466aa2e..4dce1d41 100644 --- a/tests/ansible/integration/process/unix_socket_cleanup.yml +++ b/tests/ansible/integration/process/unix_socket_cleanup.yml @@ -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 %} diff --git a/tests/ansible/integration/ssh/variables.yml b/tests/ansible/integration/ssh/variables.yml index 5eb54dde..17d53350 100644 --- a/tests/ansible/integration/ssh/variables.yml +++ b/tests/ansible/integration/ssh/variables.yml @@ -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 %} diff --git a/tests/data/plain_old_module.py b/tests/data/plain_old_module.py index 7239f76a..2c14e0ff 100755 --- a/tests/data/plain_old_module.py +++ b/tests/data/plain_old_module.py @@ -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): diff --git a/tests/testlib.py b/tests/testlib.py index 6577f30b..da0c17f2 100644 --- a/tests/testlib.py +++ b/tests/testlib.py @@ -53,7 +53,7 @@ LOG = logging.getLogger(__name__) DISTRO_SPECS = os.environ.get( 'MITOGEN_TEST_DISTRO_SPECS', - 'alma9-py3 centos6 centos8-py3 debian9 debian11 ubuntu1604 ubuntu2004', + 'alma9-py3 centos5 centos8-py3 debian9 debian11 ubuntu1604 ubuntu2004', ) 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, From 14e833470501302afb3b0a8ca40a70d5e67da70f Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Wed, 26 Nov 2025 16:03:45 +0000 Subject: [PATCH 6/7] CI: Add OS release coverage: Debian 12 --- .ci/ci_lib.py | 2 +- docs/changelog.rst | 1 + tests/ansible/hosts/group_vars/debian12.yml | 2 ++ tests/testlib.py | 2 +- tox.ini | 14 +++++++------- 5 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 tests/ansible/hosts/group_vars/debian12.yml diff --git a/.ci/ci_lib.py b/.ci/ci_lib.py index 82a78b02..504f3ae2 100644 --- a/.ci/ci_lib.py +++ b/.ci/ci_lib.py @@ -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', - 'alma9-py3 centos5 centos8-py3 debian9 debian11 ubuntu1604 ubuntu2004', + 'alma9-py3 centos5 centos8-py3 debian9 debian12-py3 ubuntu1604 ubuntu2004', ) IMAGE_PREP_DIR = os.path.join(GIT_ROOT, 'tests/image_prep') IMAGE_TEMPLATE = os.environ.get( diff --git a/docs/changelog.rst b/docs/changelog.rst index db6c1c38..b25cd08b 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -25,6 +25,7 @@ In progress (unreleased) * :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 v0.3.33 (2025-11-22) diff --git a/tests/ansible/hosts/group_vars/debian12.yml b/tests/ansible/hosts/group_vars/debian12.yml new file mode 100644 index 00000000..f2f5fd56 --- /dev/null +++ b/tests/ansible/hosts/group_vars/debian12.yml @@ -0,0 +1,2 @@ +become_doas_available: true +pkg_mgr_python_interpreter: python3 diff --git a/tests/testlib.py b/tests/testlib.py index da0c17f2..f536f22c 100644 --- a/tests/testlib.py +++ b/tests/testlib.py @@ -53,7 +53,7 @@ LOG = logging.getLogger(__name__) DISTRO_SPECS = os.environ.get( 'MITOGEN_TEST_DISTRO_SPECS', - 'alma9-py3 centos5 centos8-py3 debian9 debian11 ubuntu1604 ubuntu2004', + 'alma9-py3 centos5 centos8-py3 debian9 debian12-py3 ubuntu1604 ubuntu2004', ) IMAGE_TEMPLATE = os.environ.get( 'MITOGEN_TEST_IMAGE_TEMPLATE', diff --git a/tox.ini b/tox.ini index d660054d..d72b6dd7 100644 --- a/tox.ini +++ b/tox.ini @@ -123,18 +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=alma9-py3 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 ubuntu2004 # 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=alma9-py3 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 ubuntu2004 # Ansible 9 (ansible-core 2.16) requires Python 2.7 or >= 3.6 on targets - ans9: MITOGEN_TEST_DISTRO_SPECS=alma9-py3 centos7 centos8-py3 debian9 debian10 debian11 ubuntu1804 ubuntu2004 + ans9: MITOGEN_TEST_DISTRO_SPECS=alma9-py3 centos7 centos8-py3 debian9 debian10 debian12-py3 ubuntu1804 ubuntu2004 # Ansible 10 (ansible-core 2.17) requires Python >= 3.7 on targets - ans10: MITOGEN_TEST_DISTRO_SPECS=alma9-py3 debian10-py3 debian11-py3 ubuntu2004-py3 + ans10: MITOGEN_TEST_DISTRO_SPECS=alma9-py3 debian10-py3 debian12-py3 ubuntu2004-py3 # Ansible 11 (ansible-core 2.18) requires Python >= 3.8 on targets - ans11: MITOGEN_TEST_DISTRO_SPECS=alma9-py3 debian11-py3 ubuntu2004-py3 - ans12: MITOGEN_TEST_DISTRO_SPECS=alma9-py3 debian11-py3 ubuntu2004-py3 + ans11: MITOGEN_TEST_DISTRO_SPECS=alma9-py3 debian12-py3 ubuntu2004-py3 + ans12: MITOGEN_TEST_DISTRO_SPECS=alma9-py3 debian12-py3 ubuntu2004-py3 # Ansible 13 (ansible-core 2.20) requires Python >= 3.9 on targets - ans13: MITOGEN_TEST_DISTRO_SPECS=alma9-py3 debian11-py3 + ans13: MITOGEN_TEST_DISTRO_SPECS=alma9-py3 debian12-py3 m_ans: MODE=ansible m_ans: ANSIBLE_SKIP_TAGS=resource_intensive m_ans: ANSIBLE_CALLBACK_WHITELIST=profile_tasks From a208daa461f4e007b2ca9449249763d1f93ee0fe Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Wed, 26 Nov 2025 18:28:58 +0000 Subject: [PATCH 7/7] CI: Add OS release coverage: Ubuntu 22.04, Ubuntu 24.04 --- .ci/ci_lib.py | 2 +- docs/changelog.rst | 1 + tests/ansible/hosts/group_vars/ubuntu2204.yml | 2 ++ tests/ansible/hosts/group_vars/ubuntu2404.yml | 2 ++ tests/testlib.py | 2 +- tox.ini | 12 ++++++------ 6 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 tests/ansible/hosts/group_vars/ubuntu2204.yml create mode 100644 tests/ansible/hosts/group_vars/ubuntu2404.yml diff --git a/.ci/ci_lib.py b/.ci/ci_lib.py index 504f3ae2..9901c742 100644 --- a/.ci/ci_lib.py +++ b/.ci/ci_lib.py @@ -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', - 'alma9-py3 centos5 centos8-py3 debian9 debian12-py3 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( diff --git a/docs/changelog.rst b/docs/changelog.rst index b25cd08b..ab048938 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -26,6 +26,7 @@ In progress (unreleased) * :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) diff --git a/tests/ansible/hosts/group_vars/ubuntu2204.yml b/tests/ansible/hosts/group_vars/ubuntu2204.yml new file mode 100644 index 00000000..f2f5fd56 --- /dev/null +++ b/tests/ansible/hosts/group_vars/ubuntu2204.yml @@ -0,0 +1,2 @@ +become_doas_available: true +pkg_mgr_python_interpreter: python3 diff --git a/tests/ansible/hosts/group_vars/ubuntu2404.yml b/tests/ansible/hosts/group_vars/ubuntu2404.yml new file mode 100644 index 00000000..f2f5fd56 --- /dev/null +++ b/tests/ansible/hosts/group_vars/ubuntu2404.yml @@ -0,0 +1,2 @@ +become_doas_available: true +pkg_mgr_python_interpreter: python3 diff --git a/tests/testlib.py b/tests/testlib.py index f536f22c..15016964 100644 --- a/tests/testlib.py +++ b/tests/testlib.py @@ -53,7 +53,7 @@ LOG = logging.getLogger(__name__) DISTRO_SPECS = os.environ.get( 'MITOGEN_TEST_DISTRO_SPECS', - 'alma9-py3 centos5 centos8-py3 debian9 debian12-py3 ubuntu1604 ubuntu2004', + 'alma9-py3 centos5 centos8-py3 debian9 debian12-py3 ubuntu1604 ubuntu2404-py3', ) IMAGE_TEMPLATE = os.environ.get( 'MITOGEN_TEST_IMAGE_TEMPLATE', diff --git a/tox.ini b/tox.ini index d72b6dd7..28c97496 100644 --- a/tox.ini +++ b/tox.ini @@ -123,18 +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=alma9-py3 centos6 centos8-py3 debian9 debian12-py3 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=alma9-py3 centos7 centos8-py3 debian9 debian10 debian12-py3 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=alma9-py3 centos7 centos8-py3 debian9 debian10 debian12-py3 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=alma9-py3 debian10-py3 debian12-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=alma9-py3 debian12-py3 ubuntu2004-py3 - ans12: 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=alma9-py3 debian12-py3 + 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