<?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
! trunk/opends/resource/legal-notices/OpenDS.LICENSE
! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
! 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
! trunk/opends/resource/legal-notices/OpenDS.LICENSE. 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 2008-2009 Sun Microsystems, Inc.
! Portions copyright 2012 ForgeRock AS.
! -->
<stax>
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker Root Authentication Tests
#@TestName Root Auth - Preamble
#@TestIssue None
#@TestPurpose Configure for Root Auth tests
#@TestPreamble None
#@TestStep Admin change pwd storage to CLEAR
#@TestStep Admin add new root user.
#@TestStep Admin change Exact Match identity mapper match attribute.
#@TestStep Admin change Exact Match identity mapper match base dn.
#@TestPostamble None
#@TestResult Success if OpenDS returns 0,for all steps.
-->
<function name="pwp_root_auth_001" scope="local">
<testcase name="getTestCaseName('PWP Preamble')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s Set Default Password Storage Scheme to Clear.' % msg1 }
</call>
<script>
options=[]
options.append('--policy-name "Root Password Policy"')
options.append('--set "default-password-storage-scheme:Clear"')
dsconfigOptions=' '.join(options)
</script>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'subcommand' : 'set-password-policy-prop',
'optionsString' : dsconfigOptions
}
</call>
<message>
'Security: Pwd Policy Root: Root Auth, Preamble Step 2 - Admin adding new root user'
</message>
<call function="'addEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'entryToBeAdded' : '%s/password_policy/add_new_root_user.ldif' % remote.data }
</call>
<message>
'Security: Pwd Policy Root: Root Auth, Preamble Step 3 - Admin changing authid attribute to givenName'
</message>
<call function="'modifyIdentityMapper'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'mapperName' : 'Exact Match' ,
'attributeName' : 'match-attribute' ,
'attributeValue' : 'givenName' }
</call>
<message>
'Security: Pwd Policy Root: Root Auth, Preamble Step 4 - Admin changing authid dn to root users'
</message>
<call function="'modifyIdentityMapper'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'mapperName' : 'Exact Match' ,
'attributeName' : 'match-base-dn' ,
'attributeValue' : 'cn=Root DNs,cn=config' }
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker Root Authentication Tests
#@TestName Root Auth - New Root User (dn:) DIGEST-MD5 Bind
#@TestIssue None
#@TestPurpose DIGEST-MD5 Bind
#@TestPreamble None
#@TestStep New root user binds using DIGEST-MD5
#@TestPostamble None
#@TestResult Success if OpenDS returns 0.
-->
<function name="pwp_root_auth_002" scope="local">
<testcase name="getTestCaseName('PWP New Root User (dn:) DIGEST-MD5 Bind')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s Root User (dn:) DIGEST-MD5 Binding.' % msg1 }
</call>
<call function="'AnonSearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-o mech=DIGEST-MD5 -o "authid=dn:cn=Zroot Manager,cn=Root DNs,cn=config" -w froglegs' }
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker Root Authentication Tests
#@TestName Root Auth - New Root User (dn:) DIGEST-MD5 Bind, short form
#@TestIssue None
#@TestPurpose DIGEST-MD5 Bind, short form
#@TestPreamble None
#@TestStep New root user binds using DIGEST-MD5, short form
#@TestPostamble None
#@TestResult Success if OpenDS returns 0.
-->
<function name="pwp_root_auth_003" scope="local">
<testcase name="getTestCaseName('PWP New Root User (dn:) DIGEST-MD5 Bind, short form')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s Root User (dn:) DIGEST-MD5 Binding, short form.' % msg1 }
</call>
<call function="'AnonSearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-o mech=DIGEST-MD5 -o "authid=dn:cn=Zroot" -w froglegs' }
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker Root Authentication Tests
#@TestName Root Auth - New Root User (dn:) DIGEST-MD5 Bind, u: form
#@TestIssue None
#@TestPurpose DIGEST-MD5 Bind, u: form
#@TestPreamble None
#@TestStep New root user binds using DIGEST-MD5, u: form
#@TestPostamble None
#@TestResult Success if OpenDS returns 0.
-->
<function name="pwp_root_auth_004" scope="local">
<testcase name="getTestCaseName('PWP New Root User (u:) DIGEST-MD5 Bind')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s Root User (u:) DIGEST-MD5 Binding.' % msg1 }
</call>
<call function="'AnonSearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-o mech=DIGEST-MD5 -o "authid=u:Zroot" -w froglegs' }
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker Root Authentication Tests
#@TestName Root Auth - New Root User (dn:) CRAM-MD5 Bind
#@TestIssue None
#@TestPurpose CRAM-MD5 Bind
#@TestPreamble None
#@TestStep New root user binds using CRAM-MD5
#@TestPostamble None
#@TestResult Success if OpenDS returns 0.
-->
<function name="pwp_root_auth_005" scope="local">
<testcase name="getTestCaseName('PWP New Root User (dn:) CRAM-MD5 Bind')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s Root User (dn:) CRAM-MD5 Binding.' % msg1 }
</call>
<call function="'AnonSearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-o mech=CRAM-MD5 -o "authid=dn:cn=Zroot Manager,cn=Root DNs,cn=config" -w froglegs' }
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker Root Authentication Tests
#@TestName Root Auth - New Root User (dn:) CRAM-MD5 Bind, short form
#@TestIssue None
#@TestPurpose CRAM-MD5 Bind, short form
#@TestPreamble None
#@TestStep New root user binds using CRAM-MD5, short form
#@TestPostamble None
#@TestResult Success if OpenDS returns 0.
-->
<function name="pwp_root_auth_006" scope="local">
<testcase name="getTestCaseName('PWP New Root User (dn:) CRAM-MD5 Bind, short form')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s Root User (dn:) CRAM-MD5 Binding, short form.' % msg1 }
</call>
<call function="'AnonSearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-o mech=CRAM-MD5 -o "authid=dn:cn=Zroot" -w froglegs' }
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker Root Authentication Tests
#@TestName Root Auth - New Root User (dn:) CRAM-MD5 Bind, u: form
#@TestIssue None
#@TestPurpose CRAM-MD5 Bind, u: form
#@TestPreamble None
#@TestStep New root user binds using CRAM-MD5, u: form
#@TestPostamble None
#@TestResult Success if OpenDS returns 0.
-->
<function name="pwp_root_auth_007" scope="local">
<testcase name="getTestCaseName('PWP New Root User (u:) CRAM-MD5 Bind')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s Root User (u:) CRAM-MD5 Binding.' % msg1 }
</call>
<call function="'AnonSearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-o mech=CRAM-MD5 -o "authid=u:Zroot" -w froglegs' }
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker Root Authentication Tests
#@TestName Root Auth - New Root User (dn:) PLAIN Bind
#@TestIssue None
#@TestPurpose PLAIN Bind
#@TestPreamble None
#@TestStep New root user binds using PLAIN
#@TestPostamble None
#@TestResult Success if OpenDS returns 0.
-->
<function name="pwp_root_auth_008" scope="local">
<testcase name="getTestCaseName('PWP New Root User (dn:) PLAIN Bind')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s Root User (dn:) PLAIN Binding.' % msg1 }
</call>
<call function="'AnonSearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-o mech=PLAIN -o "authid=dn:cn=Zroot Manager,cn=Root DNs,cn=config" -w froglegs' }
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker Root Authentication Tests
#@TestName Root Auth - New Root User (dn:) PLAIN Bind, short form
#@TestIssue None
#@TestPurpose PLAIN Bind, short form
#@TestPreamble None
#@TestStep New root user binds using PLAIN, short form
#@TestPostamble None
#@TestResult Success if OpenDS returns 0.
-->
<function name="pwp_root_auth_009" scope="local">
<testcase name="getTestCaseName('PWP New Root User (dn:) PLAIN Bind, short form')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s Root User (dn:) PLAIN Binding, short form.' % msg1 }
</call>
<call function="'AnonSearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-o mech=PLAIN -o "authid=dn:cn=Zroot" -w froglegs' }
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker Root Authentication Tests
#@TestName Root Auth - New Root User (dn:) PLAIN Bind, u: form
#@TestIssue None
#@TestPurpose PLAIN Bind, u: form
#@TestPreamble None
#@TestStep New root user binds using PLAIN, u: form
#@TestPostamble None
#@TestResult Success if OpenDS returns 0.
-->
<function name="pwp_root_auth_010" scope="local">
<testcase name="getTestCaseName('PWP New Root User (u:) PLAIN Bind')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s Root User (u:) PLAIN Binding.' % msg1 }
</call>
<call function="'AnonSearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-o mech=PLAIN -o "authid=u:Zroot" -w froglegs' }
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker Root Authentication Tests
#@TestName Root Auth - Postamble
#@TestIssue None
#@TestPurpose Reset configuration.
#@TestPreamble None
#@TestStep Admin change password storage scheme to SSHA.
#@TestPostamble None
#@TestResult Success if OpenDS returns 0
for all ldap operations.
-->
<function name="pwp_root_auth_011" scope="local">
<testcase name="getTestCaseName('PWP Postamble')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Test Name = %s' % STAXCurrentTestcase
</message>
<call function="'testStep'">
{ 'stepMessage' : '%s Set Default Password Storage Scheme to Salted SHA-512.' % msg1 }
</call>
<script>
options=[]
options.append('--policy-name "Root Password Policy"')
options.append('--set "default-password-storage-scheme:Salted SHA-512"')
dsconfigOptions=' '.join(options)
</script>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'subcommand' : 'set-password-policy-prop',
'optionsString' : dsconfigOptions
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
</stax>