mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Workaround getpwnam in auth test for MacOSX
This commit is contained in:
parent
554400e067
commit
4f1c42c0e3
@ -59,12 +59,18 @@ class AuthTest(ShellCase):
|
||||
def setUp(self):
|
||||
for user in (self.userA, self.userB):
|
||||
try:
|
||||
if salt.utils.is_darwin() and user not in str(self.run_call('user.list_users')):
|
||||
# workaround for https://github.com/saltstack/salt-jenkins/issues/504
|
||||
raise KeyError
|
||||
pwd.getpwnam(user)
|
||||
except KeyError:
|
||||
self.run_call('user.add {0} createhome=False'.format(user))
|
||||
|
||||
# only put userB into the group for the group auth test
|
||||
try:
|
||||
if salt.utils.is_darwin() and self.group not in str(self.run_call('group.info {0}'.format(self.group))):
|
||||
# workaround for https://github.com/saltstack/salt-jenkins/issues/504
|
||||
raise KeyError
|
||||
grp.getgrnam(self.group)
|
||||
except KeyError:
|
||||
self.run_call('group.add {0}'.format(self.group))
|
||||
|
Loading…
Reference in New Issue
Block a user