pta_basic_tests.xml revision 5562
5541N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
5541N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
5541N/A<!--
5541N/A ! CDDL HEADER START
5541N/A !
5541N/A ! The contents of this file are subject to the terms of the
5541N/A ! Common Development and Distribution License, Version 1.0 only
5541N/A ! (the "License"). You may not use this file except in compliance
5541N/A ! with the License.
5541N/A !
5541N/A ! You can obtain a copy of the license at
5541N/A ! trunk/opends/resource/legal-notices/CDDLv1_0.txt
5541N/A ! or http://forgerock.org/license/CDDLv1.0.html.
5541N/A ! See the License for the specific language governing permissions
5541N/A ! and limitations under the License.
5541N/A !
5541N/A ! When distributing Covered Code, include this CDDL HEADER in each
5541N/A ! file and include the License file at
5541N/A ! trunk/opends/resource/legal-notices/CDDLv1_0.txt. If applicable,
5541N/A ! add the following below this CDDL HEADER, with the fields enclosed
5541N/A ! by brackets "[]" replaced with your own identifying information:
5541N/A ! Portions Copyright [yyyy] [name of copyright owner]
5541N/A !
5541N/A ! CDDL HEADER END
5541N/A !
5541N/A ! Copyright 2011 ForgeRock AS
5541N/A ! -->
5541N/A<stax>
5541N/A
5541N/A <!-- Definition of Test Cases -->
5541N/A
5541N/A <!--- Test Cases : Basic : PTA -->
5562N/A
5562N/A <!--- Test Case information
5562N/A #@TestMarker Basic: PTA connection-timeout
5562N/A #@TestName Basic: PTA connection-timeout
5562N/A #@TestID basic_pta_001
5562N/A #@TestPurpose Verify user with a LDAP PTA mapped-search policy can authenticated to remote server
5562N/A #@TestPreamble Setup PTA
5562N/A #@TestStep Configure LDAP PTA Policy using connection-timeout
5562N/A #@TestStep Read back the "authentication policy" object
5562N/A #@TestStep Add ds-pwp-password-policy-dn to users entry
5562N/A #@TestStep Search users entry as Directory Manager for operational attributes
5562N/A #@TestStep Search users entry as self
5562N/A #@TestStep Modify the users entry
5562N/A #@TestPostamble Cleanup PTA
5562N/A #@TestResult Test is successful if the result code is 0
5562N/A -->
5562N/A <function name="basic_pta_001" scope="local">
5562N/A <message>'Not implemented.'</message>
5562N/A </function>
5562N/A
5541N/A <!--- Test Case information
5548N/A #@TestMarker Basic: PTA anon unmapped
5548N/A #@TestName Basic: PTA anon unmapped
5562N/A #@TestID basic_pta_002
5541N/A #@TestPurpose Verify user with a LDAP PTA unmapped policy can authenticated to remote server
5548N/A #@TestPreamble Setup PTA
5548N/A #@TestStep Enable AD backend on local server
5548N/A #@TestStep Configure LDAP PTA Policy as unmapped
5546N/A #@TestStep Read back the "authentication policy" object
5546N/A #@TestStep Add ds-pwp-password-policy-dn to users entry
5546N/A #@TestStep Search users entry as Directory Manager for operational attributes
5546N/A #@TestStep Search users entry as self
5546N/A #@TestStep Modify the users entry
5548N/A #@TestStep Disable AD backend on local server
5546N/A #@TestPostamble Cleanup PTA
5541N/A #@TestResult Test is successful if the result code is 0
5541N/A -->
5562N/A <function name="basic_pta_002" scope="local">
5548N/A <testcase name="getTestCaseName('PTA anon unmapped')">
5546N/A <sequence>
5546N/A <try>
5546N/A <sequence>
5546N/A <call function="'testCase_Preamble'"/>
5546N/A <message>
5546N/A 'Test Name = %s' % STAXCurrentTestcase
5546N/A </message>
5546N/A
5546N/A <call function="'testStep'">
5548N/A { 'stepMessage' : 'Enable AD backend on local server.' }
5548N/A </call>
5548N/A
5548N/A <script>
5548N/A options=[]
5548N/A options.append('--backend-name "AD"')
5548N/A options.append('--set enabled:true')
5548N/A dsconfigOptions=' '.join(options)
5548N/A </script>
5548N/A
5548N/A <call function="'dsconfig'">
5548N/A { 'location' : local_ldap_server.getHostname(),
5548N/A 'dsPath' : '%s/%s' \
5548N/A % (local_ldap_server.getDir(),OPENDSNAME),
5548N/A 'dsInstanceHost' : local_ldap_server.getHostname(),
5548N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5548N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5548N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5548N/A 'subcommand' : 'set-backend-prop',
5548N/A 'optionsString' : dsconfigOptions
5548N/A }
5548N/A </call>
5548N/A
5548N/A <call function="'testStep'">
5548N/A { 'stepMessage' : 'Configure LDAP PTA Policy as unmapped.' }
5546N/A </call>
5546N/A
5546N/A <script>
5546N/A options=[]
5546N/A options.append('--set primary-remote-ldap-server:%s:%s' % (primaryHost,primaryPort))
5548N/A options.append('--set mapping-policy:unmapped')
5546N/A options.append('--set secondary-remote-ldap-server:%s:%s' % (secondaryHost,secondaryPort))
5546N/A options.append('--type ldap-pass-through')
5548N/A options.append('--policy-name "%s"' % ldapPtaPolicyName)
5546N/A dsconfigOptions=' '.join(options)
5546N/A </script>
5546N/A
5546N/A <call function="'dsconfig'">
5546N/A { 'location' : local_ldap_server.getHostname(),
5546N/A 'dsPath' : '%s/%s' \
5546N/A % (local_ldap_server.getDir(),OPENDSNAME),
5546N/A 'dsInstanceHost' : local_ldap_server.getHostname(),
5546N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5546N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5546N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5546N/A 'subcommand' : 'create-password-policy',
5546N/A 'optionsString' : dsconfigOptions
5546N/A }
5546N/A </call>
5546N/A
5546N/A <call function="'testStep'">
5546N/A { 'stepMessage' : 'Read back the "authentication policy" object.' }
5546N/A </call>
5546N/A
5546N/A <script>
5546N/A options=[]
5548N/A options.append('--policy-name "%s"' % ldapPtaPolicyName)
5548N/A dsconfigOptions=' '.join(options)
5548N/A </script>
5548N/A
5548N/A <call function="'dsconfig'">
5548N/A { 'location' : local_ldap_server.getHostname(),
5548N/A 'dsPath' : '%s/%s' \
5548N/A % (local_ldap_server.getDir(),OPENDSNAME),
5548N/A 'dsInstanceHost' : local_ldap_server.getHostname(),
5548N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5548N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5548N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5548N/A 'subcommand' : 'get-password-policy-prop',
5548N/A 'optionsString' : dsconfigOptions
5548N/A }
5548N/A </call>
5548N/A
5548N/A <call function="'testStep'">
5548N/A { 'stepMessage' : 'Add ds-pwp-password-policy-dn to users entry.' }
5548N/A </call>
5548N/A
5548N/A <script>
5548N/A remotePTAuserName='uid=jwallace, ou=People, dc=AD,dc=com'
5548N/A remotePTAuserPSWD='linear'
5548N/A ldapObject=[]
5548N/A ldapObject.append('ds-pwp-password-policy-dn: %s' \
5548N/A % ldapPtaPolicyDn)
5548N/A </script>
5548N/A
5548N/A <call function="'modifyAnAttribute'">
5548N/A { 'location' : local_ldap_server.getHostname(),
5548N/A 'dsPath' : '%s/%s' \
5548N/A % (local_ldap_server.getDir(),OPENDSNAME),
5548N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5548N/A 'dsInstancePort' : local_ldap_server.getPort(),
5548N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5548N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5548N/A 'DNToModify' : remotePTAuserName ,
5548N/A 'listAttributes' : ldapObject ,
5548N/A 'changetype' : 'add'
5548N/A }
5548N/A </call>
5548N/A
5548N/A <call function="'testStep'">
5548N/A { 'stepMessage' : 'Search users entry as Directory Manager for operational attributes.' }
5548N/A </call>
5548N/A
5548N/A <call function="'ldapSearchWithScript'">
5548N/A { 'location' : local_ldap_server.getHostname(),
5548N/A 'dsPath' : '%s/%s' \
5548N/A % (local_ldap_server.getDir(),OPENDSNAME),
5548N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5548N/A 'dsInstancePort' : local_ldap_server.getPort(),
5548N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5548N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5548N/A 'dsBaseDN' : remotePTAuserName ,
5548N/A 'dsFilter' : 'objectclass=*' ,
5548N/A 'dsAttributes' : '+'
5548N/A }
5548N/A </call>
5548N/A
5548N/A <call function="'testStep'">
5548N/A { 'stepMessage' : 'Search users entry as self.' }
5548N/A </call>
5548N/A
5548N/A <call function="'ldapSearchWithScript'">
5548N/A { 'location' : local_ldap_server.getHostname(),
5548N/A 'dsPath' : '%s/%s' \
5548N/A % (local_ldap_server.getDir(),OPENDSNAME),
5548N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5548N/A 'dsInstancePort' : local_ldap_server.getPort(),
5548N/A 'dsInstanceDn' : remotePTAuserName,
5548N/A 'dsInstancePswd' : remotePTAuserPSWD ,
5548N/A 'dsBaseDN' : remotePTAuserName ,
5548N/A 'dsFilter' : 'objectclass=*'
5548N/A }
5548N/A </call>
5548N/A
5548N/A <call function="'testStep'">
5548N/A { 'stepMessage' : 'Modify the users entry.' }
5548N/A </call>
5548N/A
5548N/A <script>
5548N/A ldapObject=[]
5548N/A ldapObject.append('description: i am now a remote LDAP PTA user')
5548N/A </script>
5548N/A
5548N/A <call function="'modifyAnAttribute'">
5548N/A { 'location' : local_ldap_server.getHostname(),
5548N/A 'dsPath' : '%s/%s' \
5548N/A % (local_ldap_server.getDir(),OPENDSNAME),
5548N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5548N/A 'dsInstancePort' : local_ldap_server.getPort(),
5548N/A 'dsInstanceDn' : remotePTAuserName,
5548N/A 'dsInstancePswd' : remotePTAuserPSWD,
5548N/A 'DNToModify' : remotePTAuserName ,
5548N/A 'listAttributes' : ldapObject ,
5548N/A 'changetype' : 'replace'
5548N/A }
5548N/A </call>
5548N/A
5548N/A </sequence>
5548N/A
5548N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5548N/A <message log="1" level="'fatal'">
5548N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5548N/A </message>
5548N/A </catch>
5548N/A <finally>
5560N/A <sequence>
5560N/A <call function="'pta_postamble1'"/>
5560N/A <call function="'pta_postamble2'"/>
5560N/A <call function="'testCase_Postamble'"/>
5560N/A </sequence>
5548N/A </finally>
5548N/A </try>
5548N/A </sequence>
5548N/A </testcase>
5548N/A </function>
5548N/A
5548N/A <!--- Test Case information
5548N/A #@TestMarker Basic: PTA anon mapped-bind
5548N/A #@TestName Basic: PTA anon mapped-bind
5562N/A #@TestID basic_pta_003
5548N/A #@TestPurpose Verify user with a LDAP PTA mapped-bind policy can authenticated to remote server
5548N/A #@TestPreamble Setup PTA
5548N/A #@TestStep Configure LDAP PTA Policy for mapped-bind
5548N/A #@TestStep Read back the "authentication policy" object
5548N/A #@TestStep Add ds-pwp-password-policy-dn to users entry
5548N/A #@TestStep Search users entry as Directory Manager for operational attributes
5548N/A #@TestStep Search users entry as self
5548N/A #@TestStep Modify the users entry
5548N/A #@TestPostamble Cleanup PTA
5548N/A #@TestResult Test is successful if the result code is 0
5548N/A -->
5562N/A <function name="basic_pta_003" scope="local">
5548N/A <testcase name="getTestCaseName('PTA anon mapped-bind')">
5548N/A <sequence>
5548N/A <try>
5548N/A <sequence>
5548N/A <call function="'testCase_Preamble'"/>
5548N/A <message>
5548N/A 'Test Name = %s' % STAXCurrentTestcase
5548N/A </message>
5548N/A
5548N/A <call function="'testStep'">
5548N/A { 'stepMessage' : 'onfigure LDAP PTA Policy for mapped-bind.' }
5548N/A </call>
5548N/A
5548N/A <script>
5548N/A options=[]
5548N/A options.append('--set primary-remote-ldap-server:%s:%s' % (primaryHost,primaryPort))
5548N/A options.append('--set mapped-attribute:seealso')
5548N/A options.append('--set mapping-policy:mapped-bind')
5548N/A options.append('--set secondary-remote-ldap-server:%s:%s' % (secondaryHost,secondaryPort))
5548N/A options.append('--type ldap-pass-through')
5548N/A options.append('--policy-name "%s"' % ldapPtaPolicyName)
5548N/A dsconfigOptions=' '.join(options)
5548N/A </script>
5548N/A
5548N/A <call function="'dsconfig'">
5548N/A { 'location' : local_ldap_server.getHostname(),
5548N/A 'dsPath' : '%s/%s' \
5548N/A % (local_ldap_server.getDir(),OPENDSNAME),
5548N/A 'dsInstanceHost' : local_ldap_server.getHostname(),
5548N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5548N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5548N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5548N/A 'subcommand' : 'create-password-policy',
5548N/A 'optionsString' : dsconfigOptions
5548N/A }
5548N/A </call>
5548N/A
5548N/A <call function="'testStep'">
5548N/A { 'stepMessage' : 'Read back the "authentication policy" object.' }
5548N/A </call>
5548N/A
5548N/A <script>
5548N/A options=[]
5548N/A options.append('--policy-name "%s"' % ldapPtaPolicyName)
5546N/A dsconfigOptions=' '.join(options)
5546N/A </script>
5546N/A
5546N/A <call function="'dsconfig'">
5546N/A { 'location' : local_ldap_server.getHostname(),
5546N/A 'dsPath' : '%s/%s' \
5546N/A % (local_ldap_server.getDir(),OPENDSNAME),
5546N/A 'dsInstanceHost' : local_ldap_server.getHostname(),
5546N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5546N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5546N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5546N/A 'subcommand' : 'get-password-policy-prop',
5546N/A 'optionsString' : dsconfigOptions
5546N/A }
5546N/A </call>
5546N/A
5546N/A <call function="'testStep'">
5546N/A { 'stepMessage' : 'Add ds-pwp-password-policy-dn to users entry.' }
5546N/A </call>
5546N/A
5546N/A <script>
5546N/A remotePTAuserName='uid=jmcFarla, ou=People, o=example'
5546N/A remotePTAuserPSWD='walnut'
5546N/A ldapObject=[]
5546N/A ldapObject.append('ds-pwp-password-policy-dn: %s' \
5546N/A % ldapPtaPolicyDn)
5546N/A </script>
5546N/A
5546N/A <call function="'modifyAnAttribute'">
5546N/A { 'location' : local_ldap_server.getHostname(),
5546N/A 'dsPath' : '%s/%s' \
5546N/A % (local_ldap_server.getDir(),OPENDSNAME),
5546N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5546N/A 'dsInstancePort' : local_ldap_server.getPort(),
5546N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5546N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5546N/A 'DNToModify' : remotePTAuserName ,
5546N/A 'listAttributes' : ldapObject ,
5546N/A 'changetype' : 'add'
5546N/A }
5546N/A </call>
5546N/A
5546N/A <call function="'testStep'">
5546N/A { 'stepMessage' : 'Search users entry as Directory Manager for operational attributes.' }
5546N/A </call>
5546N/A
5546N/A <call function="'ldapSearchWithScript'">
5546N/A { 'location' : local_ldap_server.getHostname(),
5546N/A 'dsPath' : '%s/%s' \
5546N/A % (local_ldap_server.getDir(),OPENDSNAME),
5546N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5546N/A 'dsInstancePort' : local_ldap_server.getPort(),
5546N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5546N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5546N/A 'dsBaseDN' : remotePTAuserName ,
5546N/A 'dsFilter' : 'objectclass=*' ,
5546N/A 'dsAttributes' : '+'
5546N/A }
5546N/A </call>
5546N/A
5546N/A <call function="'testStep'">
5546N/A { 'stepMessage' : 'Search users entry as self.' }
5546N/A </call>
5546N/A
5546N/A <call function="'ldapSearchWithScript'">
5546N/A { 'location' : local_ldap_server.getHostname(),
5546N/A 'dsPath' : '%s/%s' \
5546N/A % (local_ldap_server.getDir(),OPENDSNAME),
5546N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5546N/A 'dsInstancePort' : local_ldap_server.getPort(),
5546N/A 'dsInstanceDn' : remotePTAuserName,
5546N/A 'dsInstancePswd' : remotePTAuserPSWD ,
5546N/A 'dsBaseDN' : remotePTAuserName ,
5546N/A 'dsFilter' : 'objectclass=*'
5546N/A }
5546N/A </call>
5546N/A
5546N/A <call function="'testStep'">
5546N/A { 'stepMessage' : 'Modify the users entry.' }
5546N/A </call>
5546N/A
5546N/A <script>
5546N/A ldapObject=[]
5546N/A ldapObject.append('description: i am now a remote LDAP PTA user')
5546N/A </script>
5546N/A
5546N/A <call function="'modifyAnAttribute'">
5546N/A { 'location' : local_ldap_server.getHostname(),
5546N/A 'dsPath' : '%s/%s' \
5546N/A % (local_ldap_server.getDir(),OPENDSNAME),
5546N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5546N/A 'dsInstancePort' : local_ldap_server.getPort(),
5546N/A 'dsInstanceDn' : remotePTAuserName,
5546N/A 'dsInstancePswd' : remotePTAuserPSWD,
5546N/A 'DNToModify' : remotePTAuserName ,
5546N/A 'listAttributes' : ldapObject ,
5546N/A 'changetype' : 'replace'
5546N/A }
5546N/A </call>
5546N/A
5546N/A </sequence>
5546N/A
5546N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5546N/A <message log="1" level="'fatal'">
5546N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5546N/A </message>
5546N/A </catch>
5546N/A <finally>
5560N/A <sequence>
5560N/A <call function="'pta_postamble1'"/>
5560N/A <call function="'testCase_Postamble'"/>
5560N/A </sequence>
5546N/A </finally>
5546N/A </try>
5546N/A </sequence>
5546N/A </testcase>
5546N/A </function>
5541N/A
5541N/A <!--- Test Case information
5548N/A #@TestMarker Basic: PTA anon mapped-search
5548N/A #@TestName Basic: PTA anon mapped-search
5562N/A #@TestID basic_pta_004
5541N/A #@TestPurpose Verify user with a LDAP PTA mapped-search policy can authenticated to remote server
5548N/A #@TestPreamble Setup PTA
5546N/A #@TestStep Configure LDAP PTA Policy for mapped-search
5546N/A #@TestStep Read back the "authentication policy" object
5546N/A #@TestStep Add ds-pwp-password-policy-dn to users entry
5546N/A #@TestStep Search users entry as Directory Manager for operational attributes
5546N/A #@TestStep Search users entry as self
5546N/A #@TestStep Modify the users entry
5546N/A #@TestPostamble Cleanup PTA
5541N/A #@TestResult Test is successful if the result code is 0
5541N/A -->
5562N/A <function name="basic_pta_004" scope="local">
5548N/A <testcase name="getTestCaseName('PTA anon mapped-search')">
5541N/A <sequence>
5541N/A <try>
5541N/A <sequence>
5541N/A <call function="'testCase_Preamble'"/>
5541N/A <message>
5541N/A 'Test Name = %s' % STAXCurrentTestcase
5541N/A </message>
5541N/A
5546N/A <call function="'testStep'">
5548N/A { 'stepMessage' : 'Configure LDAP PTA Policy for mapped-search.' }
5546N/A </call>
5546N/A
5541N/A <script>
5541N/A options=[]
5541N/A options.append('--set primary-remote-ldap-server:%s:%s' % (primaryHost,primaryPort))
5541N/A options.append('--set mapped-attribute:cn')
5541N/A options.append('--set mapped-search-base-dn:dc=AD,dc=com')
5541N/A options.append('--set mapping-policy:mapped-search')
5541N/A options.append('--set secondary-remote-ldap-server:%s:%s' % (secondaryHost,secondaryPort))
5541N/A options.append('--type ldap-pass-through')
5548N/A options.append('--policy-name "%s"' % ldapPtaPolicyName)
5548N/A dsconfigOptions=' '.join(options)
5548N/A </script>
5548N/A
5548N/A <call function="'dsconfig'">
5548N/A { 'location' : local_ldap_server.getHostname(),
5548N/A 'dsPath' : '%s/%s' \
5548N/A % (local_ldap_server.getDir(),OPENDSNAME),
5548N/A 'dsInstanceHost' : local_ldap_server.getHostname(),
5548N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5548N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5548N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5548N/A 'subcommand' : 'create-password-policy',
5548N/A 'optionsString' : dsconfigOptions
5548N/A }
5548N/A </call>
5548N/A
5548N/A <call function="'testStep'">
5548N/A { 'stepMessage' : 'Read back the "authentication policy" object.' }
5548N/A </call>
5548N/A
5548N/A <script>
5548N/A options=[]
5548N/A options.append('--policy-name "%s"' % ldapPtaPolicyName)
5548N/A dsconfigOptions=' '.join(options)
5548N/A </script>
5548N/A
5548N/A <call function="'dsconfig'">
5548N/A { 'location' : local_ldap_server.getHostname(),
5548N/A 'dsPath' : '%s/%s' \
5548N/A % (local_ldap_server.getDir(),OPENDSNAME),
5548N/A 'dsInstanceHost' : local_ldap_server.getHostname(),
5548N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5548N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5548N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5548N/A 'subcommand' : 'get-password-policy-prop',
5548N/A 'optionsString' : dsconfigOptions
5548N/A }
5548N/A </call>
5548N/A
5548N/A <call function="'testStep'">
5548N/A { 'stepMessage' : 'Add ds-pwp-password-policy-dn to users entry.' }
5548N/A </call>
5548N/A
5548N/A <script>
5548N/A remotePTAuserName='uid=jvedder, ou=People, o=example'
5548N/A remotePTAuserPSWD='befitting'
5548N/A ldapObject=[]
5548N/A ldapObject.append('ds-pwp-password-policy-dn: %s' \
5548N/A % ldapPtaPolicyDn)
5548N/A </script>
5548N/A
5548N/A <call function="'modifyAnAttribute'">
5548N/A { 'location' : local_ldap_server.getHostname(),
5548N/A 'dsPath' : '%s/%s' \
5548N/A % (local_ldap_server.getDir(),OPENDSNAME),
5548N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5548N/A 'dsInstancePort' : local_ldap_server.getPort(),
5548N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5548N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5548N/A 'DNToModify' : remotePTAuserName ,
5548N/A 'listAttributes' : ldapObject ,
5548N/A 'changetype' : 'add'
5548N/A }
5548N/A </call>
5548N/A
5548N/A <call function="'testStep'">
5548N/A { 'stepMessage' : 'Search users entry as Directory Manager for operational attributes.' }
5548N/A </call>
5548N/A
5548N/A <call function="'ldapSearchWithScript'">
5548N/A { 'location' : local_ldap_server.getHostname(),
5548N/A 'dsPath' : '%s/%s' \
5548N/A % (local_ldap_server.getDir(),OPENDSNAME),
5548N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5548N/A 'dsInstancePort' : local_ldap_server.getPort(),
5548N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5548N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5548N/A 'dsBaseDN' : remotePTAuserName ,
5548N/A 'dsFilter' : 'objectclass=*' ,
5548N/A 'dsAttributes' : '+'
5548N/A }
5548N/A </call>
5548N/A
5548N/A <call function="'testStep'">
5548N/A { 'stepMessage' : 'Search users entry as self.' }
5548N/A </call>
5548N/A
5548N/A <call function="'ldapSearchWithScript'">
5548N/A { 'location' : local_ldap_server.getHostname(),
5548N/A 'dsPath' : '%s/%s' \
5548N/A % (local_ldap_server.getDir(),OPENDSNAME),
5548N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5548N/A 'dsInstancePort' : local_ldap_server.getPort(),
5548N/A 'dsInstanceDn' : remotePTAuserName,
5548N/A 'dsInstancePswd' : remotePTAuserPSWD ,
5548N/A 'dsBaseDN' : remotePTAuserName ,
5548N/A 'dsFilter' : 'objectclass=*'
5548N/A }
5548N/A </call>
5548N/A
5548N/A <call function="'testStep'">
5548N/A { 'stepMessage' : 'Modify the users entry.' }
5548N/A </call>
5548N/A
5548N/A <script>
5548N/A ldapObject=[]
5548N/A ldapObject.append('description: i am now a remote LDAP PTA user')
5548N/A </script>
5548N/A
5548N/A <call function="'modifyAnAttribute'">
5548N/A { 'location' : local_ldap_server.getHostname(),
5548N/A 'dsPath' : '%s/%s' \
5548N/A % (local_ldap_server.getDir(),OPENDSNAME),
5548N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5548N/A 'dsInstancePort' : local_ldap_server.getPort(),
5548N/A 'dsInstanceDn' : remotePTAuserName,
5548N/A 'dsInstancePswd' : remotePTAuserPSWD,
5548N/A 'DNToModify' : remotePTAuserName ,
5548N/A 'listAttributes' : ldapObject ,
5548N/A 'changetype' : 'replace'
5548N/A }
5548N/A </call>
5548N/A
5548N/A </sequence>
5548N/A
5548N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5548N/A <message log="1" level="'fatal'">
5548N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5548N/A </message>
5548N/A </catch>
5548N/A <finally>
5560N/A <sequence>
5560N/A <call function="'pta_postamble1'"/>
5560N/A <call function="'testCase_Postamble'"/>
5560N/A </sequence>
5548N/A </finally>
5548N/A </try>
5548N/A </sequence>
5548N/A </testcase>
5548N/A </function>
5548N/A
5548N/A <!--- Test Case information
5560N/A #@TestMarker Basic: PTA simple mapped-search
5560N/A #@TestName Basic: PTA simple mapped-search
5562N/A #@TestID basic_pta_005
5548N/A #@TestPurpose Verify user with a LDAP PTA mapped-search policy can authenticated to remote server
5548N/A #@TestPreamble Setup PTA
5548N/A #@TestStep Configure LDAP PTA Policy using mapped-search-bind credentials
5548N/A #@TestStep Read back the "authentication policy" object
5548N/A #@TestStep Add ds-pwp-password-policy-dn to users entry
5548N/A #@TestStep Search users entry as Directory Manager for operational attributes
5548N/A #@TestStep Search users entry as self
5548N/A #@TestStep Modify the users entry
5548N/A #@TestPostamble Cleanup PTA
5548N/A #@TestResult Test is successful if the result code is 0
5548N/A -->
5562N/A <function name="basic_pta_005" scope="local">
5548N/A <testcase name="getTestCaseName('PTA simple mapped-search-bind')">
5548N/A <sequence>
5548N/A <try>
5548N/A <sequence>
5548N/A <call function="'testCase_Preamble'"/>
5548N/A <message>
5548N/A 'Test Name = %s' % STAXCurrentTestcase
5548N/A </message>
5548N/A
5548N/A <call function="'testStep'">
5548N/A { 'stepMessage' : 'Configure LDAP PTA Policy using mapped-search-bind credentials.' }
5548N/A </call>
5548N/A
5548N/A <script>
5548N/A options=[]
5548N/A options.append('--set primary-remote-ldap-server:%s:%s' % (primaryHost,primaryPort))
5548N/A options.append('--set mapped-attribute:cn')
5548N/A options.append('--set mapped-search-base-dn:dc=AD,dc=com')
5548N/A options.append('--set mapped-search-bind-dn:"cn=Directory Manager"')
5548N/A options.append('--set mapped-search-bind-password:secret12')
5548N/A options.append('--set mapping-policy:mapped-search')
5548N/A options.append('--set secondary-remote-ldap-server:%s:%s' % (secondaryHost,secondaryPort))
5548N/A options.append('--type ldap-pass-through')
5548N/A options.append('--policy-name "%s"' % ldapPtaPolicyName)
5541N/A dsconfigOptions=' '.join(options)
5541N/A </script>
5541N/A
5541N/A <call function="'dsconfig'">
5541N/A { 'location' : local_ldap_server.getHostname(),
5541N/A 'dsPath' : '%s/%s' \
5541N/A % (local_ldap_server.getDir(),OPENDSNAME),
5541N/A 'dsInstanceHost' : local_ldap_server.getHostname(),
5541N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5541N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5541N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5541N/A 'subcommand' : 'create-password-policy',
5541N/A 'optionsString' : dsconfigOptions
5541N/A }
5541N/A </call>
5541N/A
5546N/A <call function="'testStep'">
5546N/A { 'stepMessage' : 'Read back the "authentication policy" object.' }
5546N/A </call>
5546N/A
5541N/A <script>
5541N/A options=[]
5546N/A options.append('--policy-name "%s"' % ldapPtaPolicyName)
5541N/A dsconfigOptions=' '.join(options)
5541N/A </script>
5541N/A
5541N/A <call function="'dsconfig'">
5541N/A { 'location' : local_ldap_server.getHostname(),
5541N/A 'dsPath' : '%s/%s' \
5541N/A % (local_ldap_server.getDir(),OPENDSNAME),
5541N/A 'dsInstanceHost' : local_ldap_server.getHostname(),
5541N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5541N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5541N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5541N/A 'subcommand' : 'get-password-policy-prop',
5541N/A 'optionsString' : dsconfigOptions
5541N/A }
5541N/A </call>
5541N/A
5546N/A <call function="'testStep'">
5546N/A { 'stepMessage' : 'Add ds-pwp-password-policy-dn to users entry.' }
5546N/A </call>
5546N/A
5541N/A <script>
5541N/A remotePTAuserName='uid=jvedder, ou=People, o=example'
5541N/A remotePTAuserPSWD='befitting'
5541N/A ldapObject=[]
5546N/A ldapObject.append('ds-pwp-password-policy-dn: %s' \
5546N/A % ldapPtaPolicyDn)
5541N/A </script>
5541N/A
5541N/A <call function="'modifyAnAttribute'">
5541N/A { 'location' : local_ldap_server.getHostname(),
5541N/A 'dsPath' : '%s/%s' \
5541N/A % (local_ldap_server.getDir(),OPENDSNAME),
5541N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5541N/A 'dsInstancePort' : local_ldap_server.getPort(),
5541N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5541N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5541N/A 'DNToModify' : remotePTAuserName ,
5541N/A 'listAttributes' : ldapObject ,
5546N/A 'changetype' : 'add'
5546N/A }
5541N/A </call>
5541N/A
5546N/A <call function="'testStep'">
5546N/A { 'stepMessage' : 'Search users entry as Directory Manager for operational attributes.' }
5546N/A </call>
5546N/A
5541N/A <call function="'ldapSearchWithScript'">
5541N/A { 'location' : local_ldap_server.getHostname(),
5541N/A 'dsPath' : '%s/%s' \
5541N/A % (local_ldap_server.getDir(),OPENDSNAME),
5541N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5541N/A 'dsInstancePort' : local_ldap_server.getPort(),
5541N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5541N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5541N/A 'dsBaseDN' : remotePTAuserName ,
5541N/A 'dsFilter' : 'objectclass=*' ,
5541N/A 'dsAttributes' : '+'
5541N/A }
5541N/A </call>
5541N/A
5546N/A <call function="'testStep'">
5546N/A { 'stepMessage' : 'Search users entry as self.' }
5546N/A </call>
5546N/A
5541N/A <call function="'ldapSearchWithScript'">
5541N/A { 'location' : local_ldap_server.getHostname(),
5541N/A 'dsPath' : '%s/%s' \
5541N/A % (local_ldap_server.getDir(),OPENDSNAME),
5541N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5541N/A 'dsInstancePort' : local_ldap_server.getPort(),
5541N/A 'dsInstanceDn' : remotePTAuserName,
5541N/A 'dsInstancePswd' : remotePTAuserPSWD ,
5541N/A 'dsBaseDN' : remotePTAuserName ,
5541N/A 'dsFilter' : 'objectclass=*'
5541N/A }
5541N/A </call>
5541N/A
5546N/A <call function="'testStep'">
5546N/A { 'stepMessage' : 'Modify the users entry.' }
5546N/A </call>
5546N/A
5541N/A <script>
5541N/A ldapObject=[]
5541N/A ldapObject.append('description: i am now a remote LDAP PTA user')
5541N/A </script>
5541N/A
5541N/A <call function="'modifyAnAttribute'">
5541N/A { 'location' : local_ldap_server.getHostname(),
5541N/A 'dsPath' : '%s/%s' \
5541N/A % (local_ldap_server.getDir(),OPENDSNAME),
5541N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5541N/A 'dsInstancePort' : local_ldap_server.getPort(),
5541N/A 'dsInstanceDn' : remotePTAuserName,
5541N/A 'dsInstancePswd' : remotePTAuserPSWD,
5541N/A 'DNToModify' : remotePTAuserName ,
5541N/A 'listAttributes' : ldapObject ,
5546N/A 'changetype' : 'replace'
5546N/A }
5541N/A </call>
5541N/A
5541N/A </sequence>
5541N/A
5541N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5541N/A <message log="1" level="'fatal'">
5541N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5541N/A </message>
5541N/A </catch>
5541N/A <finally>
5560N/A <sequence>
5560N/A <call function="'pta_postamble1'"/>
5560N/A <call function="'testCase_Postamble'"/>
5560N/A </sequence>
5541N/A </finally>
5541N/A </try>
5541N/A </sequence>
5541N/A </testcase>
5541N/A </function>
5551N/A
5551N/A <!--- Test Case information
5562N/A #@TestMarker Basic: PTA mapped-search-bind-password-env-variable
5562N/A #@TestName Basic: PTA mapped-search-bind-password-env-variable
5562N/A #@TestID basic_pta_006
5562N/A #@TestPurpose Verify user with a LDAP PTA mapped-search policy can authenticated to remote server
5562N/A #@TestPreamble Setup PTA
5562N/A #@TestStep Configure LDAP PTA Policy using mapped-search-bind-password-environment-variable
5562N/A #@TestStep Read back the "authentication policy" object
5562N/A #@TestStep Add ds-pwp-password-policy-dn to users entry
5562N/A #@TestStep Search users entry as Directory Manager for operational attributes
5562N/A #@TestStep Search users entry as self
5562N/A #@TestStep Modify the users entry
5562N/A #@TestPostamble Cleanup PTA
5562N/A #@TestResult Test is successful if the result code is 0
5562N/A -->
5562N/A <function name="basic_pta_006" scope="local">
5562N/A <message>'Not implemented.'</message>
5562N/A </function>
5562N/A
5562N/A <!--- Test Case information
5562N/A #@TestMarker Basic: PTA mapped-search-bind-password-file
5562N/A #@TestName Basic: PTA mapped-search-bind-password-file
5562N/A #@TestID basic_pta_007
5562N/A #@TestPurpose Verify user with a LDAP PTA mapped-search policy can authenticated to remote server
5562N/A #@TestPreamble Setup PTA
5562N/A #@TestStep Configure LDAP PTA Policy using mapped-search-bind-password-file
5562N/A #@TestStep Read back the "authentication policy" object
5562N/A #@TestStep Add ds-pwp-password-policy-dn to users entry
5562N/A #@TestStep Search users entry as Directory Manager for operational attributes
5562N/A #@TestStep Search users entry as self
5562N/A #@TestStep Modify the users entry
5562N/A #@TestPostamble Cleanup PTA
5562N/A #@TestResult Test is successful if the result code is 0
5562N/A -->
5562N/A <function name="basic_pta_007" scope="local">
5562N/A <testcase name="getTestCaseName('PTA mapped-search-bind-password-file')">
5562N/A <sequence>
5562N/A <try>
5562N/A <sequence>
5562N/A <call function="'testCase_Preamble'"/>
5562N/A <message>
5562N/A 'Test Name = %s' % STAXCurrentTestcase
5562N/A </message>
5562N/A
5562N/A <call function="'testStep'">
5562N/A { 'stepMessage' : 'Configure LDAP PTA Policy using mapped-search-bind-password-file.' }
5562N/A </call>
5562N/A
5562N/A <script>
5562N/A options=[]
5562N/A options.append('--set primary-remote-ldap-server:%s:%s' % (primaryHost,primaryPort))
5562N/A options.append('--set mapped-attribute:cn')
5562N/A options.append('--set mapped-search-base-dn:dc=AD,dc=com')
5562N/A options.append('--set mapped-search-bind-dn:"cn=Directory Manager"')
5562N/A options.append('--set mapped-search-bind-password-file:%s' % remotePTAuserPswdFile)
5562N/A options.append('--set mapping-policy:mapped-search')
5562N/A options.append('--set secondary-remote-ldap-server:%s:%s' % (secondaryHost,secondaryPort))
5562N/A options.append('--type ldap-pass-through')
5562N/A options.append('--policy-name "%s"' % ldapPtaPolicyName)
5562N/A dsconfigOptions=' '.join(options)
5562N/A </script>
5562N/A
5562N/A <call function="'dsconfig'">
5562N/A { 'location' : local_ldap_server.getHostname(),
5562N/A 'dsPath' : '%s/%s' \
5562N/A % (local_ldap_server.getDir(),OPENDSNAME),
5562N/A 'dsInstanceHost' : local_ldap_server.getHostname(),
5562N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5562N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5562N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5562N/A 'subcommand' : 'create-password-policy',
5562N/A 'optionsString' : dsconfigOptions
5562N/A }
5562N/A </call>
5562N/A
5562N/A <call function="'testStep'">
5562N/A { 'stepMessage' : 'Read back the "authentication policy" object.' }
5562N/A </call>
5562N/A
5562N/A <script>
5562N/A options=[]
5562N/A options.append('--policy-name "%s"' % ldapPtaPolicyName)
5562N/A dsconfigOptions=' '.join(options)
5562N/A </script>
5562N/A
5562N/A <call function="'dsconfig'">
5562N/A { 'location' : local_ldap_server.getHostname(),
5562N/A 'dsPath' : '%s/%s' \
5562N/A % (local_ldap_server.getDir(),OPENDSNAME),
5562N/A 'dsInstanceHost' : local_ldap_server.getHostname(),
5562N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5562N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5562N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5562N/A 'subcommand' : 'get-password-policy-prop',
5562N/A 'optionsString' : dsconfigOptions
5562N/A }
5562N/A </call>
5562N/A
5562N/A <call function="'testStep'">
5562N/A { 'stepMessage' : 'Add ds-pwp-password-policy-dn to users entry.' }
5562N/A </call>
5562N/A
5562N/A <script>
5562N/A remotePTAuserName='uid=jvedder, ou=People, o=example'
5562N/A remotePTAuserPSWD='befitting'
5562N/A ldapObject=[]
5562N/A ldapObject.append('ds-pwp-password-policy-dn: %s' \
5562N/A % ldapPtaPolicyDn)
5562N/A </script>
5562N/A
5562N/A <call function="'modifyAnAttribute'">
5562N/A { 'location' : local_ldap_server.getHostname(),
5562N/A 'dsPath' : '%s/%s' \
5562N/A % (local_ldap_server.getDir(),OPENDSNAME),
5562N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5562N/A 'dsInstancePort' : local_ldap_server.getPort(),
5562N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5562N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5562N/A 'DNToModify' : remotePTAuserName ,
5562N/A 'listAttributes' : ldapObject ,
5562N/A 'changetype' : 'add'
5562N/A }
5562N/A </call>
5562N/A
5562N/A <call function="'testStep'">
5562N/A { 'stepMessage' : 'Search users entry as Directory Manager for operational attributes.' }
5562N/A </call>
5562N/A
5562N/A <call function="'ldapSearchWithScript'">
5562N/A { 'location' : local_ldap_server.getHostname(),
5562N/A 'dsPath' : '%s/%s' \
5562N/A % (local_ldap_server.getDir(),OPENDSNAME),
5562N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5562N/A 'dsInstancePort' : local_ldap_server.getPort(),
5562N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5562N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5562N/A 'dsBaseDN' : remotePTAuserName ,
5562N/A 'dsFilter' : 'objectclass=*' ,
5562N/A 'dsAttributes' : '+'
5562N/A }
5562N/A </call>
5562N/A
5562N/A <call function="'testStep'">
5562N/A { 'stepMessage' : 'Search users entry as self.' }
5562N/A </call>
5562N/A
5562N/A <call function="'ldapSearchWithScript'">
5562N/A { 'location' : local_ldap_server.getHostname(),
5562N/A 'dsPath' : '%s/%s' \
5562N/A % (local_ldap_server.getDir(),OPENDSNAME),
5562N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5562N/A 'dsInstancePort' : local_ldap_server.getPort(),
5562N/A 'dsInstanceDn' : remotePTAuserName,
5562N/A 'dsInstancePswd' : remotePTAuserPSWD ,
5562N/A 'dsBaseDN' : remotePTAuserName ,
5562N/A 'dsFilter' : 'objectclass=*'
5562N/A }
5562N/A </call>
5562N/A
5562N/A <call function="'testStep'">
5562N/A { 'stepMessage' : 'Modify the users entry.' }
5562N/A </call>
5562N/A
5562N/A <script>
5562N/A ldapObject=[]
5562N/A ldapObject.append('description: i am now a remote LDAP PTA user')
5562N/A </script>
5562N/A
5562N/A <call function="'modifyAnAttribute'">
5562N/A { 'location' : local_ldap_server.getHostname(),
5562N/A 'dsPath' : '%s/%s' \
5562N/A % (local_ldap_server.getDir(),OPENDSNAME),
5562N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5562N/A 'dsInstancePort' : local_ldap_server.getPort(),
5562N/A 'dsInstanceDn' : remotePTAuserName,
5562N/A 'dsInstancePswd' : remotePTAuserPSWD,
5562N/A 'DNToModify' : remotePTAuserName ,
5562N/A 'listAttributes' : ldapObject ,
5562N/A 'changetype' : 'replace'
5562N/A }
5562N/A </call>
5562N/A
5562N/A </sequence>
5562N/A
5562N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5562N/A <message log="1" level="'fatal'">
5562N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5562N/A </message>
5562N/A </catch>
5562N/A <finally>
5562N/A <sequence>
5562N/A <call function="'pta_postamble1'"/>
5562N/A <call function="'testCase_Postamble'"/>
5562N/A </sequence>
5562N/A </finally>
5562N/A </try>
5562N/A </sequence>
5562N/A </testcase>
5562N/A </function>
5562N/A
5562N/A <!--- Test Case information
5562N/A #@TestMarker Basic: PTA mapped-search-bind-password-property
5562N/A #@TestName Basic: PTA mapped-search-bind-password-property
5562N/A #@TestID basic_pta_008
5562N/A #@TestPurpose Verify user with a LDAP PTA mapped-search policy can authenticated to remote server
5562N/A #@TestPreamble Setup PTA
5562N/A #@TestStep Configure LDAP PTA Policy using mapped-search-bind-password-property
5562N/A #@TestStep Read back the "authentication policy" object
5562N/A #@TestStep Add ds-pwp-password-policy-dn to users entry
5562N/A #@TestStep Search users entry as Directory Manager for operational attributes
5562N/A #@TestStep Search users entry as self
5562N/A #@TestStep Modify the users entry
5562N/A #@TestPostamble Cleanup PTA
5562N/A #@TestResult Test is successful if the result code is 0
5562N/A -->
5562N/A <function name="basic_pta_008" scope="local">
5562N/A <message>'Not implemented.'</message>
5562N/A </function>
5562N/A
5562N/A <!--- Test Case information
5551N/A #@TestMarker Basic: PTA anon mapped-search use-ssl
5551N/A #@TestName Basic: PTA anon mapped-search use-ssl
5562N/A #@TestID basic_pta_009
5551N/A #@TestPurpose Verify user with a LDAP PTA mapped-search policy can authenticated to remote server
5551N/A #@TestPreamble Setup PTA
5551N/A #@TestStep Configure LDAP PTA Policy for mapped-search
5551N/A #@TestStep Read back the "authentication policy" object
5551N/A #@TestStep Add ds-pwp-password-policy-dn to users entry
5551N/A #@TestStep Search users entry as Directory Manager for operational attributes
5551N/A #@TestStep Search users entry as self
5551N/A #@TestStep Modify the users entry
5551N/A #@TestPostamble Cleanup PTA
5551N/A #@TestResult Test is successful if the result code is 0
5551N/A -->
5562N/A <function name="basic_pta_009" scope="local">
5551N/A <testcase name="getTestCaseName('PTA anon mapped-search use-ssl')">
5551N/A <sequence>
5551N/A <try>
5551N/A <sequence>
5551N/A <call function="'testCase_Preamble'"/>
5551N/A <message>
5551N/A 'Test Name = %s' % STAXCurrentTestcase
5551N/A </message>
5551N/A
5551N/A <call function="'testStep'">
5551N/A { 'stepMessage' : 'Configure LDAP PTA Policy for anon mapped-search over ssl.' }
5551N/A </call>
5551N/A
5551N/A <script>
5551N/A options=[]
5551N/A options.append('--set primary-remote-ldap-server:%s:%s' % (primaryHost,primarySslPort))
5551N/A options.append('--set mapped-attribute:cn')
5551N/A options.append('--set mapped-search-base-dn:dc=AD,dc=com')
5551N/A options.append('--set mapping-policy:mapped-search')
5551N/A options.append('--set secondary-remote-ldap-server:%s:%s' % (secondaryHost,secondarySslPort))
5551N/A options.append('--set trust-manager-provider:JKS')
5551N/A options.append('--set use-ssl:true')
5551N/A options.append('--type ldap-pass-through')
5551N/A options.append('--policy-name "%s"' % ldapPtaPolicyName)
5551N/A dsconfigOptions=' '.join(options)
5551N/A </script>
5551N/A
5551N/A <call function="'dsconfig'">
5551N/A { 'location' : local_ldap_server.getHostname(),
5551N/A 'dsPath' : '%s/%s' \
5551N/A % (local_ldap_server.getDir(),OPENDSNAME),
5551N/A 'dsInstanceHost' : local_ldap_server.getHostname(),
5551N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5551N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5551N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5551N/A 'subcommand' : 'create-password-policy',
5551N/A 'optionsString' : dsconfigOptions
5551N/A }
5551N/A </call>
5551N/A
5551N/A <call function="'testStep'">
5551N/A { 'stepMessage' : 'Read back the "authentication policy" object.' }
5551N/A </call>
5551N/A
5551N/A <script>
5551N/A options=[]
5551N/A options.append('--policy-name "%s"' % ldapPtaPolicyName)
5551N/A dsconfigOptions=' '.join(options)
5551N/A </script>
5551N/A
5551N/A <call function="'dsconfig'">
5551N/A { 'location' : local_ldap_server.getHostname(),
5551N/A 'dsPath' : '%s/%s' \
5551N/A % (local_ldap_server.getDir(),OPENDSNAME),
5551N/A 'dsInstanceHost' : local_ldap_server.getHostname(),
5551N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5551N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5551N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5551N/A 'subcommand' : 'get-password-policy-prop',
5551N/A 'optionsString' : dsconfigOptions
5551N/A }
5551N/A </call>
5551N/A
5551N/A <call function="'testStep'">
5551N/A { 'stepMessage' : 'Add ds-pwp-password-policy-dn to users entry.' }
5551N/A </call>
5551N/A
5551N/A <script>
5551N/A remotePTAuserName='uid=jvedder, ou=People, o=example'
5551N/A remotePTAuserPSWD='befitting'
5551N/A ldapObject=[]
5551N/A ldapObject.append('ds-pwp-password-policy-dn: %s' \
5551N/A % ldapPtaPolicyDn)
5551N/A </script>
5551N/A
5551N/A <call function="'modifyAnAttribute'">
5551N/A { 'location' : local_ldap_server.getHostname(),
5551N/A 'dsPath' : '%s/%s' \
5551N/A % (local_ldap_server.getDir(),OPENDSNAME),
5551N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5551N/A 'dsInstancePort' : local_ldap_server.getPort(),
5551N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5551N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5551N/A 'DNToModify' : remotePTAuserName ,
5551N/A 'listAttributes' : ldapObject ,
5551N/A 'changetype' : 'add'
5551N/A }
5551N/A </call>
5551N/A
5551N/A <call function="'testStep'">
5551N/A { 'stepMessage' : 'Search users entry as Directory Manager for operational attributes.' }
5551N/A </call>
5551N/A
5551N/A <call function="'ldapSearchWithScript'">
5551N/A { 'location' : local_ldap_server.getHostname(),
5551N/A 'dsPath' : '%s/%s' \
5551N/A % (local_ldap_server.getDir(),OPENDSNAME),
5551N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5551N/A 'dsInstancePort' : local_ldap_server.getPort(),
5551N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5551N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5551N/A 'dsBaseDN' : remotePTAuserName ,
5551N/A 'dsFilter' : 'objectclass=*' ,
5551N/A 'dsAttributes' : '+'
5551N/A }
5551N/A </call>
5551N/A
5551N/A <call function="'testStep'">
5551N/A { 'stepMessage' : 'Search users entry as self.' }
5551N/A </call>
5551N/A
5551N/A <call function="'ldapSearchWithScript'">
5551N/A { 'location' : local_ldap_server.getHostname(),
5551N/A 'dsPath' : '%s/%s' \
5551N/A % (local_ldap_server.getDir(),OPENDSNAME),
5551N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5551N/A 'dsInstancePort' : local_ldap_server.getPort(),
5551N/A 'dsInstanceDn' : remotePTAuserName,
5551N/A 'dsInstancePswd' : remotePTAuserPSWD ,
5551N/A 'dsBaseDN' : remotePTAuserName ,
5551N/A 'dsFilter' : 'objectclass=*'
5551N/A }
5551N/A </call>
5551N/A
5551N/A <call function="'testStep'">
5551N/A { 'stepMessage' : 'Modify the users entry.' }
5551N/A </call>
5551N/A
5551N/A <script>
5551N/A ldapObject=[]
5551N/A ldapObject.append('description: i am now a remote LDAP PTA user')
5551N/A </script>
5551N/A
5551N/A <call function="'modifyAnAttribute'">
5551N/A { 'location' : local_ldap_server.getHostname(),
5551N/A 'dsPath' : '%s/%s' \
5551N/A % (local_ldap_server.getDir(),OPENDSNAME),
5551N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5551N/A 'dsInstancePort' : local_ldap_server.getPort(),
5551N/A 'dsInstanceDn' : remotePTAuserName,
5551N/A 'dsInstancePswd' : remotePTAuserPSWD,
5551N/A 'DNToModify' : remotePTAuserName ,
5551N/A 'listAttributes' : ldapObject ,
5551N/A 'changetype' : 'replace'
5551N/A }
5551N/A </call>
5541N/A
5551N/A </sequence>
5551N/A
5551N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5551N/A <message log="1" level="'fatal'">
5551N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5551N/A </message>
5551N/A </catch>
5551N/A <finally>
5560N/A <sequence>
5560N/A <call function="'pta_postamble1'"/>
5560N/A <call function="'testCase_Postamble'"/>
5560N/A </sequence>
5551N/A </finally>
5551N/A </try>
5551N/A </sequence>
5551N/A </testcase>
5551N/A </function>
5551N/A
5551N/A <!--- Test Case information
5551N/A #@TestMarker Basic: PTA simple mapped-search use-ssl
5551N/A #@TestName Basic: PTA simple mapped-search use-ssl
5562N/A #@TestID basic_pta_010
5551N/A #@TestPurpose Verify user with a LDAP PTA mapped-search policy can authenticated to remote server
5551N/A #@TestPreamble Setup PTA
5551N/A #@TestStep Configure LDAP PTA Policy for mapped-search
5551N/A #@TestStep Read back the "authentication policy" object
5551N/A #@TestStep Add ds-pwp-password-policy-dn to users entry
5551N/A #@TestStep Search users entry as Directory Manager for operational attributes
5551N/A #@TestStep Search users entry as self
5551N/A #@TestStep Modify the users entry
5551N/A #@TestPostamble Cleanup PTA
5551N/A #@TestResult Test is successful if the result code is 0
5551N/A -->
5562N/A <function name="basic_pta_010" scope="local">
5551N/A <testcase name="getTestCaseName('PTA simple mapped-search use-ssl')">
5551N/A <sequence>
5551N/A <try>
5551N/A <sequence>
5551N/A <call function="'testCase_Preamble'"/>
5551N/A <message>
5551N/A 'Test Name = %s' % STAXCurrentTestcase
5551N/A </message>
5551N/A
5551N/A <call function="'testStep'">
5551N/A { 'stepMessage' : 'Configure LDAP PTA Policy for anon mapped-search over ssl.' }
5551N/A </call>
5551N/A
5551N/A <script>
5551N/A options=[]
5551N/A options.append('--set primary-remote-ldap-server:%s:%s' % (primaryHost,primarySslPort))
5551N/A options.append('--set mapped-attribute:cn')
5551N/A options.append('--set mapped-search-base-dn:dc=AD,dc=com')
5551N/A options.append('--set mapped-search-bind-dn:"cn=Directory Manager"')
5551N/A options.append('--set mapped-search-bind-password:secret12')
5551N/A options.append('--set mapping-policy:mapped-search')
5551N/A options.append('--set secondary-remote-ldap-server:%s:%s' % (secondaryHost,secondarySslPort))
5551N/A options.append('--set trust-manager-provider:JKS')
5551N/A options.append('--set use-ssl:true')
5551N/A options.append('--type ldap-pass-through')
5551N/A options.append('--policy-name "%s"' % ldapPtaPolicyName)
5551N/A dsconfigOptions=' '.join(options)
5551N/A </script>
5551N/A
5551N/A <call function="'dsconfig'">
5551N/A { 'location' : local_ldap_server.getHostname(),
5551N/A 'dsPath' : '%s/%s' \
5551N/A % (local_ldap_server.getDir(),OPENDSNAME),
5551N/A 'dsInstanceHost' : local_ldap_server.getHostname(),
5551N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5551N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5551N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5551N/A 'subcommand' : 'create-password-policy',
5551N/A 'optionsString' : dsconfigOptions
5551N/A }
5551N/A </call>
5551N/A
5551N/A <call function="'testStep'">
5551N/A { 'stepMessage' : 'Read back the "authentication policy" object.' }
5551N/A </call>
5551N/A
5551N/A <script>
5551N/A options=[]
5551N/A options.append('--policy-name "%s"' % ldapPtaPolicyName)
5551N/A dsconfigOptions=' '.join(options)
5551N/A </script>
5551N/A
5551N/A <call function="'dsconfig'">
5551N/A { 'location' : local_ldap_server.getHostname(),
5551N/A 'dsPath' : '%s/%s' \
5551N/A % (local_ldap_server.getDir(),OPENDSNAME),
5551N/A 'dsInstanceHost' : local_ldap_server.getHostname(),
5551N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5551N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5551N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5551N/A 'subcommand' : 'get-password-policy-prop',
5551N/A 'optionsString' : dsconfigOptions
5551N/A }
5551N/A </call>
5551N/A
5551N/A <call function="'testStep'">
5551N/A { 'stepMessage' : 'Add ds-pwp-password-policy-dn to users entry.' }
5551N/A </call>
5551N/A
5551N/A <script>
5551N/A remotePTAuserName='uid=jvedder, ou=People, o=example'
5551N/A remotePTAuserPSWD='befitting'
5551N/A ldapObject=[]
5551N/A ldapObject.append('ds-pwp-password-policy-dn: %s' \
5551N/A % ldapPtaPolicyDn)
5551N/A </script>
5551N/A
5551N/A <call function="'modifyAnAttribute'">
5551N/A { 'location' : local_ldap_server.getHostname(),
5551N/A 'dsPath' : '%s/%s' \
5551N/A % (local_ldap_server.getDir(),OPENDSNAME),
5551N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5551N/A 'dsInstancePort' : local_ldap_server.getPort(),
5551N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5551N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5551N/A 'DNToModify' : remotePTAuserName ,
5551N/A 'listAttributes' : ldapObject ,
5551N/A 'changetype' : 'add'
5551N/A }
5551N/A </call>
5551N/A
5551N/A <call function="'testStep'">
5551N/A { 'stepMessage' : 'Search users entry as Directory Manager for operational attributes.' }
5551N/A </call>
5551N/A
5551N/A <call function="'ldapSearchWithScript'">
5551N/A { 'location' : local_ldap_server.getHostname(),
5551N/A 'dsPath' : '%s/%s' \
5551N/A % (local_ldap_server.getDir(),OPENDSNAME),
5551N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5551N/A 'dsInstancePort' : local_ldap_server.getPort(),
5551N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5551N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5551N/A 'dsBaseDN' : remotePTAuserName ,
5551N/A 'dsFilter' : 'objectclass=*' ,
5551N/A 'dsAttributes' : '+'
5551N/A }
5551N/A </call>
5551N/A
5551N/A <call function="'testStep'">
5551N/A { 'stepMessage' : 'Search users entry as self.' }
5551N/A </call>
5551N/A
5551N/A <call function="'ldapSearchWithScript'">
5551N/A { 'location' : local_ldap_server.getHostname(),
5551N/A 'dsPath' : '%s/%s' \
5551N/A % (local_ldap_server.getDir(),OPENDSNAME),
5551N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5551N/A 'dsInstancePort' : local_ldap_server.getPort(),
5551N/A 'dsInstanceDn' : remotePTAuserName,
5551N/A 'dsInstancePswd' : remotePTAuserPSWD ,
5551N/A 'dsBaseDN' : remotePTAuserName ,
5551N/A 'dsFilter' : 'objectclass=*'
5551N/A }
5551N/A </call>
5551N/A
5551N/A <call function="'testStep'">
5551N/A { 'stepMessage' : 'Modify the users entry.' }
5551N/A </call>
5551N/A
5551N/A <script>
5551N/A ldapObject=[]
5551N/A ldapObject.append('description: i am now a remote LDAP PTA user')
5551N/A </script>
5551N/A
5551N/A <call function="'modifyAnAttribute'">
5551N/A { 'location' : local_ldap_server.getHostname(),
5551N/A 'dsPath' : '%s/%s' \
5551N/A % (local_ldap_server.getDir(),OPENDSNAME),
5551N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5551N/A 'dsInstancePort' : local_ldap_server.getPort(),
5551N/A 'dsInstanceDn' : remotePTAuserName,
5551N/A 'dsInstancePswd' : remotePTAuserPSWD,
5551N/A 'DNToModify' : remotePTAuserName ,
5551N/A 'listAttributes' : ldapObject ,
5551N/A 'changetype' : 'replace'
5551N/A }
5551N/A </call>
5560N/A
5560N/A </sequence>
5560N/A
5560N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5560N/A <message log="1" level="'fatal'">
5560N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5560N/A </message>
5560N/A </catch>
5560N/A <finally>
5560N/A <sequence>
5560N/A <call function="'pta_postamble1'"/>
5560N/A <call function="'testCase_Postamble'"/>
5560N/A </sequence>
5560N/A </finally>
5560N/A </try>
5560N/A </sequence>
5560N/A </testcase>
5560N/A </function>
5560N/A
5560N/A <!--- Test Case information
5560N/A #@TestMarker Basic: PTA failover
5560N/A #@TestName Basic: PTA failover
5562N/A #@TestID basic_pta_011
5560N/A #@TestPurpose Verify user with a LDAP PTA policy can failover to secondary server
5560N/A #@TestPreamble Setup PTA
5560N/A #@TestStep Configure LDAP PTA Policy using mapped-search-bind credentials
5560N/A #@TestStep Read back the "authentication policy" object
5561N/A #@TestStep Add ds-pwp-password-policy-dn to users entries
5561N/A #@TestStep Search users entries as Directory Manager for ds-pwp-password-policy-dn
5561N/A #@TestStep First search users entries as self
5560N/A #@TestStep Stop the primary remote ldap server
5561N/A #@TestStep Second search users entries as self.
5561N/A #@TestStep Modify the users entries
5560N/A #@TestStep Restart the primary remote ldap server
5561N/A #@TestStep Wait for monitor heartbeat to primary remote ldap server
5561N/A #@TestStep Third search users entries as self
5561N/A #@TestStep Stop the secondary remote ldap server.
5561N/A #@TestStep Fourth search users entries as self
5560N/A #@TestPostamble Cleanup PTA
5560N/A #@TestResult Test is successful if the result code is 0
5560N/A -->
5562N/A <function name="basic_pta_011" scope="local">
5562N/A <testcase name="getTestCaseName('PTA simple failover')">
5561N/A <sequence>
5560N/A <try>
5560N/A <sequence>
5560N/A <call function="'testCase_Preamble'"/>
5560N/A <message>
5560N/A 'Test Name = %s' % STAXCurrentTestcase
5560N/A </message>
5551N/A
5551N/A <call function="'testStep'">
5560N/A { 'stepMessage' : 'Configure LDAP PTA Policy using mapped-search-bind credentials.' }
5551N/A </call>
5551N/A
5551N/A <script>
5560N/A options=[]
5560N/A options.append('--set primary-remote-ldap-server:%s:%s' % (primaryHost,primaryPort))
5560N/A options.append('--set mapped-attribute:cn')
5560N/A options.append('--set mapped-search-base-dn:dc=AD,dc=com')
5560N/A options.append('--set mapped-search-bind-dn:"cn=Directory Manager"')
5560N/A options.append('--set mapped-search-bind-password:secret12')
5560N/A options.append('--set mapping-policy:mapped-search')
5560N/A options.append('--set secondary-remote-ldap-server:%s:%s' % (secondaryHost,secondaryPort))
5560N/A options.append('--type ldap-pass-through')
5560N/A options.append('--policy-name "%s"' % ldapPtaPolicyName)
5560N/A dsconfigOptions=' '.join(options)
5560N/A </script>
5551N/A
5560N/A <call function="'dsconfig'">
5560N/A { 'location' : local_ldap_server.getHostname(),
5560N/A 'dsPath' : '%s/%s' \
5560N/A % (local_ldap_server.getDir(),OPENDSNAME),
5560N/A 'dsInstanceHost' : local_ldap_server.getHostname(),
5560N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5560N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5560N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5560N/A 'subcommand' : 'create-password-policy',
5560N/A 'optionsString' : dsconfigOptions
5551N/A }
5551N/A </call>
5551N/A
5551N/A <call function="'testStep'">
5560N/A { 'stepMessage' : 'Read back the "authentication policy" object.' }
5551N/A </call>
5551N/A
5551N/A <script>
5551N/A options=[]
5551N/A options.append('--policy-name "%s"' % ldapPtaPolicyName)
5551N/A dsconfigOptions=' '.join(options)
5551N/A </script>
5551N/A
5551N/A <call function="'dsconfig'">
5551N/A { 'location' : local_ldap_server.getHostname(),
5551N/A 'dsPath' : '%s/%s' \
5551N/A % (local_ldap_server.getDir(),OPENDSNAME),
5551N/A 'dsInstanceHost' : local_ldap_server.getHostname(),
5551N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5551N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5551N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5560N/A 'subcommand' : 'get-password-policy-prop',
5551N/A 'optionsString' : dsconfigOptions
5551N/A }
5551N/A </call>
5560N/A
5560N/A <call function="'testStep'">
5561N/A { 'stepMessage' : 'Add ds-pwp-password-policy-dn to users entries.' }
5560N/A </call>
5560N/A
5561N/A <call function="'ldapSearchWithScript'">
5560N/A { 'location' : local_ldap_server.getHostname(),
5560N/A 'dsPath' : '%s/%s' \
5560N/A % (local_ldap_server.getDir(),OPENDSNAME),
5560N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5560N/A 'dsInstancePort' : local_ldap_server.getPort(),
5560N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5560N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5561N/A 'dsBaseDN' : 'cn=PTA Remote Users,ou=groups,o=example' ,
5561N/A 'dsScope' : 'base' ,
5561N/A 'dsFilter' : 'objectclass=*' ,
5561N/A 'dsAttributes' : 'uniquemember'
5560N/A }
5560N/A </call>
5561N/A
5561N/A <message>
5561N/A 'Result= %s' % STAXResult
5561N/A </message>
5561N/A
5561N/A <script>
5561N/A ldapObject=[]
5561N/A ldapObject.append('ds-pwp-password-policy-dn: %s' \
5561N/A % ldapPtaPolicyDn)
5561N/A </script>
5561N/A
5561N/A <iterate var="remotePTAuserName"
5561N/A in="remotePTAuserDict.keys()"
5561N/A indexvar="usernum">
5561N/A
5561N/A <call function="'modifyAnAttribute'">
5561N/A { 'location' : local_ldap_server.getHostname(),
5561N/A 'dsPath' : '%s/%s' \
5561N/A % (local_ldap_server.getDir(),OPENDSNAME),
5561N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5561N/A 'dsInstancePort' : local_ldap_server.getPort(),
5561N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5561N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5561N/A 'DNToModify' : remotePTAuserName ,
5561N/A 'listAttributes' : ldapObject ,
5561N/A 'changetype' : 'add'
5561N/A }
5561N/A </call>
5561N/A
5561N/A </iterate>
5560N/A
5560N/A <call function="'testStep'">
5561N/A { 'stepMessage' : 'Search users entries as Directory Manager for ds-pwp-password-policy-dn.' }
5560N/A </call>
5560N/A
5560N/A <call function="'ldapSearchWithScript'">
5560N/A { 'location' : local_ldap_server.getHostname(),
5560N/A 'dsPath' : '%s/%s' \
5560N/A % (local_ldap_server.getDir(),OPENDSNAME),
5560N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5560N/A 'dsInstancePort' : local_ldap_server.getPort(),
5560N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5560N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5561N/A 'dsBaseDN' : remotePTAuserSuffix ,
5560N/A 'dsFilter' : 'objectclass=*' ,
5561N/A 'dsAttributes' : 'ds-pwp-password-policy-dn'
5560N/A }
5560N/A </call>
5560N/A
5560N/A <call function="'testStep'">
5561N/A { 'stepMessage' : 'First search users entries as self.' }
5560N/A </call>
5560N/A
5561N/A <iterate var="remotePTAuserName"
5561N/A in="remotePTAuserDict.keys()"
5561N/A indexvar="usernum">
5561N/A
5561N/A <call function="'ldapSearchWithScript'">
5561N/A { 'location' : local_ldap_server.getHostname(),
5561N/A 'dsPath' : '%s/%s' \
5561N/A % (local_ldap_server.getDir(),OPENDSNAME),
5561N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5561N/A 'dsInstancePort' : local_ldap_server.getPort(),
5561N/A 'dsInstanceDn' : remotePTAuserName,
5561N/A 'dsInstancePswd' : remotePTAuserDict[remotePTAuserName] ,
5561N/A 'dsBaseDN' : remotePTAuserName ,
5561N/A 'dsFilter' : 'objectclass=*'
5561N/A }
5561N/A </call>
5561N/A
5561N/A </iterate>
5560N/A
5560N/A <call function="'testStep'">
5560N/A { 'stepMessage' : 'Stop the primary remote ldap server.' }
5560N/A </call>
5560N/A
5560N/A <call function="'stopServers'">
5560N/A [[primary_remote_ldap_server]]
5560N/A </call>
5560N/A
5560N/A <call function="'testStep'">
5561N/A { 'stepMessage' : 'Second search users entries as self.' }
5560N/A </call>
5560N/A
5561N/A <iterate var="remotePTAuserName"
5561N/A in="remotePTAuserDict.keys()"
5561N/A indexvar="usernum">
5561N/A
5561N/A <call function="'ldapSearchWithScript'">
5561N/A { 'location' : local_ldap_server.getHostname(),
5561N/A 'dsPath' : '%s/%s' \
5561N/A % (local_ldap_server.getDir(),OPENDSNAME),
5561N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5561N/A 'dsInstancePort' : local_ldap_server.getPort(),
5561N/A 'dsInstanceDn' : remotePTAuserName,
5561N/A 'dsInstancePswd' : remotePTAuserDict[remotePTAuserName] ,
5561N/A 'dsBaseDN' : remotePTAuserName ,
5561N/A 'dsFilter' : 'objectclass=*'
5561N/A }
5561N/A </call>
5561N/A
5561N/A </iterate>
5560N/A
5560N/A <call function="'testStep'">
5561N/A { 'stepMessage' : 'Modify the users entries.' }
5560N/A </call>
5560N/A
5560N/A <script>
5560N/A ldapObject=[]
5560N/A ldapObject.append('description: i am now a remote LDAP PTA user')
5560N/A </script>
5560N/A
5561N/A <iterate var="remotePTAuserName"
5561N/A in="remotePTAuserDict.keys()"
5561N/A indexvar="usernum">
5561N/A
5561N/A <call function="'modifyAnAttribute'">
5561N/A { 'location' : local_ldap_server.getHostname(),
5561N/A 'dsPath' : '%s/%s' \
5561N/A % (local_ldap_server.getDir(),OPENDSNAME),
5561N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5561N/A 'dsInstancePort' : local_ldap_server.getPort(),
5561N/A 'dsInstanceDn' : remotePTAuserName,
5561N/A 'dsInstancePswd' : remotePTAuserDict[remotePTAuserName],
5561N/A 'DNToModify' : remotePTAuserName ,
5561N/A 'listAttributes' : ldapObject ,
5561N/A 'changetype' : 'replace'
5561N/A }
5561N/A </call>
5561N/A
5561N/A </iterate>
5560N/A
5560N/A <call function="'testStep'">
5560N/A { 'stepMessage' : 'Restart the primary remote ldap server.' }
5560N/A </call>
5560N/A
5560N/A <call function="'startServers'">
5560N/A [[primary_remote_ldap_server]]
5560N/A </call>
5560N/A
5560N/A <call function="'testStep'">
5560N/A { 'stepMessage' : 'Wait for monitor heartbeat to primary remote ldap server.' }
5560N/A </call>
5560N/A <call function="'Sleep'">
5560N/A { 'sleepForMilliSeconds' : '5000' }
5560N/A </call>
5560N/A
5560N/A <call function="'testStep'">
5561N/A { 'stepMessage' : 'Third search users entries as self.' }
5560N/A </call>
5560N/A
5561N/A <iterate var="remotePTAuserName"
5561N/A in="remotePTAuserDict.keys()"
5561N/A indexvar="usernum">
5561N/A
5561N/A <call function="'ldapSearchWithScript'">
5561N/A { 'location' : local_ldap_server.getHostname(),
5561N/A 'dsPath' : '%s/%s' \
5561N/A % (local_ldap_server.getDir(),OPENDSNAME),
5561N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5561N/A 'dsInstancePort' : local_ldap_server.getPort(),
5561N/A 'dsInstanceDn' : remotePTAuserName,
5561N/A 'dsInstancePswd' : remotePTAuserDict[remotePTAuserName] ,
5561N/A 'dsBaseDN' : remotePTAuserName ,
5561N/A 'dsFilter' : 'objectclass=*'
5561N/A }
5561N/A </call>
5561N/A
5561N/A </iterate>
5560N/A
5560N/A <call function="'testStep'">
5560N/A { 'stepMessage' : 'Stop the secondary remote ldap server.' }
5560N/A </call>
5560N/A
5560N/A <call function="'stopServers'">
5560N/A [[secondary_remote_ldap_server]]
5560N/A </call>
5560N/A
5560N/A <call function="'testStep'">
5561N/A { 'stepMessage' : 'Fourth search users entries as self.' }
5560N/A </call>
5560N/A
5561N/A <iterate var="remotePTAuserName"
5561N/A in="remotePTAuserDict.keys()"
5561N/A indexvar="usernum">
5561N/A
5561N/A <call function="'ldapSearchWithScript'">
5561N/A { 'location' : local_ldap_server.getHostname(),
5561N/A 'dsPath' : '%s/%s' \
5561N/A % (local_ldap_server.getDir(),OPENDSNAME),
5561N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5561N/A 'dsInstancePort' : local_ldap_server.getPort(),
5561N/A 'dsInstanceDn' : remotePTAuserName,
5561N/A 'dsInstancePswd' : remotePTAuserDict[remotePTAuserName] ,
5561N/A 'dsBaseDN' : remotePTAuserName ,
5561N/A 'dsFilter' : 'objectclass=*'
5561N/A }
5561N/A </call>
5561N/A
5561N/A </iterate>
5560N/A
5560N/A <call function="'testStep'">
5560N/A { 'stepMessage' : 'Start the secondary remote ldap server.' }
5560N/A </call>
5560N/A
5560N/A <call function="'startServers'">
5560N/A [[secondary_remote_ldap_server]]
5560N/A </call>
5560N/A
5551N/A </sequence>
5551N/A
5551N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5551N/A <message log="1" level="'fatal'">
5551N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5551N/A </message>
5551N/A </catch>
5551N/A <finally>
5560N/A <sequence>
5561N/A <call function="'pta_postamble3'"/>
5560N/A <call function="'testCase_Postamble'"/>
5560N/A </sequence>
5551N/A </finally>
5551N/A </try>
5551N/A </sequence>
5551N/A </testcase>
5551N/A </function>
5560N/A
5560N/A <!--- Test Case information
5560N/A #@TestMarker Basic: PTA failover use-ssl
5560N/A #@TestName Basic: PTA failover use-ssl
5562N/A #@TestID basic_pta_012
5560N/A #@TestPurpose Verify user with a LDAP PTA policy can failover to secondary server
5560N/A #@TestPreamble Setup PTA
5560N/A #@TestStep Configure LDAP PTA Policy using mapped-search-bind credentials over ssl
5560N/A #@TestStep Read back the "authentication policy" object
5561N/A #@TestStep Add ds-pwp-password-policy-dn to users entries
5561N/A #@TestStep Search users entries as Directory Manager for ds-pwp-password-policy-dn
5561N/A #@TestStep First search users entries as self
5560N/A #@TestStep Stop the primary remote ldap server
5561N/A #@TestStep Second search users entries as self.
5561N/A #@TestStep Modify the users entries
5560N/A #@TestStep Restart the primary remote ldap server
5561N/A #@TestStep Wait for monitor heartbeat to primary remote ldap server
5561N/A #@TestStep Third search users entries as self
5561N/A #@TestStep Stop the secondary remote ldap server.
5561N/A #@TestStep Fourth search users entries as self
5560N/A #@TestPostamble Cleanup PTA
5560N/A #@TestResult Test is successful if the result code is 0
5560N/A -->
5562N/A <function name="basic_pta_012" scope="local">
5562N/A <testcase name="getTestCaseName('PTA simple failover use-ssl')">
5561N/A <sequence>
5560N/A <try>
5560N/A <sequence>
5560N/A <call function="'testCase_Preamble'"/>
5560N/A <message>
5560N/A 'Test Name = %s' % STAXCurrentTestcase
5560N/A </message>
5560N/A
5560N/A <call function="'testStep'">
5561N/A { 'stepMessage' : 'Configure LDAP PTA Policy using mapped-search-bind credentials over ssl.' }
5560N/A </call>
5560N/A
5560N/A <script>
5560N/A options=[]
5560N/A options.append('--set primary-remote-ldap-server:%s:%s' % (primaryHost,primarySslPort))
5560N/A options.append('--set mapped-attribute:cn')
5560N/A options.append('--set mapped-search-base-dn:dc=AD,dc=com')
5560N/A options.append('--set mapped-search-bind-dn:"cn=Directory Manager"')
5560N/A options.append('--set mapped-search-bind-password:secret12')
5560N/A options.append('--set mapping-policy:mapped-search')
5560N/A options.append('--set secondary-remote-ldap-server:%s:%s' % (secondaryHost,secondarySslPort))
5560N/A options.append('--set trust-manager-provider:JKS')
5560N/A options.append('--set use-ssl:true')
5560N/A options.append('--type ldap-pass-through')
5560N/A options.append('--policy-name "%s"' % ldapPtaPolicyName)
5560N/A dsconfigOptions=' '.join(options)
5560N/A </script>
5560N/A
5560N/A <call function="'dsconfig'">
5560N/A { 'location' : local_ldap_server.getHostname(),
5560N/A 'dsPath' : '%s/%s' \
5560N/A % (local_ldap_server.getDir(),OPENDSNAME),
5560N/A 'dsInstanceHost' : local_ldap_server.getHostname(),
5560N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5560N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5560N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5560N/A 'subcommand' : 'create-password-policy',
5560N/A 'optionsString' : dsconfigOptions
5560N/A }
5560N/A </call>
5560N/A
5560N/A <call function="'testStep'">
5560N/A { 'stepMessage' : 'Read back the "authentication policy" object.' }
5560N/A </call>
5560N/A
5560N/A <script>
5560N/A options=[]
5560N/A options.append('--policy-name "%s"' % ldapPtaPolicyName)
5560N/A dsconfigOptions=' '.join(options)
5560N/A </script>
5560N/A
5560N/A <call function="'dsconfig'">
5560N/A { 'location' : local_ldap_server.getHostname(),
5560N/A 'dsPath' : '%s/%s' \
5560N/A % (local_ldap_server.getDir(),OPENDSNAME),
5560N/A 'dsInstanceHost' : local_ldap_server.getHostname(),
5560N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5560N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5560N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5560N/A 'subcommand' : 'get-password-policy-prop',
5560N/A 'optionsString' : dsconfigOptions
5560N/A }
5560N/A </call>
5560N/A
5560N/A <call function="'testStep'">
5561N/A { 'stepMessage' : 'Add ds-pwp-password-policy-dn to users entries.' }
5560N/A </call>
5560N/A
5561N/A <call function="'ldapSearchWithScript'">
5560N/A { 'location' : local_ldap_server.getHostname(),
5560N/A 'dsPath' : '%s/%s' \
5560N/A % (local_ldap_server.getDir(),OPENDSNAME),
5560N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5560N/A 'dsInstancePort' : local_ldap_server.getPort(),
5560N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5560N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5561N/A 'dsBaseDN' : 'cn=PTA Remote Users,ou=groups,o=example' ,
5561N/A 'dsScope' : 'base' ,
5561N/A 'dsFilter' : 'objectclass=*' ,
5561N/A 'dsAttributes' : 'uniquemember'
5560N/A }
5560N/A </call>
5561N/A
5561N/A <message>
5561N/A 'Result= %s' % STAXResult
5561N/A </message>
5561N/A
5561N/A <script>
5561N/A ldapObject=[]
5561N/A ldapObject.append('ds-pwp-password-policy-dn: %s' \
5561N/A % ldapPtaPolicyDn)
5561N/A </script>
5561N/A
5561N/A <iterate var="remotePTAuserName"
5561N/A in="remotePTAuserDict.keys()"
5561N/A indexvar="usernum">
5561N/A
5561N/A <call function="'modifyAnAttribute'">
5561N/A { 'location' : local_ldap_server.getHostname(),
5561N/A 'dsPath' : '%s/%s' \
5561N/A % (local_ldap_server.getDir(),OPENDSNAME),
5561N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5561N/A 'dsInstancePort' : local_ldap_server.getPort(),
5561N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5561N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5561N/A 'DNToModify' : remotePTAuserName ,
5561N/A 'listAttributes' : ldapObject ,
5561N/A 'changetype' : 'add'
5561N/A }
5561N/A </call>
5561N/A
5561N/A </iterate>
5560N/A
5560N/A <call function="'testStep'">
5561N/A { 'stepMessage' : 'Search users entries as Directory Manager for ds-pwp-password-policy-dn.' }
5560N/A </call>
5560N/A
5560N/A <call function="'ldapSearchWithScript'">
5560N/A { 'location' : local_ldap_server.getHostname(),
5560N/A 'dsPath' : '%s/%s' \
5560N/A % (local_ldap_server.getDir(),OPENDSNAME),
5560N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5560N/A 'dsInstancePort' : local_ldap_server.getPort(),
5560N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5560N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5561N/A 'dsBaseDN' : remotePTAuserSuffix ,
5560N/A 'dsFilter' : 'objectclass=*' ,
5561N/A 'dsAttributes' : 'ds-pwp-password-policy-dn'
5560N/A }
5560N/A </call>
5560N/A
5560N/A <call function="'testStep'">
5561N/A { 'stepMessage' : 'First search users entries as self.' }
5560N/A </call>
5560N/A
5561N/A <iterate var="remotePTAuserName"
5561N/A in="remotePTAuserDict.keys()"
5561N/A indexvar="usernum">
5561N/A
5561N/A <call function="'ldapSearchWithScript'">
5561N/A { 'location' : local_ldap_server.getHostname(),
5561N/A 'dsPath' : '%s/%s' \
5561N/A % (local_ldap_server.getDir(),OPENDSNAME),
5561N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5561N/A 'dsInstancePort' : local_ldap_server.getPort(),
5561N/A 'dsInstanceDn' : remotePTAuserName,
5561N/A 'dsInstancePswd' : remotePTAuserDict[remotePTAuserName] ,
5561N/A 'dsBaseDN' : remotePTAuserName ,
5561N/A 'dsFilter' : 'objectclass=*'
5561N/A }
5561N/A </call>
5561N/A
5561N/A </iterate>
5560N/A
5560N/A <call function="'testStep'">
5560N/A { 'stepMessage' : 'Stop the primary remote ldap server.' }
5560N/A </call>
5560N/A
5560N/A <call function="'stopServers'">
5560N/A [[primary_remote_ldap_server]]
5560N/A </call>
5560N/A
5560N/A <call function="'testStep'">
5561N/A { 'stepMessage' : 'Second search users entries as self.' }
5560N/A </call>
5560N/A
5561N/A <iterate var="remotePTAuserName"
5561N/A in="remotePTAuserDict.keys()"
5561N/A indexvar="usernum">
5561N/A
5561N/A <call function="'ldapSearchWithScript'">
5561N/A { 'location' : local_ldap_server.getHostname(),
5561N/A 'dsPath' : '%s/%s' \
5561N/A % (local_ldap_server.getDir(),OPENDSNAME),
5561N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5561N/A 'dsInstancePort' : local_ldap_server.getPort(),
5561N/A 'dsInstanceDn' : remotePTAuserName,
5561N/A 'dsInstancePswd' : remotePTAuserDict[remotePTAuserName] ,
5561N/A 'dsBaseDN' : remotePTAuserName ,
5561N/A 'dsFilter' : 'objectclass=*'
5561N/A }
5561N/A </call>
5561N/A
5561N/A </iterate>
5560N/A
5560N/A <call function="'testStep'">
5561N/A { 'stepMessage' : 'Modify the users entries.' }
5560N/A </call>
5560N/A
5560N/A <script>
5560N/A ldapObject=[]
5560N/A ldapObject.append('description: i am now a remote LDAP PTA user')
5560N/A </script>
5560N/A
5561N/A <iterate var="remotePTAuserName"
5561N/A in="remotePTAuserDict.keys()"
5561N/A indexvar="usernum">
5561N/A
5561N/A <call function="'modifyAnAttribute'">
5561N/A { 'location' : local_ldap_server.getHostname(),
5561N/A 'dsPath' : '%s/%s' \
5561N/A % (local_ldap_server.getDir(),OPENDSNAME),
5561N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5561N/A 'dsInstancePort' : local_ldap_server.getPort(),
5561N/A 'dsInstanceDn' : remotePTAuserName,
5561N/A 'dsInstancePswd' : remotePTAuserDict[remotePTAuserName],
5561N/A 'DNToModify' : remotePTAuserName ,
5561N/A 'listAttributes' : ldapObject ,
5561N/A 'changetype' : 'replace'
5561N/A }
5561N/A </call>
5561N/A
5561N/A </iterate>
5560N/A
5560N/A <call function="'testStep'">
5560N/A { 'stepMessage' : 'Restart the primary remote ldap server.' }
5560N/A </call>
5560N/A
5560N/A <call function="'startServers'">
5560N/A [[primary_remote_ldap_server]]
5560N/A </call>
5560N/A
5560N/A <call function="'testStep'">
5560N/A { 'stepMessage' : 'Wait for monitor heartbeat to primary remote ldap server.' }
5560N/A </call>
5560N/A <call function="'Sleep'">
5560N/A { 'sleepForMilliSeconds' : '5000' }
5560N/A </call>
5560N/A
5560N/A <call function="'testStep'">
5561N/A { 'stepMessage' : 'Third search users entries as self.' }
5560N/A </call>
5560N/A
5561N/A <iterate var="remotePTAuserName"
5561N/A in="remotePTAuserDict.keys()"
5561N/A indexvar="usernum">
5561N/A
5561N/A <call function="'ldapSearchWithScript'">
5561N/A { 'location' : local_ldap_server.getHostname(),
5561N/A 'dsPath' : '%s/%s' \
5561N/A % (local_ldap_server.getDir(),OPENDSNAME),
5561N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5561N/A 'dsInstancePort' : local_ldap_server.getPort(),
5561N/A 'dsInstanceDn' : remotePTAuserName,
5561N/A 'dsInstancePswd' : remotePTAuserDict[remotePTAuserName] ,
5561N/A 'dsBaseDN' : remotePTAuserName ,
5561N/A 'dsFilter' : 'objectclass=*'
5561N/A }
5561N/A </call>
5561N/A
5561N/A </iterate>
5560N/A
5560N/A <call function="'testStep'">
5560N/A { 'stepMessage' : 'Stop the secondary remote ldap server.' }
5560N/A </call>
5560N/A
5560N/A <call function="'stopServers'">
5560N/A [[secondary_remote_ldap_server]]
5560N/A </call>
5560N/A
5560N/A <call function="'testStep'">
5561N/A { 'stepMessage' : 'Fourth search users entries as self.' }
5560N/A </call>
5560N/A
5561N/A <iterate var="remotePTAuserName"
5561N/A in="remotePTAuserDict.keys()"
5561N/A indexvar="usernum">
5561N/A
5561N/A <call function="'ldapSearchWithScript'">
5561N/A { 'location' : local_ldap_server.getHostname(),
5561N/A 'dsPath' : '%s/%s' \
5561N/A % (local_ldap_server.getDir(),OPENDSNAME),
5561N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5561N/A 'dsInstancePort' : local_ldap_server.getPort(),
5561N/A 'dsInstanceDn' : remotePTAuserName,
5561N/A 'dsInstancePswd' : remotePTAuserDict[remotePTAuserName] ,
5561N/A 'dsBaseDN' : remotePTAuserName ,
5561N/A 'dsFilter' : 'objectclass=*'
5561N/A }
5561N/A </call>
5561N/A
5561N/A </iterate>
5560N/A
5560N/A <call function="'testStep'">
5560N/A { 'stepMessage' : 'Start the secondary remote ldap server.' }
5560N/A </call>
5560N/A
5560N/A <call function="'startServers'">
5560N/A [[secondary_remote_ldap_server]]
5560N/A </call>
5560N/A
5560N/A </sequence>
5551N/A
5560N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5560N/A <message log="1" level="'fatal'">
5560N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5560N/A </message>
5560N/A </catch>
5560N/A <finally>
5560N/A <sequence>
5561N/A <call function="'pta_postamble3'"/>
5560N/A <call function="'testCase_Postamble'"/>
5560N/A </sequence>
5560N/A </finally>
5560N/A </try>
5560N/A </sequence>
5560N/A </testcase>
5560N/A </function>
5560N/A
5541N/A</stax>