Skip to content

Commit d8f71ab

Browse files
committed
WIP
1 parent 2f301ef commit d8f71ab

File tree

5 files changed

+99
-79
lines changed

5 files changed

+99
-79
lines changed

.github/workflows/tests.yml

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -24,57 +24,6 @@ jobs:
2424
fail-fast: false
2525
matrix:
2626
include:
27-
- name: Ans_27_210
28-
tox_env: py27-mode_ansible-ansible2.10
29-
- name: Ans_27_4
30-
tox_env: py27-mode_ansible-ansible4
31-
32-
- name: Ans_36_210
33-
python_version: '3.6'
34-
tox_env: py36-mode_ansible-ansible2.10
35-
- name: Ans_36_4
36-
python_version: '3.6'
37-
tox_env: py36-mode_ansible-ansible4
38-
39-
- name: Ans_311_210
40-
python_version: '3.11'
41-
tox_env: py311-mode_ansible-ansible2.10
42-
- name: Ans_311_3
43-
python_version: '3.11'
44-
tox_env: py311-mode_ansible-ansible3
45-
- name: Ans_311_4
46-
python_version: '3.11'
47-
tox_env: py311-mode_ansible-ansible4
48-
- name: Ans_311_5
49-
python_version: '3.11'
50-
tox_env: py311-mode_ansible-ansible5
51-
- name: Ans_313_6
52-
python_version: '3.13'
53-
tox_env: py313-mode_ansible-ansible6
54-
- name: Ans_313_7
55-
python_version: '3.13'
56-
tox_env: py313-mode_ansible-ansible7
57-
- name: Ans_313_8
58-
python_version: '3.13'
59-
tox_env: py313-mode_ansible-ansible8
60-
- name: Ans_313_9
61-
python_version: '3.13'
62-
tox_env: py313-mode_ansible-ansible9
63-
- name: Ans_313_10
64-
python_version: '3.13'
65-
tox_env: py313-mode_ansible-ansible10
66-
- name: Ans_313_11
67-
python_version: '3.13'
68-
tox_env: py313-mode_ansible-ansible11
69-
- name: Van_313_11
70-
python_version: '3.13'
71-
tox_env: py313-mode_ansible-ansible11-strategy_linear
72-
73-
- name: Mito_27
74-
tox_env: py27-mode_mitogen
75-
- name: Mito_36
76-
python_version: '3.6'
77-
tox_env: py36-mode_mitogen
7827
- name: Mito_313
7928
python_version: '3.13'
8029
tox_env: py313-mode_mitogen
@@ -167,15 +116,9 @@ jobs:
167116
fail-fast: false
168117
matrix:
169118
include:
170-
- name: Mito_313
171-
tox_env: py313-mode_mitogen
172-
173119
- name: Loc_313_11
174120
tox_env: py313-mode_localhost-ansible11
175121

176-
- name: Van_313_11
177-
tox_env: py313-mode_localhost-ansible11-strategy_linear
178-
179122
steps:
180123
- uses: actions/checkout@v4
181124
- uses: actions/setup-python@v5

mitogen/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def _path_importer_cache(cls, path):
5555
return None
5656
return super()._path_importer_cache(path)
5757

58-
if sys.version_info[:2] <= (3, 12):
58+
if sys.version_info[:2] <= (3, 13): # I don't expect this workaround to work on 3.13, just ruling it out.
5959
for i, mpf in enumerate(sys.meta_path):
6060
if mpf is _frozen_importlib_external.PathFinder:
6161
sys.meta_path[i] = MonkeyPatchedPathFinder

tests/ansible/integration/action/make_tmp_path.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,13 @@
142142
# readonly homedir
143143
#
144144

145+
- name: Confirm readonly_homedir state
146+
become: true
147+
shell: stat ~mitogen__readonly_homedir
148+
register: stat_home_mitogen__readonly_homedir
149+
- debug:
150+
var: stat_home_mitogen__readonly_homedir
151+
145152
- name: Try writing to temp directory for the readonly_homedir user
146153
become: true
147154
become_user: mitogen__readonly_homedir
@@ -152,6 +159,11 @@
152159
result['path'] = path
153160
open(path, 'w').write("bar")
154161
register: tmp_path
162+
# Possibly hitting https://github.com/python/cpython/issues/115911
163+
# with Python 3.13 + macOS + Ansible 11
164+
when:
165+
- ansible_version.full is version('2.18', '<', strict=True)
166+
or not is_mitogen
155167

156168
#
157169
# modules get the same base dir

tests/ansible/integration/become/su_password.yml

