Skip to content

Commit

Permalink
Issue 6295 - test_password_modify_non_utf8 should set default passwor…
Browse files Browse the repository at this point in the history
…d storage scheme

Bug Description:
Test dirsrvtests/tests/suites/password/password_test.py::test_password_modify_non_utf8
assumes the default password storage scheme is PBKDF2-SHA512, but it's not true
on old versions.

Fix Description:
The test should set PBKDF2-SHA512 explicitly, since it tests a crash in pwdchan
plugin that provides this storage scheme.

Fixes: 389ds#6295

Reviewed by: @tbordaz (Thanks!)
  • Loading branch information
vashirov committed Aug 16, 2024
1 parent 8a4b538 commit 31e9ac5
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion dirsrvtests/tests/suites/password/password_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,21 @@ def test_password_delete_specific_password(topology_st):

log.info('test_password_delete_specific_password: PASSED')

@pytest.fixture(scope="function")
def pbkdf2_sha512_scheme(request, topology_st):
"""Set default password storage scheme to PBKDF2-SHA512"""

def test_password_modify_non_utf8(topology_st):
inst = topology_st.standalone
default_scheme = inst.config.get_attr_val_utf8('passwordStorageScheme')
inst.config.set('passwordStorageScheme', 'PBKDF2-SHA512')

def fin():
inst.config.set('passwordStorageScheme', default_scheme)

request.addfinalizer(fin)


def test_password_modify_non_utf8(topology_st, pbkdf2_sha512_scheme):
"""Attempt a modify of the userPassword attribute with
an invalid non utf8 value
Expand Down

0 comments on commit 31e9ac5

Please sign in to comment.