mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix runner returns test on Windows
This commit is contained in:
parent
f908cde7f7
commit
2340a5875f
1 changed files with 6 additions and 2 deletions
|
@ -6,6 +6,7 @@ Tests for runner_returns
|
|||
from __future__ import absolute_import, print_function, unicode_literals
|
||||
import errno
|
||||
import os
|
||||
import socket
|
||||
import tempfile
|
||||
|
||||
# Import Salt Testing libs
|
||||
|
@ -41,14 +42,14 @@ class RunnerReturnsTest(ShellCase):
|
|||
mode='w',
|
||||
suffix='.conf',
|
||||
dir=self.master_d_dir,
|
||||
delete=True,
|
||||
delete=False,
|
||||
)
|
||||
|
||||
def tearDown(self):
|
||||
'''
|
||||
Close the tempfile.NamedTemporaryFile object, cleaning it up
|
||||
'''
|
||||
self.conf.close()
|
||||
salt.utils.files.rm_rf(self.master_d_dir)
|
||||
# Force a reload of the configuration now that our temp config file has
|
||||
# been removed.
|
||||
self.run_run_plus('test.arg', __reload_config=True)
|
||||
|
@ -75,6 +76,7 @@ class RunnerReturnsTest(ShellCase):
|
|||
'''
|
||||
self.conf.write(salt.utils.yaml.safe_dump(data, default_flow_style=False))
|
||||
self.conf.flush()
|
||||
self.conf.close()
|
||||
|
||||
def test_runner_returns_disabled(self):
|
||||
'''
|
||||
|
@ -129,6 +131,8 @@ class RunnerReturnsTest(ShellCase):
|
|||
user = 'sudo_{0}'.format(os.environ['SUDO_USER'])
|
||||
else:
|
||||
user = RUNTIME_VARS.RUNNING_TESTS_USER
|
||||
if salt.utils.platform.is_windows():
|
||||
user = 'sudo_{0}\\{1}'.format(socket.gethostname(), user)
|
||||
self.assertEqual(
|
||||
deserialized,
|
||||
{'return': {'fun': 'runner.test.arg',
|
||||
|
|
Loading…
Add table
Reference in a new issue