Skip to content

Commit 6abede4

Browse files
[Enabler][testing]Fix_encoding_for testing (#2026)
* tests/functional/modules/test_zos_zfs_resize_func.py * Try other path * Other path * Debug n * Hardcoded to see probable error * Remove hardcoded * Fix hardcoded * Try hardcoded * Try hardcoded * Remove hardcoded * Add python encoding to remove error * Add fragment * Update changelogs/fragments/2026-Fix_encoding_for_testing.yml Co-authored-by: Fernando Flores <[email protected]> * Update 2026-Fix_encoding_for_testing.yml --------- Co-authored-by: Fernando Flores <[email protected]>
1 parent 0eed21f commit 6abede4

File tree

6 files changed

+26
-9
lines changed

6 files changed

+26
-9
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
trivial:
2+
- test_zos_copy_func.py - Add python encoding interpreter for async and parallel testing.
3+
(https://github.com/ansible-collections/ibm_zos_core/pull/2026).
4+
5+
- test_zos_job_submit_func.py - Add python encoding interpreter for async and parallel testing.
6+
(https://github.com/ansible-collections/ibm_zos_core/pull/2026).
7+
8+
- test_zos_operator_func.py - Add python encoding interpreter for async and parallel testing.
9+
(https://github.com/ansible-collections/ibm_zos_core/pull/2026).
10+
11+
- test_zos_script_func.py - Add python encoding interpreter for async and parallel testing.
12+
(https://github.com/ansible-collections/ibm_zos_core/pull/2026).
13+
14+
- test_zos_zfs_resize_func.py - Add python encoding interpreter for async and parallel testing.
15+
(https://github.com/ansible-collections/ibm_zos_core/pull/2026).

tests/functional/modules/test_zos_copy_func.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@
239239
_TAG_REDIR_IN: "txt"
240240
_TAG_REDIR_OUT: "txt"
241241
LANG: "C"
242+
PYTHONSTDINENCODING: "cp1047"
242243
243244
tasks:
244245
- name: Create a copy

tests/functional/modules/test_zos_job_submit_func.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@
410410
_TAG_REDIR_IN: "txt"
411411
_TAG_REDIR_OUT: "txt"
412412
LANG: "C"
413+
PYTHONSTDINENCODING: "cp1047"
413414
414415
tasks:
415416
- name: Submit async job.

tests/functional/modules/test_zos_operator_func.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
_TAG_REDIR_IN: "txt"
4141
_TAG_REDIR_OUT: "txt"
4242
LANG: "C"
43+
PYTHONSTDINENCODING: "cp1047"
4344
tasks:
4445
- name: zos_operator
4546
zos_operator:
@@ -58,7 +59,7 @@
5859
ansible_host: {0}
5960
ansible_ssh_private_key_file: {1}
6061
ansible_user: {2}
61-
ansible_python_interpreter: {3}/bin/python{4}"""
62+
ansible_python_interpreter: {3}"""
6263

6364

6465
def test_zos_operator_various_command(ansible_zos_module):
@@ -222,12 +223,11 @@ def test_zos_operator_parallel_terminal(get_config):
222223
hosts,
223224
ssh_key,
224225
user,
225-
cut_python_path,
226-
python_version
226+
python_path
227227
)), inventory))
228228
command = "(ansible-playbook -i {0} {1}) & (ansible-playbook -i {0} {1})".format(
229229
inventory,
230-
playbook
230+
playbook,
231231
)
232232
stdout = os.system(command)
233233
assert stdout == 0

tests/functional/modules/test_zos_script_func.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
_TAG_REDIR_IN: "txt"
7474
_TAG_REDIR_OUT: "txt"
7575
LANG: "C"
76+
PYTHONSTDINENCODING: "cp1047"
7677
7778
tasks:
7879
- name: Execute script in async mode.

tests/functional/modules/test_zos_zfs_resize_func.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
_TAG_REDIR_IN: "txt"
4444
_TAG_REDIR_OUT: "txt"
4545
LANG: "C"
46+
PYTHONSTDINENCODING: "cp1047"
4647
tasks:
4748
- name: Create ZFS.
4849
block:
@@ -131,7 +132,7 @@
131132
ansible_host: {0}
132133
ansible_ssh_private_key_file: {1}
133134
ansible_user: {2}
134-
ansible_python_interpreter: {3}/bin/python{4}"""
135+
ansible_python_interpreter: {3}"""
135136

136137
def make_temp_folder(hosts):
137138
"""Create a temporary file on a z/OS system and return its path."""
@@ -1031,8 +1032,7 @@ def test_no_auto_increase(get_config):
10311032
hosts,
10321033
ssh_key,
10331034
user,
1034-
cut_python_path,
1035-
python_version
1035+
python_path
10361036
)), inventory))
10371037
command = "ansible-playbook -i {0} {1}".format(
10381038
inventory,
@@ -1073,8 +1073,7 @@ def test_no_auto_increase_accept(get_config):
10731073
hosts,
10741074
ssh_key,
10751075
user,
1076-
cut_python_path,
1077-
python_version
1076+
python_path
10781077
)), inventory))
10791078
command = "ansible-playbook -i {0} {1}".format(
10801079
inventory,

0 commit comments

Comments
 (0)