Skip to content

Commit 10ac10c

Browse files
[Enabler][1588]zos_tso_command_portability (#1639)
* Fix problem * Add fragment
1 parent b1179b3 commit 10ac10c

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
trivial:
2+
- test_zos_tso_command_func.py - Remove the use of hard coded user.
3+
(https://github.com/ansible-collections/ibm_zos_core/pull/1639).

tests/functional/modules/test_zos_tso_command_func.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@ def test_zos_tso_command_run_help(ansible_zos_module):
3030
# Run a long tso command to allocate a dataset.
3131
def test_zos_tso_command_long_command_128_chars(ansible_zos_module):
3232
hosts = ansible_zos_module
33+
results = hosts.all.shell(cmd="echo $USER")
34+
for result in results.contacted.values():
35+
user = result.get("stdout")
3336
command_string = [
3437
(
3538
"send 'Hello, this is a test message from zos_tso_command module. "
36-
"Im sending a command exceed 80 chars. Thank you.' user(omvsadm)"
39+
"Im sending a command exceed 80 chars. Thank you.' user({0})".format(user)
3740
)
3841
]
3942
results = hosts.all.zos_tso_command(commands=command_string)
@@ -118,11 +121,14 @@ def test_zos_tso_command_invalid_command(ansible_zos_module):
118121
# The multiple commands
119122
def test_zos_tso_command_multiple_commands(ansible_zos_module):
120123
hosts = ansible_zos_module
121-
commands_list = ["LU omvsadm", "LISTGRP"]
124+
results = hosts.all.shell(cmd="echo $USER")
125+
for result in results.contacted.values():
126+
user = result.get("stdout")
127+
commands_list = ["LU {0}".format(user), "LISTGRP"]
122128
results = hosts.all.zos_tso_command(commands=commands_list)
123129
for result in results.contacted.values():
124130
for item in result.get("output"):
125-
if item.get("command") == "LU omvsadm":
131+
if item.get("command") == "LU {0}".format(user):
126132
assert item.get("rc") == 0
127133
if item.get("command") == "LISTGRP":
128134
assert item.get("rc") == 0

0 commit comments

Comments
 (0)