summaryrefslogtreecommitdiffstats
path: root/test/units/playbook/test_play_context.py
diff options
context:
space:
mode:
authorBrian Coca <brian.coca+git@gmail.com>2016-09-30 22:07:48 +0200
committerBrian Coca <bcoca@users.noreply.github.com>2016-09-30 23:58:19 +0200
commitdfff608cebe185ec4f8419f06f91808a06acc714 (patch)
tree51888a0822b910e5538b143b7b17a3faa8165dbd /test/units/playbook/test_play_context.py
parentfix fact gathering flag (diff)
downloadansible-dfff608cebe185ec4f8419f06f91808a06acc714.tar.xz
ansible-dfff608cebe185ec4f8419f06f91808a06acc714.zip
dzdo prompt fix
fixed tests dzdo has 2 paths now, with and w/o password fixes #17838
Diffstat (limited to 'test/units/playbook/test_play_context.py')
-rw-r--r--test/units/playbook/test_play_context.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/units/playbook/test_play_context.py b/test/units/playbook/test_play_context.py
index 9e94f615bb..109d06934f 100644
--- a/test/units/playbook/test_play_context.py
+++ b/test/units/playbook/test_play_context.py
@@ -20,6 +20,7 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
+import pipes
from ansible.compat.tests import unittest
from ansible.compat.tests.mock import patch, MagicMock
@@ -177,6 +178,11 @@ class TestPlayContext(unittest.TestCase):
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))
+ play_context.become_pass = 'testpass'
+ play_context.become_method = 'dzdo'
+ cmd = play_context.make_become_cmd(cmd=default_cmd, executable="/bin/bash")
+ self.assertEqual(cmd, """%s -p %s -u %s %s -c 'echo %s; %s'""" % (dzdo_exe, pipes.quote(play_context.prompt), play_context.become_user, default_exe, play_context.success_key, default_cmd))
+
class TestTaskAndVariableOverrride(unittest.TestCase):
inventory_vars = (