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