@@ -30,10 +30,13 @@ def test_zos_tso_command_run_help(ansible_zos_module):
30
30
# Run a long tso command to allocate a dataset.
31
31
def test_zos_tso_command_long_command_128_chars (ansible_zos_module ):
32
32
hosts = ansible_zos_module
33
+ results = hosts .all .shell (cmd = "echo $USER" )
34
+ for result in results .contacted .values ():
35
+ user = result .get ("stdout" )
33
36
command_string = [
34
37
(
35
38
"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 )
37
40
)
38
41
]
39
42
results = hosts .all .zos_tso_command (commands = command_string )
@@ -118,11 +121,14 @@ def test_zos_tso_command_invalid_command(ansible_zos_module):
118
121
# The multiple commands
119
122
def test_zos_tso_command_multiple_commands (ansible_zos_module ):
120
123
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" ]
122
128
results = hosts .all .zos_tso_command (commands = commands_list )
123
129
for result in results .contacted .values ():
124
130
for item in result .get ("output" ):
125
- if item .get ("command" ) == "LU omvsadm" :
131
+ if item .get ("command" ) == "LU {0}" . format ( user ) :
126
132
assert item .get ("rc" ) == 0
127
133
if item .get ("command" ) == "LISTGRP" :
128
134
assert item .get ("rc" ) == 0
0 commit comments