Lines changed: 85 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,56 @@
5555
vars:
5656
ansible_become_pass: user1_password
5757
when:
58-
# CI containers lack `setfacl` for unpriv -> unpriv
59-
# https://github.com/mitogen-hq/mitogen/issues/1118
60-
- is_mitogen
61-
or (ansible_facts.distribution in ["MacOSX"]
62-
and ansible_version.full is version("2.11", ">=", strict=True))
58+
- |
59+
# Vanilla Ansible >= 4 (ansible-core >= 2.11) can use `setfacl` for
60+
# unpriv -> unpriv, but Mitogen test containers lack setfacl
61+
# https://github.com/mitogen-hq/mitogen/issues/1118
62+
(
63+
not is_mitogen
64+
and ansible_facts.distribution in ["MacOSX"]
65+
and ansible_version.full is version("2.11", ">=", strict=True)
66+
)
67+
# Mitogen + Ansible can do unpriv -> unpriv without temporary files,
68+
# but Ansible >= 11 (ansible-core >= 2.18) try to use Python 3.13
69+
# which triggers https://github.com/python/cpython/issues/115911
70+
# on macOS
71+
or (
72+
is_mitogen
73+
and not ansible_facts.distribution in ["MacOSX"]
74+
)
75+
or (
76+
is_mitogen
77+
and ansible_version.full is version("2.18", "<", strict=True)
78+
)
6379
6480
- assert:
6581
that:
6682
- out.stdout == 'mitogen__user1'
6783
fail_msg: |
6884
out={{ out }}
6985
when:
70-
# CI containers lack `setfacl` for unpriv -> unpriv
71-
# https://github.com/mitogen-hq/mitogen/issues/1118
72-
- is_mitogen
73-
or (ansible_facts.distribution in ["MacOSX"]
74-
and ansible_version.full is version("2.11", ">=", strict=True))
86+
- |
87+
# Vanilla Ansible >= 4 (ansible-core >= 2.11) can use `setfacl` for
88+
# unpriv -> unpriv, but Mitogen test containers lack setfacl
89+
# https://github.com/mitogen-hq/mitogen/issues/1118
90+
(
91+
not is_mitogen
92+
and ansible_facts.distribution in ["MacOSX"]
93+
and ansible_version.full is version("2.11", ">=", strict=True)
94+
)
95+
# Mitogen + Ansible can do unpriv -> unpriv without temporary files,
96+
# but Ansible >= 11 (ansible-core >= 2.18) try to use Python 3.13
97+
# which triggers https://github.com/python/cpython/issues/115911
98+
# on macOS
99+
or (
100+
is_mitogen
101+
and not ansible_facts.distribution in ["MacOSX"]
102+
)
103+
or (
104+
is_mitogen
105+
and ansible_version.full is version("2.18", "<", strict=True)
106+
)
107+
75108
76109
- name: Ensure password su without chdir succeeds
77110
shell: whoami
@@ -81,23 +114,55 @@
81114
vars:
82115
ansible_become_pass: user1_password
83116
when:
84-
# CI containers lack `setfacl` for unpriv -> unpriv
85-
# https://github.com/mitogen-hq/mitogen/issues/1118
86-
- is_mitogen
87-
or (ansible_facts.distribution in ["MacOSX"]
88-
and ansible_version.full is version("2.11", ">=", strict=True))
117+
- |
118+
# Vanilla Ansible >= 4 (ansible-core >= 2.11) can use `setfacl` for
119+
# unpriv -> unpriv, but Mitogen test containers lack setfacl
120+
# https://github.com/mitogen-hq/mitogen/issues/1118
121+
(
122+
not is_mitogen
123+
and ansible_facts.distribution in ["MacOSX"]
124+
and ansible_version.full is version("2.11", ">=", strict=True)
125+
)
126+
# Mitogen + Ansible can do unpriv -> unpriv without temporary files,
127+
# but Ansible >= 11 (ansible-core >= 2.18) try to use Python 3.13
128+
# which triggers https://github.com/python/cpython/issues/115911
129+
# on macOS
130+
or (
131+
is_mitogen
132+
and not ansible_facts.distribution in ["MacOSX"]
133+
)
134+
or (
135+
is_mitogen
136+
and ansible_version.full is version("2.18", "<", strict=True)
137+
)
89138
90139
- assert:
91140
that:
92141
- out.stdout == 'mitogen__user1'
93142
fail_msg: |
94143
out={{ out }}
95144
when:
96-
# CI containers lack `setfacl` for unpriv -> unpriv
97-
# https://github.com/mitogen-hq/mitogen/issues/1118
98-
- is_mitogen
99-
or (ansible_facts.distribution in ["MacOSX"]
100-
and ansible_version.full is version("2.11", ">=", strict=True))
145+
- |
146+
# Vanilla Ansible >= 4 (ansible-core >= 2.11) can use `setfacl` for
147+
# unpriv -> unpriv, but Mitogen test containers lack setfacl
148+
# https://github.com/mitogen-hq/mitogen/issues/1118
149+
(
150+
not is_mitogen
151+
and ansible_facts.distribution in ["MacOSX"]
152+
and ansible_version.full is version("2.11", ">=", strict=True)
153+
)
154+
# Mitogen + Ansible can do unpriv -> unpriv without temporary files,
155+
# but Ansible >= 11 (ansible-core >= 2.18) try to use Python 3.13
156+
# which triggers https://github.com/python/cpython/issues/115911
157+
# on macOS
158+
or (
159+
is_mitogen
160+
and not ansible_facts.distribution in ["MacOSX"]
161+
)
162+
or (
163+
is_mitogen
164+
and ansible_version.full is version("2.18", "<", strict=True)
165+
)
101166
102167
tags:
103168
- su

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ deps =
8585
ansible8: ansible~=8.0
8686
ansible9: ansible~=9.0
8787
ansible10: ansible~=10.0
88-
ansible11: ansible>=11.0.0a2
88+
ansible11: ansible>=11.0
8989
install_command =
9090
python -m pip --no-python-version-warning --disable-pip-version-check install {opts} {packages}
9191
commands_pre =

0 commit comments

Comments
 (0)