mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
parent
2424d57868
commit
bf0da4aa3c
5 changed files with 19 additions and 8 deletions
|
@ -131,6 +131,7 @@ class TestPlayContext(unittest.TestCase):
|
|||
pfexec_flags = ''
|
||||
doas_exe = 'doas'
|
||||
doas_flags = ' -n -u foo '
|
||||
dzdo_exe = 'dzdo'
|
||||
|
||||
cmd = play_context.make_become_cmd(cmd=default_cmd, executable=default_exe)
|
||||
self.assertEqual(cmd, default_cmd)
|
||||
|
@ -166,6 +167,10 @@ class TestPlayContext(unittest.TestCase):
|
|||
play_context.become_method = 'bad'
|
||||
self.assertRaises(AnsibleError, play_context.make_become_cmd, cmd=default_cmd, executable="/bin/bash")
|
||||
|
||||
play_context.become_method = 'dzdo'
|
||||
cmd = play_context.make_become_cmd(cmd=default_cmd, executable="/bin/bash")
|
||||
self.assertEqual(cmd, """%s -u %s %s -c 'echo %s; %s'""" % (dzdo_exe, play_context.become_user, default_exe, play_context.success_key, default_cmd))
|
||||
|
||||
class TestTaskAndVariableOverrride(unittest.TestCase):
|
||||
|
||||
inventory_vars = (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue