mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add regression test
This commit is contained in:
parent
e0e4e19ba3
commit
f8f9d045ac
1 changed files with 11 additions and 0 deletions
|
@ -15,9 +15,11 @@ from tests.support.helpers import (
|
|||
skip_if_not_root
|
||||
)
|
||||
from tests.support.paths import TMP
|
||||
from tests.support.unit import skipIf
|
||||
|
||||
# Import salt libs
|
||||
import salt.utils.path
|
||||
import salt.utils.platform
|
||||
|
||||
# Import 3rd-party libs
|
||||
from salt.ext import six
|
||||
|
@ -266,6 +268,15 @@ class CMDModuleTest(ModuleCase):
|
|||
runas=runas).strip()
|
||||
self.assertEqual(result, expected_result)
|
||||
|
||||
@skipIf(salt.utils.platform.is_windows(), 'minion is windows')
|
||||
@skip_if_not_root
|
||||
def test_runas(self):
|
||||
'''
|
||||
Ensure that the env is the runas user's
|
||||
'''
|
||||
out = self.run_function('cmd.run', ['env'], runas='nobody').splitlines()
|
||||
self.assertIn('USER=nobody', out)
|
||||
|
||||
def test_timeout(self):
|
||||
'''
|
||||
cmd.run trigger timeout
|
||||
|
|
Loading…
Add table
Reference in a new issue