pta_basic_tests.xml revision 5546
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 unmapped
5562N/A #@TestName Basic: PTA unmapped
5562N/A #@TestID basic_pta_001
5562N/A #@TestPurpose Verify user with a LDAP PTA unmapped policy can authenticated to remote server
5562N/A #@TestPreamble
5562N/A #@TestSteps Configure LDAP PTA Policy
5562N/A #@TestPostamble
5562N/A #@TestResult Test is successful if the result code is 0
5562N/A -->
5562N/A
5562N/A <!--- Test Case information
5562N/A #@TestMarker Basic: PTA mapped-bind
5562N/A #@TestName Basic: PTA mapped-bind
5562N/A #@TestID basic_pta_002
5562N/A #@TestPurpose Verify user with a LDAP PTA mapped-bind policy can authenticated to remote server
5562N/A #@TestPreamble Setup PTS
5562N/A #@TestStep Configure LDAP PTA Policy for mapped-bind
5562N/A #@TestStep Read back the "authentication policy" object
5541N/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
5562N/A #@TestStep Modify the users entry
5541N/A #@TestStep Delete ds-pwp-password-policy-dn from users entry
5548N/A #@TestStep Remove LDAP PTA Authentication Policy
5548N/A #@TestPostamble Cleanup PTA
5548N/A #@TestResult Test is successful if the result code is 0
5546N/A -->
5546N/A <function name="basic_pta_002" scope="local">
5546N/A <testcase name="getTestCaseName('PTA mapped-bind')">
5546N/A <sequence>
5546N/A <try>
5548N/A <sequence>
5546N/A <call function="'testCase_Preamble'"/>
5541N/A <message>
5541N/A 'Test Name = %s' % STAXCurrentTestcase
5562N/A </message>
5548N/A
5546N/A <call function="'testStep'">
5546N/A { 'stepMessage' : 'On primary server configure LDAP PTA.' }
5546N/A </call>
5546N/A
5546N/A <script>
5546N/A options=[]
5546N/A options.append('--set primary-remote-ldap-server:%s:%s' % (primaryHost,primaryPort))
5546N/A options.append('--set mapped-attribute:seealso')
5546N/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 "LDAP PTA"')
5548N/A dsconfigOptions=' '.join(options)
5571N/A </script>
5571N/A
5571N/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 "LDAP PTA"')
5548N/A dsconfigOptions=' '.join(options)
5548N/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),
5548N/A 'dsInstanceHost' : local_ldap_server.getHostname(),
5546N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5546N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5548N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5548N/A 'subcommand' : 'get-password-policy-prop',
5571N/A 'optionsString' : dsconfigOptions
5571N/A }
5571N/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=jmcFarla, ou=People, o=example'
5548N/A remotePTAuserPSWD='walnut'
5548N/A ldapObject=[]
5548N/A ldapObject.append('ds-pwp-password-policy-dn: %s' \
5548N/A % ldapPtaPolicyDn)
5560N/A </script>
5571N/A
5571N/A <call function="'modifyAnAttribute'">
5571N/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() ,
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
5562N/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(),
5562N/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'">
5571N/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() ,
5571N/A 'dsInstancePort' : local_ldap_server.getPort(),
5571N/A 'dsInstanceDn' : remotePTAuserName,
5571N/A 'dsInstancePswd' : remotePTAuserPSWD ,
5548N/A 'dsBaseDN' : remotePTAuserName ,
5548N/A 'dsFilter' : 'objectclass=*'
5548N/A }
5548N/A </call>
5548N/A
5548N/A <call function="'testStep'">
5546N/A { 'stepMessage' : 'Modify the users entry.' }
5546N/A </call>
5571N/A
5571N/A <script>
5571N/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,
5560N/A 'DNToModify' : remotePTAuserName ,
5571N/A 'listAttributes' : ldapObject ,
5571N/A 'changetype' : 'replace'
5571N/A }
5560N/A </call>
5560N/A
5546N/A <call function="'testStep'">
5546N/A { 'stepMessage' : 'Delete ds-pwp-password-policy-dn from users entry.' }
5546N/A </call>
5546N/A
5546N/A <script>
5541N/A ldapObject=[]
5541N/A ldapObject.append('ds-pwp-password-policy-dn: %s' \
5548N/A % ldapPtaPolicyDn)
5548N/A </script>
5562N/A
5541N/A <call function="'modifyAnAttribute'">
5548N/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 ,
5541N/A 'listAttributes' : ldapObject ,
5541N/A 'changetype' : 'delete'
5562N/A }
5548N/A </call>
5541N/A
5541N/A <call function="'testStep'">
5541N/A { 'stepMessage' : 'Remove LDAP PTA Authentication Policy.' }
5541N/A </call>
5541N/A
5541N/A <script>
5541N/A options=[]
5541N/A options.append('--policy-name "LDAP PTA"')
5546N/A dsconfigOptions=' '.join(options)
5548N/A </script>
5546N/A
5546N/A <call function="'dsconfig'">
5541N/A { 'location' : local_ldap_server.getHostname(),
5571N/A 'dsPath' : '%s/%s' \
5571N/A % (local_ldap_server.getDir(),OPENDSNAME),
5571N/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' : 'delete-password-policy',
5541N/A 'optionsString' : dsconfigOptions
5541N/A }
5541N/A </call>
5548N/A
5548N/A </sequence>
5571N/A
5571N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5571N/A <message log="1" level="'fatal'">
5548N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5548N/A </message>
5548N/A </catch>
5548N/A <finally>
5548N/A <call function="'testCase_Postamble'"/>
5548N/A </finally>
5548N/A </try>
5548N/A </sequence>
5548N/A </testcase>
5548N/A </function>
5548N/A
5560N/A <!--- Test Case information
5571N/A #@TestMarker Basic: PTA mapped-search
5571N/A #@TestName Basic: PTA mapped-search
5571N/A #@TestID basic_pta_003
5560N/A #@TestPurpose Verify user with a LDAP PTA mapped-search policy can authenticated to remote server
5560N/A #@TestPreamble Setup PTS
5548N/A #@TestStep Configure LDAP PTA Policy for mapped-search
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 #@TestStep ds-pwp-password-policy-dn from users entry
5560N/A #@TestStep Remove LDAP PTA Authentication Policy
5560N/A #@TestPostamble Cleanup PTA
5562N/A #@TestResult Test is successful if the result code is 0
5548N/A -->
5548N/A <function name="basic_pta_003" scope="local">
5548N/A <testcase name="getTestCaseName('PTA mapped-search')">
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
5562N/A <call function="'testStep'">
5548N/A { 'stepMessage' : 'On primary server configure LDAP PTA.' }
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 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 "LDAP PTA"')
5548N/A dsconfigOptions=' '.join(options)
5548N/A </script>
5571N/A
5571N/A <call function="'dsconfig'">
5571N/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 }
5541N/A </call>
5541N/A
5571N/A <call function="'testStep'">
5571N/A { 'stepMessage' : 'Read back the "authentication policy" object.' }
5571N/A </call>
5546N/A
5541N/A <script>
5541N/A options=[]
5541N/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),
5560N/A 'dsInstanceHost' : local_ldap_server.getHostname(),
5571N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5571N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5571N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5560N/A 'subcommand' : 'get-password-policy-prop',
5560N/A 'optionsString' : dsconfigOptions
5541N/A }
5541N/A </call>
5541N/A
5541N/A <call function="'testStep'">
5541N/A { 'stepMessage' : 'Add ds-pwp-password-policy-dn to users entry.' }
5551N/A </call>
5551N/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),
5571N/A 'dsInstanceHost' : local_ldap_server.getHostname() ,
5571N/A 'dsInstancePort' : local_ldap_server.getPort(),
5571N/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>
5571N/A ldapObject=[]
5571N/A ldapObject.append('description: i am now a remote LDAP PTA user')
5571N/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'
5571N/A }
5571N/A </call>
5571N/A
5562N/A <call function="'testStep'">
5562N/A { 'stepMessage' : 'Delete ds-pwp-password-policy-dn from users entry.' }
5562N/A </call>
5562N/A
5562N/A <script>
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' : 'delete'
5562N/A }
5562N/A </call>
5562N/A
5562N/A <call function="'testStep'">
5562N/A { 'stepMessage' : 'Remove LDAP PTA Authentication Policy.' }
5562N/A </call>
5562N/A
5551N/A <script>
5551N/A options=[]
5562N/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(),
5562N/A 'subcommand' : 'delete-password-policy',
5551N/A 'optionsString' : dsconfigOptions
5551N/A }
5551N/A </call>
5551N/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>
5551N/A <call function="'testCase_Postamble'"/>
5571N/A </finally>
5571N/A </try>
5571N/A </sequence>
5571N/A </testcase>
5551N/A </function>
5551N/A
5551N/A</stax>
5551N/A