5560N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
5560N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
5560N/A<!--
5560N/A ! CDDL HEADER START
5560N/A !
5560N/A ! The contents of this file are subject to the terms of the
5560N/A ! Common Development and Distribution License, Version 1.0 only
5560N/A ! (the "License"). You may not use this file except in compliance
5560N/A ! with the License.
5560N/A !
5560N/A ! You can obtain a copy of the license at
5560N/A ! trunk/opends/resource/legal-notices/CDDLv1_0.txt
5560N/A ! or http://forgerock.org/license/CDDLv1.0.html.
5560N/A ! See the License for the specific language governing permissions
5560N/A ! and limitations under the License.
5560N/A !
5560N/A ! When distributing Covered Code, include this CDDL HEADER in each
5560N/A ! file and include the License file at
5560N/A ! trunk/opends/resource/legal-notices/CDDLv1_0.txt. If applicable,
5560N/A ! add the following below this CDDL HEADER, with the fields enclosed
5560N/A ! by brackets "[]" replaced with your own identifying information:
5560N/A ! Portions Copyright [yyyy] [name of copyright owner]
5560N/A !
5560N/A ! CDDL HEADER END
5560N/A !
5560N/A ! Copyright 2011 ForgeRock AS
5560N/A ! -->
5560N/A<stax>
5560N/A
5560N/A <function name="pta_postamble1">
5560N/A <function-prolog>
5571N/A Performs postamble for multi-user/policy PTA tests
5560N/A </function-prolog>
5571N/A <function-map-args>
5571N/A <function-arg-def name="userNamePswd" type="required">
5571N/A <function-arg-description>
5571N/A Dictionary of user names (dn) and passwords.
5571N/A </function-arg-description>
5571N/A <function-arg-property name="type" value="Dictionary"/>
5571N/A </function-arg-def>
5571N/A </function-map-args>
5560N/A <sequence>
5560N/A
5560N/A <call function="'testStep'">
5560N/A { 'stepMessage' : 'Delete ds-pwp-password-policy-dn from users entry.' }
5560N/A </call>
5560N/A
5571N/A <iterate var="remotePTAuserName"
5571N/A in="userNamePswd.keys()"
5571N/A indexvar="usernum">
5571N/A <sequence>
5571N/A
5571N/A <script>
5571N/A myldapPtaPolicyName = userNamePswd[remotePTAuserName][1]
5571N/A myldapPtaPolicyDn = 'cn=%s,cn=Password Policies,cn=config' \
5571N/A % myldapPtaPolicyName
5571N/A
5571N/A ldapObject=[]
5571N/A ldapObject.append('ds-pwp-password-policy-dn: %s' \
5571N/A % myldapPtaPolicyDn)
5571N/A </script>
5571N/A
5571N/A <call function="'modifyAnAttribute'">
5571N/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() ,
5571N/A 'dsInstancePort' : local_ldap_server.getPort(),
5571N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5571N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5571N/A 'DNToModify' : remotePTAuserName ,
5571N/A 'listAttributes' : ldapObject ,
5571N/A 'changetype' : 'delete'
5571N/A }
5571N/A </call>
5560N/A
5571N/A </sequence>
5571N/A
5571N/A </iterate>
5560N/A
5560N/A <call function="'testStep'">
5560N/A { 'stepMessage' : 'Remove LDAP PTA Authentication Policy.' }
5560N/A </call>
5560N/A
5571N/A <iterate var="remotePTAuserName"
5571N/A in="userNamePswd.keys()"
5571N/A indexvar="usernum">
5571N/A <sequence>
5571N/A
5571N/A <script>
5571N/A #myldapPtaPolicyName = 'LDAP PTA %s' % usernum
5571N/A myldapPtaPolicyName = userNamePswd[remotePTAuserName][1]
5571N/A myldapPtaPolicyDn = 'cn=%s,cn=Password Policies,cn=config' % myldapPtaPolicyName
5560N/A
5571N/A options=[]
5571N/A options.append('--policy-name "%s"' % myldapPtaPolicyName)
5571N/A dsconfigOptions=' '.join(options)
5571N/A </script>
5571N/A
5571N/A <call function="'dsconfig'">
5571N/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(),
5571N/A 'dsInstanceAdminPort' : local_ldap_server.getAdminPort(),
5571N/A 'dsInstanceDn' : local_ldap_server.getRootDn(),
5571N/A 'dsInstancePswd' : local_ldap_server.getRootPwd(),
5571N/A 'subcommand' : 'delete-password-policy',
5571N/A 'optionsString' : dsconfigOptions
5571N/A }
5571N/A </call>
5571N/A </sequence>
5571N/A </iterate>
5560N/A </sequence>
5560N/A </function>
5560N/A
5560N/A <function name="pta_postamble2">
5560N/A <function-prolog>
5560N/A Performs postamble for PTA tests
5560N/A </function-prolog>
5560N/A <function-no-args />
5560N/A <sequence>
5560N/A
5560N/A <call function="'testStep'">
5560N/A { 'stepMessage' : 'Disable AD backend on local server.' }
5560N/A </call>
5560N/A
5560N/A <script>
5560N/A options=[]
5560N/A options.append('--backend-name "AD"')
5560N/A options.append('--set enabled:false')
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' : 'set-backend-prop',
5560N/A 'optionsString' : dsconfigOptions
5560N/A }
5560N/A </call>
5560N/A
5560N/A </sequence>
5561N/A </function>
5561N/A
5560N/A</stax>