add whoami test

This commit is contained in:
Frode Gundersen 2018-05-29 21:51:02 +00:00
parent 4b28e510f1
commit 38d114a2d2
No known key found for this signature in database
GPG key ID: 49E5BDBFA6AFB570

View file

@ -253,3 +253,13 @@ class CMDModuleTest(ModuleCase):
f_timeout=2,
python_shell=True)
self.assertEqual(out, 'hello')
def test_cmd_run_whoami(self):
'''
test return of whoami
'''
cmd = self.run_function('cmd.run', ['whoami'])
if salt.utils.is_windows():
self.assertIn('administrator', cmd)
else:
self.assertEqual('root', cmd)