5789N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
5789N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
5789N/A<!--
5789N/A ! CDDL HEADER START
5789N/A !
5789N/A ! The contents of this file are subject to the terms of the
5789N/A ! Common Development and Distribution License, Version 1.0 only
5789N/A ! (the "License"). You may not use this file except in compliance
5789N/A ! with the License.
5789N/A !
5789N/A ! You can obtain a copy of the license at
5789N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
5789N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
5789N/A ! See the License for the specific language governing permissions
5789N/A ! and limitations under the License.
5789N/A !
5789N/A ! When distributing Covered Code, include this CDDL HEADER in each
5789N/A ! file and include the License file at
5789N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
5789N/A ! add the following below this CDDL HEADER, with the fields enclosed
5789N/A ! by brackets "[]" replaced with your own identifying information:
5789N/A ! Portions Copyright [yyyy] [name of copyright owner]
5789N/A !
5789N/A ! CDDL HEADER END
5789N/A !
5789N/A ! Copyright 2006-2008 Sun Microsystems, Inc.
5789N/A ! Portions copyright 2012 ForgeRock AS.
5789N/A ! -->
5789N/A<stax>
5789N/A
5789N/A <!--- Test Case information
5789N/A #@TestMarker Preencoded Passwords
5789N/A #@TestName Get Preencoded Password
5789N/A #@TestIssue none
5789N/A #@TestPurpose Get Preencoded Password
5789N/A #@TestPreamble none
5789N/A #@TestStep Check for existence of
5789N/A ds-cfg-allow-pre-encoded-passwords
5789N/A and value is set to false
5789N/A #@TestPostamble none
5789N/A #@TestResult Success if the test is PASS
5789N/A -->
5789N/A <function name="pwp_preemcoded_pwds_001" scope="local">
5789N/A <testcase name="getTestCaseName('PWP Get Preencoded Password')">
5789N/A <sequence>
5789N/A <try>
5789N/A <sequence>
5789N/A
5789N/A <call function="'testCase_Preamble'"/>
5789N/A
5789N/A <message>
5789N/A 'Test Name = %s' % STAXCurrentTestcase
5789N/A </message>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Get Allow Pre-encoded Password Property.' % msg1 }
5789N/A </call>
5789N/A
5789N/A <script>
5789N/A options=[]
5789N/A options.append('--policy-name "Default Password Policy"')
5789N/A options.append('--property "allow-pre-encoded-passwords"')
5881N/A options.append('--advanced')
5789N/A dsconfigOptions=' '.join(options)
5789N/A </script>
5789N/A
5789N/A <call function="'dsconfig'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
5789N/A 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
5789N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
5789N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
5789N/A 'subcommand' : 'get-password-policy-prop',
5789N/A 'optionsString' : dsconfigOptions,
5789N/A 'expectedString' : 'allow-pre-encoded-passwords : false'
5789N/A
5789N/A }
5789N/A </call>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Get Allow Pre-encoded Password Attribute.' % msg1 }
5789N/A </call>
5789N/A
5789N/A <call function="'compareEntry'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5789N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5789N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5789N/A 'attrToBeCompared' : 'ds-cfg-allow-pre-encoded-passwords:false',
5789N/A 'entryToBeCompared': basepwp }
5789N/A </call>
5789N/A
5789N/A </sequence>
5789N/A
5789N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5789N/A <message log="1" level="'fatal'">
5789N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5789N/A </message>
5789N/A </catch>
5789N/A <finally>
5789N/A <sequence>
5789N/A <call function="'testCase_Postamble'"/>
5789N/A </sequence>
5789N/A </finally>
5789N/A </try>
5789N/A </sequence>
5789N/A </testcase>
5789N/A </function>
5789N/A
5789N/A <!--- Test Case information
5789N/A #@TestMarker Preencoded Passwords
5789N/A #@TestName Add Entry With Pre-encoded Password
5789N/A #@TestIssue none
5789N/A #@TestPurpose Adding New Entry With a Pre-encoded Password
5789N/A #@TestPreamble none
5789N/A #@TestStep addEntry add_entry_preencoded_pwd.ldif RC 19
5789N/A SearchObject returns 49
5789N/A #@TestPostamble none
5789N/A #@TestResult Success if the test is PASS
5789N/A -->
5789N/A <function name="pwp_preemcoded_pwds_002" scope="local">
5789N/A <testcase name="getTestCaseName('PWP Default - Add New Entry')">
5789N/A <sequence>
5789N/A <try>
5789N/A <sequence>
5789N/A
5789N/A <call function="'testCase_Preamble'"/>
5789N/A
5789N/A <message>
5789N/A 'Test Name = %s' % STAXCurrentTestcase
5789N/A </message>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Adding New Entry With a Pre-encoded Password.' % msg1 }
5789N/A </call>
5789N/A
5789N/A <call function="'addEntry'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5789N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5789N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5789N/A 'entryToBeAdded' : '%s/password_policy/add_entry_preencoded_pwd.ldif' \
5789N/A % remote.data ,
5789N/A 'expectedRC' : 19 }
5789N/A </call>
5789N/A
5789N/A <call function="'SearchObject'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5789N/A 'dsInstanceDn' : 'uid=pguy,%s' % basedn ,
5789N/A 'dsInstancePswd' : 'superguy' ,
5789N/A 'dsBaseDN' : 'dc=example,dc=com' ,
5789N/A 'dsFilter' : 'objectclass=*' ,
5789N/A 'extraParams' : '-s base' ,
5789N/A 'expectedRC' : 49 }
5789N/A </call>
5789N/A
5789N/A </sequence>
5789N/A
5789N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5789N/A <message log="1" level="'fatal'">
5789N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5789N/A </message>
5789N/A </catch>
5789N/A <finally>
5789N/A <sequence>
5789N/A <call function="'testCase_Postamble'"/>
5789N/A </sequence>
5789N/A </finally>
5789N/A </try>
5789N/A </sequence>
5789N/A </testcase>
5789N/A </function>
5789N/A
5789N/A <!--- Test Case information
5789N/A #@TestMarker Preencoded Passwords
5789N/A #@TestName Enable Pre-encoded Passwords in pwd policy
5789N/A #@TestIssue none
5789N/A #@TestPurpose Admin Enabling Preencoded Passwords
5789N/A #@TestPreamble none
5789N/A #@TestStep set allow-pre-encoded-passwords to true
5789N/A #@TestPostamble none
5789N/A #@TestResult Success if the test is PASS
5789N/A -->
5789N/A <function name="pwp_preemcoded_pwds_003" scope="local">
5789N/A <testcase name="getTestCaseName('PWP Enable Preencoded Passwords')">
5789N/A <sequence>
5789N/A <try>
5789N/A <sequence>
5789N/A
5789N/A <call function="'testCase_Preamble'"/>
5789N/A
5789N/A <message>
5789N/A 'Test Name = %s' % STAXCurrentTestcase
5789N/A </message>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Set Allow Pre-encoded Password to true.' % msg1 }
5789N/A </call>
5789N/A
5789N/A <script>
5789N/A options=[]
5789N/A options.append('--policy-name "Default Password Policy"')
5789N/A options.append('--set "allow-pre-encoded-passwords:true"')
5789N/A dsconfigOptions=' '.join(options)
5789N/A </script>
5789N/A
5789N/A <call function="'dsconfig'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
5789N/A 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
5789N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
5789N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
5789N/A 'subcommand' : 'set-password-policy-prop',
5789N/A 'optionsString' : dsconfigOptions
5789N/A }
5789N/A </call>
5789N/A
5789N/A </sequence>
5789N/A
5789N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5789N/A <message log="1" level="'fatal'">
5789N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5789N/A </message>
5789N/A </catch>
5789N/A <finally>
5789N/A <sequence>
5789N/A <call function="'testCase_Postamble'"/>
5789N/A </sequence>
5789N/A </finally>
5789N/A </try>
5789N/A </sequence>
5789N/A </testcase>
5789N/A </function>
5789N/A
5789N/A <!--- Test Case information
5789N/A #@TestMarker Preencoded Passwords
5789N/A #@TestName Test Enabled Pre-encoded Passwords
5789N/A #@TestIssue none
5789N/A #@TestPurpose Test Enabled Pre-encoded Passwords
5789N/A #@TestPreamble none
5789N/A #@TestStep addEntry add_entry_preencoded_pwd.ldif RC 0
5789N/A SearchObject returns 0
5789N/A #@TestPostamble none
5789N/A #@TestResult Success if the test is PASS
5789N/A -->
5789N/A <function name="pwp_preemcoded_pwds_004" scope="local">
5789N/A <testcase name="getTestCaseName('PWP Enabled - Add New Entry')">
5789N/A <sequence>
5789N/A <try>
5789N/A <sequence>
5789N/A
5789N/A <call function="'testCase_Preamble'"/>
5789N/A
5789N/A <message>
5789N/A 'Test Name = %s' % STAXCurrentTestcase
5789N/A </message>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Add New Entry With Pre-encoded Password.' % msg1 }
5789N/A </call>
5789N/A
5789N/A <call function="'addEntry'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5789N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5789N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5789N/A 'entryToBeAdded' : '%s/password_policy/add_entry_preencoded_pwd.ldif' \
5789N/A % remote.data }
5789N/A </call>
5789N/A
5789N/A <call function="'SearchObject'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5789N/A 'dsInstanceDn' : 'uid=pguy,%s' % basedn ,
5789N/A 'dsInstancePswd' : 'superguy' ,
5789N/A 'dsBaseDN' : 'dc=example,dc=com' ,
5789N/A 'dsFilter' : 'objectclass=*' ,
5789N/A 'extraParams' : '-s base' }
5789N/A </call>
5789N/A
5789N/A </sequence>
5789N/A
5789N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5789N/A <message log="1" level="'fatal'">
5789N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5789N/A </message>
5789N/A </catch>
5789N/A <finally>
5789N/A <sequence>
5789N/A <call function="'testCase_Postamble'"/>
5789N/A </sequence>
5789N/A </finally>
5789N/A </try>
5789N/A </sequence>
5789N/A </testcase>
5789N/A </function>
5789N/A
5789N/A <!--- Test Case information
5789N/A #@TestMarker Preencoded Passwords
5789N/A #@TestName Reset Pre-encoded Passwords
5789N/A #@TestIssue none
5789N/A #@TestPurpose Admin Reset Pre-encoded Passwords
5789N/A #@TestPreamble none
5789N/A #@TestStep Disable Pre-encoded Passwords 0
5789N/A SearchObject returns 49
5789N/A #@TestPostamble none
5789N/A #@TestResult Success if the test is PASS
5789N/A -->
5789N/A <function name="pwp_preemcoded_pwds_005" scope="local">
5789N/A <testcase name="getTestCaseName('PWP Disable Preencoded Passwords')">
5789N/A <sequence>
5789N/A <try>
5789N/A <sequence>
5789N/A
5789N/A <call function="'testCase_Preamble'"/>
5789N/A
5789N/A <message>
5789N/A 'Test Name = %s' % STAXCurrentTestcase
5789N/A </message>
5789N/A
5789N/A <call function="'testStep'">
5789N/A { 'stepMessage' : '%s Reset Allow Pre-encoded Password.' % msg1 }
5789N/A </call>
5789N/A
5789N/A <script>
5789N/A options=[]
5789N/A options.append('--policy-name "Default Password Policy"')
5789N/A options.append('--reset "allow-pre-encoded-passwords"')
5789N/A dsconfigOptions=' '.join(options)
5789N/A </script>
5789N/A
5789N/A <call function="'dsconfig'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
5789N/A 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
5789N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
5789N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
5789N/A 'subcommand' : 'set-password-policy-prop',
5789N/A 'optionsString' : dsconfigOptions
5789N/A }
5789N/A </call>
5789N/A
5789N/A <call function="'SearchObject'">
5789N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5789N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5789N/A 'dsInstanceDn' : 'uid=pgal,%s' % basedn ,
5789N/A 'dsInstancePswd' : 'supergal' ,
5789N/A 'dsBaseDN' : 'dc=example,dc=com' ,
5789N/A 'dsFilter' : 'objectclass=*' ,
5789N/A 'extraParams' : '-s base' ,
5789N/A 'expectedRC' : 49 }
5789N/A </call>
5789N/A
5789N/A </sequence>
5789N/A
5789N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5789N/A <message log="1" level="'fatal'">
5789N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5789N/A </message>
5789N/A </catch>
5789N/A <finally>
5789N/A <sequence>
5789N/A <call function="'testCase_Postamble'"/>
5789N/A </sequence>
5789N/A </finally>
5789N/A </try>
5789N/A </sequence>
5789N/A </testcase>
5789N/A </function>
5789N/A
5789N/A</stax>