This is an automated email from the git hooks/post-receive script.
spichugi pushed a change to branch master in repository 389-ds-base.
from 6603fb7 Ticket 49512 - remove backup directories from cockpit source new 6647fba Issue 49312 - Added a new test case for "-D configdir"
The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference.
Summary of changes: dirsrvtests/tests/suites/clu/clu_test.py | 39 ++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-)
This is an automated email from the git hooks/post-receive script.
spichugi pushed a commit to branch master in repository 389-ds-base.
commit 6647fba182179bde0ac3e7e6f89e146ccca180a6 Author: Akshay Adhikari aadhikar@aadhikar.pnq.csb Date: Thu Jan 4 17:14:53 2018 +0530
Issue 49312 - Added a new test case for "-D configdir"
Bug Description: "pwdhash -D configdir" uses the DS default hashing algorithm.
Fix Description: Add a test case that tests the change of default pwdhash scheme.
https://pagure.io/389-ds-base/issue/49312
Reviewed by: wibrown, spichugi
Signed-off-by: Simon Pichugin spichugi@redhat.com --- dirsrvtests/tests/suites/clu/clu_test.py | 39 ++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-)
diff --git a/dirsrvtests/tests/suites/clu/clu_test.py b/dirsrvtests/tests/suites/clu/clu_test.py index cec1762..ea2cb4b 100644 --- a/dirsrvtests/tests/suites/clu/clu_test.py +++ b/dirsrvtests/tests/suites/clu/clu_test.py @@ -6,7 +6,8 @@ # See LICENSE for details. # --- END COPYRIGHT BLOCK --- # - +import time +import subprocess import pytest from lib389.tasks import * from lib389.utils import * @@ -37,7 +38,6 @@ def test_clu_pwdhash(topology_st): log.info('Running test_clu_pwdhash...')
cmd = '%s -s ssha testpassword' % os.path.join(topology_st.standalone.get_bin_dir(), 'pwdhash') - p = os.popen(cmd) result = p.readline() p.close() @@ -49,14 +49,45 @@ def test_clu_pwdhash(topology_st): if len(result) < 20: log.fatal('test_clu_pwdhash: Encrypted password is too short') assert False - log.info('pwdhash generated: ' + result) log.info('test_clu_pwdhash: PASSED')
+def test_clu_pwdhash_mod(topology_st): + """Test the pwdhash script output with -D configdir + + :id: 874ab5e2-207b-4a95-b4c0-22d97b8ab643 + + :setup: Standalone instance + + :steps: + 1. Set nsslapd-rootpwstoragescheme & passwordStorageScheme to SSHA256 & SSHA384 respectively + 2. Execute /usr/bin/pwdhash -D /etc/dirsrv/slapd-instance_name/ <password> + 3. Check if there is any output + 4. Check if the command returns the hashed string using the algorithm set in nsslapd-rootpwstoragescheme + + :expectedresults: + 1. nsslapd-rootpwstoragescheme & passwordStorageScheme should set to SSHA256 & SSHA384 respectively + 2. Execution should PASS + 3. There should be an output from the command + 4. Command should return the hashed string using the algorithm set in nsslapd-rootpwstoragescheme + """ + + log.info('Running test_clu_pwdhash_mod...') + topology_st.standalone.config.set('nsslapd-rootpwstoragescheme', 'SSHA256') + topology_st.standalone.config.set('passwordStorageScheme', 'SSHA384') + cmd = [os.path.join(topology_st.standalone.get_bin_dir(), 'pwdhash'), '-D', '/etc/dirsrv/slapd-standalone1', + 'password'] + result = subprocess.check_output(cmd) + stdout = ensure_str(result) + assert result, "Failed to run pwdhash" + assert 'SSHA256' in stdout + log.info('pwdhash generated: ' + stdout) + log.info('returned the hashed string using the algorithm set in nsslapd-rootpwstoragescheme') + + if __name__ == '__main__': # Run isolated # -s for DEBUG mode CURRENT_FILE = os.path.realpath(__file__) pytest.main("-s %s" % CURRENT_FILE) -
389-commits@lists.fedoraproject.org