Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test_gen_hash for macosx #53491

Merged
merged 6 commits into from Jun 19, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions tests/unit/utils/test_pycrypto.py
Expand Up @@ -26,14 +26,17 @@ def test_gen_hash(self):
Test gen_hash
'''
passwd = 'test_password'
id = '$'
if salt.utils.platform.is_darwin():
id = ''
ret = salt.utils.pycrypto.gen_hash(password=passwd)
self.assertTrue(ret.startswith('$6$'))
self.assertTrue(ret.startswith('$6{0}'.format(id)))

ret = salt.utils.pycrypto.gen_hash(password=passwd, algorithm='md5')
self.assertTrue(ret.startswith('$1$'))
self.assertTrue(ret.startswith('$1{0}'.format(id)))

ret = salt.utils.pycrypto.gen_hash(password=passwd, algorithm='sha256')
self.assertTrue(ret.startswith('$5$'))
self.assertTrue(ret.startswith('$5{0}'.format(id)))

def test_secure_password(self):
'''
Expand Down