add destructivetest to setup and teardown for runas test

This commit is contained in:
Ch3LL 2018-08-03 15:09:10 -04:00
parent c0730ff968
commit 708dec8740
No known key found for this signature in database
GPG key ID: 132B55A7C13EFA73

View file

@ -38,6 +38,7 @@ class CMDModuleTest(ModuleCase):
'''
Validate the cmd module
'''
@destructiveTest
def setUp(self):
if self._testMethodName == 'test_runas':
# only need to manage this user for the test_runas test
@ -47,6 +48,7 @@ class CMDModuleTest(ModuleCase):
if self.runas_usr not in self.run_function('user.info', [self.runas_usr]).values():
self.run_function('user.add', [self.runas_usr])
@destructiveTest
def tearDown(self):
if self._testMethodName == 'test_runas':
if salt.utils.platform.is_darwin():
@ -281,7 +283,6 @@ class CMDModuleTest(ModuleCase):
@skipIf(salt.utils.platform.is_windows(), 'minion is windows')
@skip_if_not_root
@destructiveTest
def test_runas(self):
'''
Ensure that the env is the runas user's