mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Use user.present/absent states to manage user in virtualenv test
This commit is contained in:
parent
5f99b0482a
commit
5b71db29d5
@ -29,11 +29,7 @@ class VirtualenvTest(integration.ModuleCase,
|
||||
@skipIf(os.geteuid() != 0, 'you must be root to run this test')
|
||||
def test_issue_1959_virtualenv_runas(self):
|
||||
user = 'issue-1959'
|
||||
if not self.run_function('user.add', [user]):
|
||||
# Left behind on a canceled test run?
|
||||
self.run_function('user.delete', [user, True, True])
|
||||
if not self.run_function('user.add', [user]):
|
||||
self.skipTest('Failed to create the \'{0}\' user'.format(user))
|
||||
self.assertSaltTrueReturn(self.run_state('user.present', name=user))
|
||||
|
||||
uinfo = self.run_function('user.info', [user])
|
||||
|
||||
@ -53,7 +49,7 @@ class VirtualenvTest(integration.ModuleCase,
|
||||
finally:
|
||||
if os.path.isdir(venv_dir):
|
||||
shutil.rmtree(venv_dir)
|
||||
self.run_function('user.delete', [user, True, True])
|
||||
self.assertSaltTrueReturn(self.run_state('user.absent', name=user))
|
||||
|
||||
def test_issue_2594_non_invalidated_cache(self):
|
||||
# Testing virtualenv directory
|
||||
|
Loading…
Reference in New Issue
Block a user