<?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
|
!
|
! Portions Copyright 2006-2007 Sun Microsystems, Inc.
|
! -->
|
<stax>
|
<defaultcall function="plugins_uniqueness"/>
|
<function name="plugins_uniqueness" scope="local">
|
<block name="STAXCurrentFunction">
|
<sequence>
|
<script>
|
CurrentTestPath['suite']=STAXCurrentFunction
|
</script>
|
<call function="'testSuite_Preamble'" />
|
|
|
<!---
|
#@TestMarker Plugin uniqueness
|
#@TestName Plugin uniqueness
|
#@TestIssue Setup
|
#@TestPreamble none
|
#@TestStep Create the user entries used for the test
|
#@TestPostamble none
|
#@TestResult The test is passed if the creation is done
|
-->
|
|
|
<testcase name="getTestCaseName('Setup')">
|
<sequence>
|
<call function="'testCase_Preamble'"/>
|
|
<message>'###### Add an user entry ###### '</message>
|
<message>' '</message>
|
|
<!-- This entry is used as a reference -->
|
<!-- Add an entry -->
|
<script>
|
listAttr = []
|
listAttr.append('objectclass:top')
|
listAttr.append('objectclass:organizationalperson')
|
listAttr.append('objectclass:inetorgperson')
|
listAttr.append('objectclass:person')
|
listAttr.append('givenname:testuser_uniqueness')
|
listAttr.append('sn:testuser_uniqueness')
|
listAttr.append('cn:testuser_uniqueness')
|
listAttr.append('mail:testuser_uniqueness@sun')
|
listAttr.append('description:mydescription1')
|
listAttr.append('description:mydescription2')
|
listAttr.append('telephoneNumber:1 2 3 4')
|
</script>
|
|
<call function="'addAnEntry'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'DNToAdd' : 'uid=testuser_uniqueness,%s' % DIRECTORY_INSTANCE_SFX,
|
'listAttributes' : listAttr,
|
'expectedRC' : 0
|
}
|
</call>
|
|
|
<call function="'SearchObject'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'dsBaseDN' : 'uid=testuser_uniqueness,%s' % DIRECTORY_INSTANCE_SFX,
|
'dsFilter' : 'objectclass=*' ,
|
'dsScope' : 'base',
|
'expectedRC' : 0 }
|
</call>
|
|
|
<message>'###### Activate the uniqueness plugin. ###### '</message>
|
<message>' '</message>
|
|
<call function="'dsconfig'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'subcommand' : 'set-plugin-prop' ,
|
'objectType' : 'plugin-name' ,
|
'objectName' : 'UID Unique Attribute',
|
'optionsString' : '--set enabled:true',
|
'expectedRC' : 0 }
|
</call>
|
|
|
<call function="'testCase_Postamble'"/>
|
</sequence>
|
</testcase>
|
|
|
|
<!---
|
#@TestMarker Plugin uniqueness
|
#@TestName Plugin uniqueness
|
#@TestIssue Check the plugin uniqueness with the type uid
|
#@TestPreamble none
|
#@TestStep Keep the default configuration ( ie, type = uid )
|
#@TestStep Check we can't add an entry with the same uid as the user entry reference
|
#@TestPostamble none
|
#@TestResult The test is passed if the creation is refused
|
-->
|
|
|
<testcase name="getTestCaseName('Enabled with type defined to uid')">
|
<sequence>
|
<call function="'testCase_Preamble'"/>
|
|
<message>'###### Add an entry with an uid already present in the DIT ###### '</message>
|
<message>'--- The creation must be refused to ensure the uniqueness of the attributes uid '</message>
|
<message>' '</message>
|
|
<!-- Add an entry -->
|
<!--The uid testuser_uniqueness already exist in the DIT. the Add must be refused with the error 19 -->
|
|
<script>
|
listAttr = []
|
listAttr.append('objectclass:top')
|
listAttr.append('objectclass:organizationalperson')
|
listAttr.append('objectclass:inetorgperson')
|
listAttr.append('objectclass:person')
|
listAttr.append('givenname:testuser_uniqueness')
|
listAttr.append('sn:testuser_uniqueness')
|
listAttr.append('cn:testuser_uniqueness')
|
</script>
|
|
<call function="'addAnEntry'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'DNToAdd' : 'uid=testuser_uniqueness,dc=example,%s' % DIRECTORY_INSTANCE_SFX,
|
'listAttributes' : listAttr,
|
'expectedRC' : 19
|
}
|
</call>
|
|
<call function="'testCase_Postamble'"/>
|
</sequence>
|
</testcase>
|
|
|
<!---
|
#@TestMarker Plugin uniqueness
|
#@TestName Plugin uniqueness
|
#@TestIssue Check the plugin uniqueness with the type mail
|
#@TestPreamble none
|
#@TestStep set the type to mail
|
#@TestStep Check we can't add an entry with the same mail as the user entry reference
|
#@TestPostamble none
|
#@TestResult The test is passed if the creation is refused
|
-->
|
|
|
<testcase name="getTestCaseName('Enabled with type defined to mail')">
|
<sequence>
|
<call function="'testCase_Preamble'"/>
|
|
|
|
|
<message>'###### Set the type to mail ###### '</message>
|
<message>' '</message>
|
|
<call function="'dsconfig'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'subcommand' : 'set-plugin-prop' ,
|
'objectType' : 'plugin-name' ,
|
'objectName' : 'UID Unique Attribute',
|
'optionsString' : '--set type:mail',
|
'expectedRC' : 0 }
|
</call>
|
|
|
<message>'###### Add an entry containing a mail already present in the DIT ###### '</message>
|
<!-- Add an entry -->
|
<!-- the Add must be refused with the error 19 -->
|
<script>
|
listAttr = []
|
listAttr.append('objectclass:top')
|
listAttr.append('objectclass:organizationalperson')
|
listAttr.append('objectclass:inetorgperson')
|
listAttr.append('objectclass:person')
|
listAttr.append('givenname:newtestuser_uniqueness')
|
listAttr.append('sn:newtestuser_uniqueness')
|
listAttr.append('cn:newtestuser_uniqueness')
|
listAttr.append('mail:testuser_uniqueness@sun')
|
</script>
|
|
|
<call function="'addAnEntry'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'DNToAdd' : 'uid=newtestuser_uniqueness,dc=example,%s' % DIRECTORY_INSTANCE_SFX,
|
'listAttributes' : listAttr,
|
'expectedRC' : 19
|
}
|
</call>
|
|
<call function="'testCase_Postamble'"/>
|
</sequence>
|
</testcase>
|
|
|
|
<!---
|
#@TestMarker Plugin uniqueness
|
#@TestName Plugin uniqueness
|
#@TestIssue Check the plugin uniqueness with several type
|
#@TestPreamble none
|
#@TestStep set the type to mail and telephonenumber
|
#@TestStep Check we can't add an entry with the same mail as the user entry reference
|
#@TestStep Check we can't add an entry with the same telephonenumber as the user entry reference
|
#@TestPostamble none
|
#@TestResult The test is passed if the creation is refused
|
-->
|
|
<testcase name="getTestCaseName('Enabled with type defined to mail and telephoneNumber')">
|
<sequence>
|
<call function="'testCase_Preamble'"/>
|
|
|
<message>'###### Set the type to mail and telephoneNumber ###### '</message>
|
<message>' '</message>
|
|
<call function="'dsconfig'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'subcommand' : 'set-plugin-prop' ,
|
'objectType' : 'plugin-name' ,
|
'objectName' : 'UID Unique Attribute',
|
'optionsString' : '--set type:mail --set type:telephoneNumber',
|
'expectedRC' : 0 }
|
</call>
|
|
|
<message>'###### Add an entry containing a mail already present in the DIT ###### '</message>
|
<!-- Add an entry -->
|
<!-- the Add must be refused with the error 19 -->
|
<script>
|
listAttr = []
|
listAttr.append('objectclass:top')
|
listAttr.append('objectclass:organizationalperson')
|
listAttr.append('objectclass:inetorgperson')
|
listAttr.append('objectclass:person')
|
listAttr.append('givenname:newtestuser_uniqueness')
|
listAttr.append('sn:newtestuser_uniqueness')
|
listAttr.append('cn:newtestuser_uniqueness')
|
listAttr.append('mail:testuser_uniqueness@sun')
|
</script>
|
|
|
<call function="'addAnEntry'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'DNToAdd' : 'uid=newtestuser_uniqueness,dc=example,%s' % DIRECTORY_INSTANCE_SFX,
|
'listAttributes' : listAttr,
|
'expectedRC' : 19
|
}
|
</call>
|
|
|
<message>'###### Add an entry containing a telephoneNumber already present in the DIT ###### '</message>
|
<!-- Add an entry -->
|
<!-- the Add must be refused with the error 19 -->
|
<script>
|
listAttr = []
|
listAttr.append('objectclass:top')
|
listAttr.append('objectclass:organizationalperson')
|
listAttr.append('objectclass:inetorgperson')
|
listAttr.append('objectclass:person')
|
listAttr.append('givenname:newtestuser_uniqueness')
|
listAttr.append('sn:newtestuser_uniqueness')
|
listAttr.append('cn:newtestuser_uniqueness')
|
listAttr.append('telephoneNumber:1 2 3 4')
|
</script>
|
|
|
<call function="'addAnEntry'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'DNToAdd' : 'uid=newtestuser_uniqueness,dc=example,%s' % DIRECTORY_INSTANCE_SFX,
|
'listAttributes' : listAttr,
|
'expectedRC' : 19
|
}
|
</call>
|
|
|
|
<message>'###### Add an entry containing a telephoneNumber not present in the DIT ###### '</message>
|
<!-- Add an entry -->
|
<!-- the Add must be accepted -->
|
<script>
|
listAttr = []
|
listAttr.append('objectclass:top')
|
listAttr.append('objectclass:organizationalperson')
|
listAttr.append('objectclass:inetorgperson')
|
listAttr.append('objectclass:person')
|
listAttr.append('givenname:newtestuser_uniqueness')
|
listAttr.append('sn:newtestuser_uniqueness')
|
listAttr.append('cn:newtestuser_uniqueness')
|
listAttr.append('telephoneNumber:1 2 3 4 5')
|
</script>
|
|
|
<call function="'addAnEntry'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'DNToAdd' : 'uid=newtestuser_uniqueness,dc=example,%s' % DIRECTORY_INSTANCE_SFX,
|
'listAttributes' : listAttr,
|
'expectedRC' : 0
|
}
|
</call>
|
|
<!-- cleanup -->
|
<message>'###### Cleanup ###### '</message>
|
<message>' '</message>
|
|
<call function="'DeleteEntry'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'dsBaseDN' : 'uid=newtestuser_uniqueness,dc=example,%s' % DIRECTORY_INSTANCE_SFX,
|
}
|
</call>
|
|
<call function="'testCase_Postamble'"/>
|
</sequence>
|
</testcase>
|
|
|
<!---
|
#@TestMarker Plugin uniqueness
|
#@TestName Plugin uniqueness
|
#@TestIssue Check the plugin ensures the uniqueness of the attributes multi valued
|
#@TestPreamble none
|
#@TestStep set the type to description
|
#@TestStep Check we can't add an entry with the same description as the user entry reference
|
#@TestStep the attribute description is multi-valued
|
#@TestPostamble none
|
#@TestResult The test is passed if the creation is refused
|
-->
|
|
<testcase name="getTestCaseName('Check uniqueness of attributes mutil-valued')">
|
<sequence>
|
<call function="'testCase_Preamble'"/>
|
|
|
<message>'###### Set the type to description ###### '</message>
|
<message>' '</message>
|
|
<call function="'dsconfig'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'subcommand' : 'set-plugin-prop' ,
|
'objectType' : 'plugin-name' ,
|
'objectName' : 'UID Unique Attribute',
|
'optionsString' : '--set type:description',
|
'expectedRC' : 0 }
|
</call>
|
|
|
<message>'###### Add an entry containing a description already present in the DIT ###### '</message>
|
<!-- Add an entry -->
|
<!-- the Add must be refused with the error 19 -->
|
<script>
|
listAttr = []
|
listAttr.append('objectclass:top')
|
listAttr.append('objectclass:organizationalperson')
|
listAttr.append('objectclass:inetorgperson')
|
listAttr.append('objectclass:person')
|
listAttr.append('givenname:newtestuser_uniqueness')
|
listAttr.append('sn:newtestuser_uniqueness')
|
listAttr.append('cn:newtestuser_uniqueness')
|
listAttr.append('description:mydescription2')
|
</script>
|
|
|
<call function="'addAnEntry'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'DNToAdd' : 'uid=newtestuser_uniqueness,dc=example,%s' % DIRECTORY_INSTANCE_SFX,
|
'listAttributes' : listAttr,
|
'expectedRC' : 19
|
}
|
</call>
|
|
|
<message>'###### Add an entry containing a description not present in the DIT ###### '</message>
|
<!-- Add an entry -->
|
<!-- the Add must be accepted -->
|
<script>
|
listAttr = []
|
listAttr.append('objectclass:top')
|
listAttr.append('objectclass:organizationalperson')
|
listAttr.append('objectclass:inetorgperson')
|
listAttr.append('objectclass:person')
|
listAttr.append('givenname:newtestuser_uniqueness')
|
listAttr.append('sn:newtestuser_uniqueness')
|
listAttr.append('cn:newtestuser_uniqueness')
|
listAttr.append('description:mydescription')
|
</script>
|
|
|
<call function="'addAnEntry'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'DNToAdd' : 'uid=newtestuser_uniqueness,dc=example,%s' % DIRECTORY_INSTANCE_SFX,
|
'listAttributes' : listAttr,
|
'expectedRC' : 0
|
}
|
</call>
|
|
|
<!-- cleanup -->
|
<message>'###### Cleanup ###### '</message>
|
<message>' '</message>
|
|
<call function="'DeleteEntry'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'dsBaseDN' : 'uid=newtestuser_uniqueness,dc=example,%s' % DIRECTORY_INSTANCE_SFX,
|
}
|
</call>
|
|
<call function="'testCase_Postamble'"/>
|
</sequence>
|
</testcase>
|
|
|
<!---
|
#@TestMarker Plugin uniqueness
|
#@TestName Plugin uniqueness
|
#@TestIssue Check the plugin uniqueness matchs the scope configured
|
#@TestPreamble none
|
#@TestStep set the type to description
|
#@TestStep set the base-dn
|
#@TestStep Check we can't add an entry under the restricted scope
|
#@TestStep Check we can add an entry outside the restricted scope
|
#@TestPostamble none
|
#@TestResult The test is passed is the plugin respectes the restricted scope
|
-->
|
|
<testcase name="getTestCaseName('Restrict the scope of the plugin')">
|
<sequence>
|
<call function="'testCase_Preamble'"/>
|
|
<message>'###### Set the base-dn to dc=example,%s ###### ' % DIRECTORY_INSTANCE_SFX</message>
|
<message>' '</message>
|
|
<call function="'dsconfig'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'subcommand' : 'set-plugin-prop' ,
|
'objectType' : 'plugin-name' ,
|
'objectName' : 'UID Unique Attribute',
|
'optionsString' : '--set type:description --set base-dn:dc=example,%s' % DIRECTORY_INSTANCE_SFX,
|
'expectedRC' : 0 }
|
</call>
|
|
|
<message>'###### Add an entry under dc=example,%s ###### ' % DIRECTORY_INSTANCE_SFX</message>
|
<!-- Add an entry -->
|
<!-- the Add must be accepted -->
|
|
<script>
|
listAttr = []
|
listAttr.append('objectclass:top')
|
listAttr.append('objectclass:organizationalperson')
|
listAttr.append('objectclass:inetorgperson')
|
listAttr.append('objectclass:person')
|
listAttr.append('givenname:newtestuser_uniqueness')
|
listAttr.append('sn:newtestuser_uniqueness')
|
listAttr.append('cn:newtestuser_uniqueness')
|
listAttr.append('description:mydescription2')
|
</script>
|
|
|
<call function="'addAnEntry'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'DNToAdd' : 'uid=newtestuser_uniqueness,dc=example,%s' % DIRECTORY_INSTANCE_SFX,
|
'listAttributes' : listAttr,
|
'expectedRC' : 0
|
}
|
</call>
|
|
|
<message>'###### Add an entry under %s ###### ' % DIRECTORY_INSTANCE_SFX</message>
|
<!-- Add an entry -->
|
<!-- the Add must be refused with the error 19 -->
|
<script>
|
listAttr = []
|
listAttr.append('objectclass:top')
|
listAttr.append('objectclass:organizationalperson')
|
listAttr.append('objectclass:inetorgperson')
|
listAttr.append('objectclass:person')
|
listAttr.append('givenname:newtestuser_uniqueness')
|
listAttr.append('sn:newtestuser_uniqueness')
|
listAttr.append('cn:newtestuser_uniqueness')
|
listAttr.append('description:mydescription2')
|
</script>
|
|
|
<call function="'addAnEntry'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'DNToAdd' : 'uid=newtestuser_uniqueness,%s' % DIRECTORY_INSTANCE_SFX,
|
'listAttributes' : listAttr,
|
'expectedRC' : 0
|
}
|
</call>
|
|
<!-- cleanup -->
|
<message>'###### Cleanup ###### '</message>
|
<message>' '</message>
|
|
<call function="'DeleteEntry'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'dsBaseDN' : 'uid=newtestuser_uniqueness,%s' % DIRECTORY_INSTANCE_SFX,
|
}
|
</call>
|
|
<call function="'testCase_Postamble'"/>
|
</sequence>
|
</testcase>
|
|
|
<!---
|
#@TestMarker Plugin uniqueness
|
#@TestName Plugin uniqueness
|
#@TestIssue Disable the plugin uniqueness with the uniqu
|
#@TestStep Disable the plugin uniqueness
|
#@TestStep Keep the default configuration ( ie, type = uid )
|
#@TestStep Add an entry containing a uid value already present in the DIT
|
#@TestPostamble none
|
#@TestResult The test is passed if the creation is accepted
|
-->
|
|
|
<testcase name="getTestCaseName('Disabled with type defined to uid')">
|
<sequence>
|
<call function="'testCase_Preamble'"/>
|
|
<message>'###### Disable the uniqueness plugin ###### '</message>
|
<message>' '</message>
|
<call function="'dsconfig'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'subcommand' : 'set-plugin-prop' ,
|
'objectType' : 'plugin-name' ,
|
'objectName' : 'UID Unique Attribute',
|
'optionsString' : '--set enabled:false',
|
'expectedRC' : 0 }
|
</call>
|
|
<message>'###### Add an entry ###### '</message>
|
<message>'-- The creation must be accepted '</message>
|
<!-- Add an entry -->
|
<!-- The add must be accepted -->
|
<script>
|
listAttr = []
|
listAttr.append('objectclass:top')
|
listAttr.append('objectclass:organizationalperson')
|
listAttr.append('objectclass:inetorgperson')
|
listAttr.append('objectclass:person')
|
listAttr.append('givenname:testuser_uniqueness')
|
listAttr.append('sn:testuser_uniqueness')
|
listAttr.append('cn:testuser_uniqueness')
|
listAttr.append('uid:testuser_uniqueness')
|
</script>
|
|
<call function="'addAnEntry'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'DNToAdd' : 'uid=testuser_uniqueness,dc=example,%s' % DIRECTORY_INSTANCE_SFX,
|
'listAttributes' : listAttr,
|
'expectedRC' : 0
|
}
|
</call>
|
|
<!-- cleanup -->
|
<message>'###### Cleanup ###### '</message>
|
<message>' '</message>
|
<call function="'DeleteEntry'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'dsBaseDN' : 'uid=testuser_uniqueness,dc=example,%s' % DIRECTORY_INSTANCE_SFX,
|
}
|
</call>
|
|
<call function="'testCase_Postamble'"/>
|
</sequence>
|
</testcase>
|
|
|
|
<!---
|
#@TestMarker Plugin uniqueness
|
#@TestName Plugin uniqueness
|
#@TestIssue Cleanup
|
#@TestPreamble none
|
#@TestStep delete the user entries
|
#@TestPostamble none
|
#@TestResult The test is passed if the delete are done
|
-->
|
|
|
<testcase name="getTestCaseName('Cleanup')">
|
<sequence>
|
<call function="'testCase_Preamble'"/>
|
|
<call function="'DeleteEntry'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'dsBaseDN' : 'uid=testuser_uniqueness,%s' % DIRECTORY_INSTANCE_SFX,
|
}
|
</call>
|
|
|
<message>'###### Desactivate the uniqueness plugin. ###### '</message>
|
<message>' '</message>
|
|
<call function="'dsconfig'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'subcommand' : 'set-plugin-prop' ,
|
'objectType' : 'plugin-name' ,
|
'objectName' : 'UID Unique Attribute',
|
'optionsString' : '--set enabled:false',
|
'expectedRC' : 0 }
|
</call>
|
|
|
<call function="'testCase_Postamble'"/>
|
</sequence>
|
</testcase>
|
|
|
<call function="'testSuite_Postamble'" />
|
</sequence>
|
</block>
|
</function>
|
</stax>
|