2454N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2887N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
2454N/A<!--
2454N/A ! CDDL HEADER START
2454N/A !
2454N/A ! The contents of this file are subject to the terms of the
2454N/A ! Common Development and Distribution License, Version 1.0 only
2454N/A ! (the "License"). You may not use this file except in compliance
2454N/A ! with the License.
2454N/A !
2454N/A ! You can obtain a copy of the license at
2454N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
2454N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
2454N/A ! See the License for the specific language governing permissions
2454N/A ! and limitations under the License.
2454N/A !
2454N/A ! When distributing Covered Code, include this CDDL HEADER in each
2454N/A ! file and include the License file at
2454N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
2454N/A ! add the following below this CDDL HEADER, with the fields enclosed
2454N/A ! by brackets "[]" replaced with your own identifying information:
2454N/A ! Portions Copyright [yyyy] [name of copyright owner]
2454N/A !
2454N/A ! CDDL HEADER END
2454N/A !
4618N/A ! Copyright 2007-2009 Sun Microsystems, Inc.
2454N/A ! -->
2454N/A<stax>
2454N/A <defaultcall function="plugins_refint"/>
2454N/A <function name="plugins_refint" scope="local">
2454N/A <block name="STAXCurrentFunction">
4618N/A <try>
2454N/A <sequence>
2454N/A <script>
2454N/A CurrentTestPath['suite']=STAXCurrentFunction
2454N/A </script>
2454N/A <call function="'testSuite_Preamble'" />
2454N/A
4618N/A <call function="'common_setup'">
4618N/A {
4618N/A 'quickStart' : True ,
4618N/A 'startServer' : True ,
4618N/A 'stopServer' : False
4618N/A }
4618N/A </call>
3154N/A
3154N/A
3188N/A<!--- Test Suite information
3188N/A#@TestSuiteName Plugin referential integrity on groups
3188N/A#@TestSuitePurpose Validate Plugin referential integrity on groups
3188N/A#@TestSuiteID Plugins
3188N/A#@TestSuiteGroup Plugins
3188N/A#@TestGroup Plugins
3188N/A#@TestScript plugins_refint.xml
3188N/A#@TestHTMLLink http://opends.dev.java.net/
3188N/A-->
3188N/A
2454N/A<!--
3188N/A#@TestMarker Plugin referential integrity on groups
3188N/A#@TestName Plugin referential integrity setup
3188N/A#@TestPurpose Setup
2454N/A#@TestPreamble none
3188N/A#@TestStep Create the child_staticgroup static Group of users under dc=group,dc=com
3188N/A#@TestStep Create the top_staticgroup static Group of users under dc=com
2454N/A#@TestPostamble none
2454N/A#@TestResult The test is passed if the creation is done
2454N/A-->
2454N/A
2454N/A
2454N/A <testcase name="getTestCaseName('Setup')">
2454N/A <sequence>
2454N/A <call function="'testCase_Preamble'"/>
2454N/A
2454N/A
2454N/A
2454N/A <message>'###### Add user entries ###### '</message>
2454N/A <message>' '</message>
2454N/A
2454N/A <!-- Add an entry -->
2505N/A <iterate var="username" in="['user01','user02','user03','user04','user05','user06','user07']" >
2454N/A <sequence>
2454N/A <script>
2454N/A listAttr=[]
2454N/A listAttr.append('objectclass:top')
2454N/A listAttr.append('objectclass:organizationalperson')
2454N/A listAttr.append('objectclass:inetorgperson')
2454N/A listAttr.append('objectclass:person')
2454N/A listAttr.append('givenname:%s' % username)
2454N/A listAttr.append('cn:%s' % username)
2454N/A listAttr.append('description:%s' % username)
2454N/A listAttr.append('uid:%s' % username)
2454N/A listAttr.append('sn:%s' % username)
2454N/A </script>
2454N/A
2454N/A <call function="'addAnEntry'">
2454N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
3060N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
3060N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
2454N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3060N/A 'DNToAdd' : 'cn=%s,%s' % (username,DIRECTORY_INSTANCE_SFX),
3060N/A 'listAttributes' : listAttr,
3060N/A 'expectedRC' : 0
2454N/A }
2454N/A </call>
2454N/A </sequence>
2454N/A </iterate>
2454N/A
3188N/A <message>'###### Add a static Group under dc=group ###### '</message>
2454N/A <message>' '</message>
2454N/A
2454N/A <script>
2454N/A listAttr = []
2454N/A listAttr.append('objectclass:top')
2454N/A listAttr.append('objectClass:domain')
2454N/A listAttr.append('dc:groups')
2454N/A </script>
2454N/A
2454N/A
2454N/A <call function="'addAnEntry'">
2454N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
2454N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
2454N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
2454N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
2454N/A 'DNToAdd' : 'dc=groups,%s' % DIRECTORY_INSTANCE_SFX,
2454N/A 'listAttributes' : listAttr,
2454N/A 'expectedRC' : 0
2454N/A }
2454N/A </call>
2454N/A
2505N/A <!-- Add a static group under dc=groups-->
2454N/A <script>
2454N/A listAttr = []
2454N/A listAttr.append('objectclass:top')
2454N/A listAttr.append('objectclass:groupofuniquenames')
3188N/A listAttr.append('description:this is the description of child_staticgroup')
3188N/A listAttr.append('cn:child_staticgroup')
2454N/A listAttr.append('uniqueMember:cn=user01,%s' % DIRECTORY_INSTANCE_SFX)
2454N/A listAttr.append('uniqueMember:cn=user02,%s' % DIRECTORY_INSTANCE_SFX)
2454N/A listAttr.append('uniqueMember:cn=user03,%s' % DIRECTORY_INSTANCE_SFX)
2454N/A listAttr.append('uniqueMember:cn=user04,%s' % DIRECTORY_INSTANCE_SFX)
2505N/A listAttr.append('uniqueMember:cn=user05,%s' % DIRECTORY_INSTANCE_SFX)
2505N/A listAttr.append('uniqueMember:cn=user06,%s' % DIRECTORY_INSTANCE_SFX)
2505N/A listAttr.append('uniqueMember:cn=user07,%s' % DIRECTORY_INSTANCE_SFX)
2454N/A </script>
2454N/A
2454N/A <call function="'addAnEntry'">
2454N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
2454N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
2454N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
2454N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3188N/A 'DNToAdd' : 'cn=child_staticgroup,dc=groups,%s' % DIRECTORY_INSTANCE_SFX,
2454N/A 'listAttributes' : listAttr,
2454N/A 'expectedRC' : 0
2454N/A }
2454N/A </call>
2454N/A
2454N/A
2505N/A <!-- Add a static group under DIRECTORY_INSTANCE_SFX-->
2505N/A <script>
2505N/A listAttr = []
2505N/A listAttr.append('objectclass:top')
2505N/A listAttr.append('objectclass:groupofuniquenames')
3188N/A listAttr.append('description:this is the description of top_staticgroup on top ')
3188N/A listAttr.append('cn:top_staticgroup')
2505N/A listAttr.append('uniqueMember:cn=user01,%s' % DIRECTORY_INSTANCE_SFX)
2505N/A listAttr.append('uniqueMember:cn=user02,%s' % DIRECTORY_INSTANCE_SFX)
2505N/A listAttr.append('uniqueMember:cn=user03,%s' % DIRECTORY_INSTANCE_SFX)
2505N/A listAttr.append('uniqueMember:cn=user04,%s' % DIRECTORY_INSTANCE_SFX)
2505N/A listAttr.append('uniqueMember:cn=user05,%s' % DIRECTORY_INSTANCE_SFX)
2505N/A listAttr.append('uniqueMember:cn=user06,%s' % DIRECTORY_INSTANCE_SFX)
2505N/A listAttr.append('uniqueMember:cn=user07,%s' % DIRECTORY_INSTANCE_SFX)
2505N/A </script>
2505N/A
2505N/A <call function="'addAnEntry'">
2505N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
2505N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
2505N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
2505N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3188N/A 'DNToAdd' : 'cn=top_staticgroup,%s' % DIRECTORY_INSTANCE_SFX,
2505N/A 'listAttributes' : listAttr,
2505N/A 'expectedRC' : 0
2505N/A }
2505N/A </call>
2505N/A
2454N/A <!-- Check the group configuration -->
2454N/A <call function="'SearchObject'">
2454N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
3060N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
3060N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
3060N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3188N/A 'dsBaseDN' : 'cn=top_staticgroup,%s' % DIRECTORY_INSTANCE_SFX,
3060N/A 'dsFilter' : 'objectclass=groupOfUniqueNames' ,
3060N/A 'attributes' : 'uniqueMember',
2454N/A 'expectedRC' : 0 }
2454N/A </call>
2454N/A
2454N/A
2454N/A <script>
2454N/A returnString = STAXResult[0][1]
2454N/A </script>
2454N/A <call function="'searchStringForSubstring'">
2454N/A { 'returnString' : returnString ,
2454N/A 'testString' : 'uniqueMember',
2454N/A 'expectedResult' : '1' }
2454N/A </call>
2454N/A
3060N/A <!-- Check the group configuration -->
2505N/A <call function="'SearchObject'">
3060N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
3060N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
3060N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
3060N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3188N/A 'dsBaseDN' : 'cn=child_staticgroup,dc=groups,%s' % DIRECTORY_INSTANCE_SFX,
3060N/A 'dsFilter' : 'objectclass=groupOfUniqueNames' ,
2505N/A 'attributes' : 'uniqueMember',
3060N/A 'expectedRC' : 0 }
2505N/A </call>
2505N/A
2505N/A
2505N/A <script>
2505N/A returnString = STAXResult[0][1]
2505N/A </script>
2505N/A <call function="'searchStringForSubstring'">
2505N/A { 'returnString' : returnString ,
2505N/A 'testString' : 'uniqueMember',
3060N/A 'expectedResult' : '1' }
2505N/A </call>
2505N/A
2454N/A
2454N/A <message>'###### Activate the referential integrity plugin. ###### '</message>
2454N/A <message>' '</message>
2454N/A
2454N/A <call function="'dsconfig'">
2454N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
2454N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
3188N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3188N/A 'subcommand' : 'set-plugin-prop' ,
3188N/A 'objectType' : 'plugin-name' ,
3188N/A 'objectName' : 'Referential Integrity',
3188N/A 'optionsString' : '--set enabled:true',
2454N/A 'expectedRC' : 0 }
2454N/A </call>
3960N/A
3960N/A <message>'###### Get the Referential Integrity Plugin ###### '</message>
3960N/A <call function="'dsconfig'">
3960N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
3960N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
3960N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3960N/A 'subcommand' : 'get-plugin-prop' ,
3960N/A 'objectType' : 'plugin-name' ,
3960N/A 'objectName' : 'Referential Integrity',
3960N/A 'expectedRC' : 0 }
3960N/A </call>
2454N/A
2454N/A <call function="'testCase_Postamble'"/>
2454N/A </sequence>
2454N/A </testcase>
2505N/A
2505N/A
2505N/A<!--
3188N/A#@TestMarker Plugin referential integrity on groups
3188N/A#@TestName Referential check is limited to the scope
3188N/A#@TestPurpose Check the referential integrity check is limited to the specified scope
3060N/A#@TestPreamble none
3188N/A#@TestStep Set the base-dn to dc=groups,dc=com
2505N/A#@TestStep Delete the user06
3188N/A#@TestStep The reference must be limited to the scope dc=groups,dc=com
3188N/A#@TestStep The references to the delete user must be removed under cn=child_staticgroup,dc=group,dc=com
3188N/A#@TestStep The references to the delete user must still be present under cn=top_staticgroup,dc=com
3060N/A#@TestPostamble none
2505N/A#@TestResult all steps must be success
2505N/A-->
2505N/A
2505N/A
2624N/A <testcase name="getTestCaseName('Check the change of the base-dn attribute')">
2505N/A <sequence>
2505N/A <call function="'testCase_Preamble'"/>
2505N/A
2624N/A <message>'###### Set the base-dn to dc=groups,%s ###### ' % DIRECTORY_INSTANCE_SFX</message>
2505N/A <message>' '</message>
2505N/A
2505N/A <call function="'dsconfig'">
2505N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
2505N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
3188N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3188N/A 'subcommand' : 'set-plugin-prop' ,
3188N/A 'objectType' : 'plugin-name' ,
3188N/A 'objectName' : 'Referential Integrity',
3188N/A 'optionsString' : '--set base-dn:dc=groups,%s' % DIRECTORY_INSTANCE_SFX,
2505N/A 'expectedRC' : 0 }
2505N/A </call>
2454N/A
2505N/A <call function="'dsconfigGet'">
3960N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
2505N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
2505N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
2505N/A 'objectName' : 'plugin',
2505N/A 'propertyType' : 'plugin',
2505N/A 'propertyName' : 'Referential Integrity',
2624N/A 'attributeName' : 'base-dn'
2505N/A }
2505N/A </call>
2505N/A
2505N/A <!-- Delete an entry -->
2505N/A <message>'###### Delete an user entry###### '</message>
2505N/A <message>' '</message>
2454N/A
2505N/A <call function="'DeleteEntry'">
3060N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
2505N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
3060N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
3060N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3060N/A 'dsBaseDN' : 'cn=user06,%s' % (DIRECTORY_INSTANCE_SFX),
2505N/A }
2505N/A </call>
2505N/A
2505N/A <!-- Check the new configuration is applied -->
2505N/A <message>'The reference check must be limited to the scope dc=groups,dc=com'</message>
2505N/A <message>' '</message>
2505N/A
2505N/A <message>'The reference check must be done to the base DN dc=groups,dc=com'</message>
2505N/A <call function="'SearchObject'">
2505N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
3188N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
3188N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
3188N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3188N/A 'dsBaseDN' : 'cn=child_staticgroup,dc=groups,%s' % DIRECTORY_INSTANCE_SFX,
3188N/A 'dsFilter' : 'objectclass=groupOfUniqueNames' ,
3188N/A 'attributes' : 'uniquemember',
2505N/A 'expectedRC' : 0 }
2505N/A </call>
2505N/A
2505N/A <script>
2505N/A returnString = STAXResult[0][1]
2505N/A </script>
3188N/A
2505N/A <message>'The references to the delete user must be removed' </message>
2505N/A <call function="'searchStringForSubstring'">
2505N/A { 'returnString' : returnString ,
2505N/A 'testString' : 'user06',
3188N/A 'expectedResult' : '0' }
2505N/A </call>
2505N/A
2505N/A <message>'The reference check must not be done to the base DN dc=com'</message>
2505N/A
2505N/A <call function="'SearchObject'">
2505N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
3188N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
3188N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
3188N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3188N/A 'dsBaseDN' : 'cn=top_staticgroup,%s' % DIRECTORY_INSTANCE_SFX,
3188N/A 'dsFilter' : 'objectclass=groupOfUniqueNames' ,
3188N/A 'attributes' : 'uniquemember',
2505N/A 'expectedRC' : 0 }
2505N/A </call>
2505N/A
2505N/A <script>
2505N/A returnString = STAXResult[0][1]
2505N/A </script>
3188N/A
2505N/A <message>'The references to the delete user must be still present ' </message>
2505N/A <call function="'searchStringForSubstring'">
2505N/A { 'returnString' : returnString ,
2505N/A 'testString' : 'user06',
2505N/A 'expectedResult' : '1' }
2505N/A </call>
2505N/A
2624N/A <message>'###### Reset the base-dn ###### '</message>
2505N/A <message>' '</message>
2505N/A
2505N/A <call function="'dsconfig'">
3188N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
3188N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
3188N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3188N/A 'subcommand' : 'set-plugin-prop' ,
3188N/A 'objectType' : 'plugin-name' ,
3188N/A 'objectName' : 'Referential Integrity',
3188N/A 'optionsString' : '--reset base-dn',
3188N/A 'expectedRC' : 0 }
2505N/A </call>
2505N/A
3960N/A <message>'###### Get the Referential Integrity Plugin ###### '</message>
3960N/A <call function="'dsconfig'">
3960N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
3960N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
3960N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3960N/A 'subcommand' : 'get-plugin-prop' ,
3960N/A 'objectType' : 'plugin-name' ,
3960N/A 'objectName' : 'Referential Integrity',
3960N/A 'expectedRC' : 0 }
3960N/A </call>
2505N/A
2505N/A <call function="'testCase_Postamble'"/>
2505N/A </sequence>
2505N/A </testcase>
2505N/A
2505N/A
2454N/A<!--
3188N/A#@TestMarker Plugin referential integrity on groups
3188N/A#@TestName The referential integrity plugin removes only references to deleted entries
3188N/A#@TestPurpose Check the referential integrity plugin removes only references to deleted entries
3060N/A#@TestPreamble none
2454N/A#@TestStep Delete a user
2454N/A#@TestStep Check that the references to the deleted user are gone.
3188N/A#@TestStep Check that there is no impact on the others references.
3188N/A#@TestStep The references to an existing user must still be present.
3060N/A#@TestPostamble none
2454N/A#@TestResult all steps must be success
2454N/A-->
2454N/A
2454N/A
3188N/A <testcase name="getTestCaseName('The referential integrity plugin removes only references to deleted entries')">
2454N/A <sequence>
2454N/A <call function="'testCase_Preamble'"/>
2454N/A
2454N/A <message>'###### Delete an user entry###### '</message>
2454N/A <message>' '</message>
2454N/A
2454N/A <!-- Delete an entry -->
2454N/A <call function="'DeleteEntry'">
2454N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
3060N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
3060N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
2454N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3060N/A 'dsBaseDN' : 'cn=user01,%s' % (DIRECTORY_INSTANCE_SFX),
2454N/A }
2454N/A </call>
2454N/A
2454N/A
2454N/A <call function="'SearchObject'">
3060N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
3060N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
3060N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
3060N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3060N/A 'dsBaseDN' : DIRECTORY_INSTANCE_SFX,
3060N/A 'dsFilter' : 'objectclass=groupOfUniqueNames' ,
2454N/A 'attributes' : 'uniquemember',
3060N/A 'expectedRC' : 0 }
2454N/A </call>
2454N/A
2454N/A <script>
2454N/A returnString = STAXResult[0][1]
2454N/A </script>
2454N/A <message>'references to the delete user must be gone ' </message>
2454N/A <call function="'searchStringForSubstring'">
2454N/A { 'returnString' : returnString ,
2454N/A 'testString' : 'user01',
3060N/A 'expectedResult' : '0' }
2454N/A </call>
2454N/A
2454N/A <message>'references to an existing user must be still present' </message>
2454N/A <call function="'searchStringForSubstring'">
2454N/A { 'returnString' : returnString ,
2454N/A 'testString' : 'user02',
3060N/A 'expectedResult' : '1' }
2454N/A </call>
2454N/A
2454N/A <call function="'testCase_Postamble'"/>
2454N/A </sequence>
2454N/A </testcase>
2454N/A
2454N/A<!--
3188N/A#@TestMarker Plugin referential integrity on groups
3188N/A#@TestName The referential integrity is checked on the specified attribut-type
3188N/A#@TestPurpose Check the referential integrity is checked on the specified attribut-type
3188N/A#@TestPreamble none
3188N/A#@TestStep Remove the attribute uniquemember from the list of attribute-type
3188N/A#@TestStep Delete a user entry
2454N/A#@TestStep Check that the references to the deleted user are still present
3188N/A#@TestStep Restore the attribute uniquemember from the list of attribute-type
3060N/A#@TestPostamble none
2454N/A#@TestResult all steps must be success
2454N/A-->
2454N/A
2454N/A
3188N/A <testcase name="getTestCaseName('Check the referential integrity is checked on the specified attribut-type')">
2454N/A <sequence>
2454N/A <call function="'testCase_Preamble'"/>
2454N/A
2624N/A <message>'###### Remove the attribute uniquemember from the list of attribute-type ###### '</message>
2454N/A <message>' '</message>
2454N/A
2454N/A <call function="'dsconfig'">
2454N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
2454N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
3060N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3060N/A 'subcommand' : 'set-plugin-prop' ,
3060N/A 'objectType' : 'plugin-name' ,
3060N/A 'objectName' : 'Referential Integrity',
3060N/A 'optionsString' : '--remove attribute-type:uniquemember',
2454N/A 'expectedRC' : 0 }
2454N/A </call>
3960N/A
3960N/A <message>'###### Get the Referential Integrity Plugin ###### '</message>
3960N/A <call function="'dsconfig'">
3960N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
3960N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
3960N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3960N/A 'subcommand' : 'get-plugin-prop' ,
3960N/A 'objectType' : 'plugin-name' ,
3960N/A 'objectName' : 'Referential Integrity',
3960N/A 'expectedRC' : 0 }
3960N/A </call>
2454N/A
2454N/A <!-- Delete an entry -->
2454N/A <message>'###### Delete an user entry###### '</message>
2454N/A <message>' '</message>
2454N/A
2454N/A <call function="'DeleteEntry'">
2454N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
3060N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
3060N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
2454N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3060N/A 'dsBaseDN' : 'cn=user02,%s' % (DIRECTORY_INSTANCE_SFX),
2454N/A }
2454N/A </call>
2454N/A
2454N/A <!-- Check the new configuration is applied -->
2454N/A <message>'Check the new configuration is applied'</message>
2454N/A
2454N/A <call function="'SearchObject'">
3060N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
2454N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
2454N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
3060N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3060N/A 'dsBaseDN' : DIRECTORY_INSTANCE_SFX,
3060N/A 'dsFilter' : 'objectclass=groupOfUniqueNames' ,
3060N/A 'attributes' : 'uniquemember',
3060N/A 'expectedRC' : 0 }
2454N/A </call>
2454N/A
2454N/A <script>
2454N/A returnString = STAXResult[0][1]
2454N/A </script>
2454N/A <message>'The references to the delete user must be still present ' </message>
2454N/A <call function="'searchStringForSubstring'">
2454N/A { 'returnString' : returnString ,
2454N/A 'testString' : 'user02',
3060N/A 'expectedResult' : '1' }
2454N/A </call>
2454N/A
2624N/A <message>'###### Restore the attribute uniquemember from the list of attribute-type ###### '</message>
2505N/A <message>' '</message>
2505N/A
2505N/A <call function="'dsconfig'">
3960N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
3960N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
2505N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
2505N/A 'subcommand' : 'set-plugin-prop' ,
3960N/A 'objectType' : 'plugin-name' ,
3960N/A 'objectName' : 'Referential Integrity',
3960N/A 'optionsString' : '--add attribute-type:uniquemember',
3960N/A 'expectedRC' : 0 }
3960N/A </call>
3960N/A
3960N/A <message>'###### Get the Referential Integrity Plugin ###### '</message>
3960N/A <call function="'dsconfig'">
3960N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
3960N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
3960N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3960N/A 'subcommand' : 'get-plugin-prop' ,
3960N/A 'objectType' : 'plugin-name' ,
3960N/A 'objectName' : 'Referential Integrity',
2505N/A 'expectedRC' : 0 }
3960N/A </call>
2505N/A
2454N/A <call function="'testCase_Postamble'"/>
2454N/A </sequence>
2454N/A </testcase>
2454N/A
2454N/A
2505N/A
2505N/A
2505N/A
2454N/A<!--
3188N/A#@TestMarker Plugin referential integrity on groups
3188N/A#@TestName The referential integrity is checked on the specified plugin-type
3188N/A#@TestPurpose Check the referential integrity is checked on the specified plugin-type
3188N/A#@TestPreamble none
3188N/A#@TestStep Remove the plugin-type attribute postoperationdelete
2505N/A#@TestStep Delete the user05
2505N/A#@TestStep Check that the references to the deleted user are still present
3188N/A#@TestStep Add the plugin-type attribute postoperationdelete
3188N/A#@TestPostamble none
2505N/A#@TestResult all steps must be success
3188N/A-->
3188N/A
3188N/A
3188N/A <testcase name="getTestCaseName(' The referential integrity is checked on the specified plugin-type')">
2505N/A <sequence>
2505N/A <call function="'testCase_Preamble'"/>
2505N/A
2505N/A <message>'###### Remove the plugin-type attribute postoperationdelete ###### '</message>
2505N/A <message>' '</message>
2505N/A
2505N/A <call function="'dsconfig'">
2505N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
2505N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
3188N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3188N/A 'subcommand' : 'set-plugin-prop' ,
3188N/A 'objectType' : 'plugin-name' ,
3188N/A 'objectName' : 'Referential Integrity',
3188N/A 'optionsString' : '--remove plugin-type:postoperationdelete',
2505N/A 'expectedRC' : 0 }
2505N/A </call>
2582N/A
3960N/A <message>'###### Get the Referential Integrity Plugin ###### '</message>
3960N/A <call function="'dsconfig'">
3960N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
3960N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
3960N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3960N/A 'subcommand' : 'get-plugin-prop' ,
3960N/A 'objectType' : 'plugin-name' ,
3960N/A 'objectName' : 'Referential Integrity',
3960N/A 'expectedRC' : 0 }
3960N/A </call>
3960N/A
2582N/A <!-- plugin-type attribute is not dynamic. Need to restart the server -->
3060N/A <call function="'StopDsWithScript'">
3853N/A { 'location' : STAF_REMOTE_HOSTNAME,
3853N/A 'dsHost' : DIRECTORY_INSTANCE_HOST,
3853N/A 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
3853N/A 'dsBindDN' : DIRECTORY_INSTANCE_DN,
4153N/A 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
2582N/A </call>
4153N/A <call function="'StartDsWithScript'">
4153N/A { 'location' : STAF_REMOTE_HOSTNAME }
4153N/A </call>
4153N/A
3060N/A <!--- Check that DS started -->
3060N/A <call function="'isAlive'">
4153N/A { 'noOfLoops' : 10 ,
3060N/A 'noOfMilliSeconds' : 2000
3060N/A }
3060N/A </call>
3060N/A
2505N/A <!-- Delete an entry -->
2505N/A <message>'###### Delete an user entry###### '</message>
2505N/A <message>' '</message>
2505N/A
2505N/A <call function="'DeleteEntry'">
3060N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
2505N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
3060N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
3060N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3060N/A 'dsBaseDN' : 'cn=user05,%s' % (DIRECTORY_INSTANCE_SFX),
2505N/A }
2505N/A </call>
2505N/A
2505N/A <!-- Check the new configuration is applied -->
2505N/A <message>'Check the new configuration is applied'</message>
2505N/A
2505N/A <call function="'SearchObject'">
3060N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
2505N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
2505N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
3060N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3060N/A 'dsBaseDN' : DIRECTORY_INSTANCE_SFX,
3060N/A 'dsFilter' : 'objectclass=groupOfUniqueNames' ,
3060N/A 'attributes' : 'uniquemember',
3060N/A 'expectedRC' : 0 }
2505N/A </call>
2505N/A
2505N/A <script>
2505N/A returnString = STAXResult[0][1]
2505N/A </script>
2505N/A <message>'The references to the delete user must be still present ' </message>
2505N/A <call function="'searchStringForSubstring'">
2505N/A { 'returnString' : returnString ,
2505N/A 'testString' : 'user05',
2505N/A 'expectedResult' : '1' }
2505N/A </call>
2505N/A
2505N/A
2505N/A <message>'###### Add the plugin-type attribute postoperationdelete ###### '</message>
2505N/A <message>' '</message>
2505N/A
2505N/A <call function="'dsconfig'">
3960N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
3960N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
2505N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
2505N/A 'subcommand' : 'set-plugin-prop' ,
3960N/A 'objectType' : 'plugin-name' ,
3960N/A 'objectName' : 'Referential Integrity',
3960N/A 'optionsString' : '--add plugin-type:postoperationdelete',
3960N/A 'expectedRC' : 0 }
3960N/A </call>
3960N/A
3960N/A <message>'###### Get the Referential Integrity Plugin ###### '</message>
3960N/A <call function="'dsconfig'">
3960N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
3960N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
3960N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3960N/A 'subcommand' : 'get-plugin-prop' ,
3960N/A 'objectType' : 'plugin-name' ,
3960N/A 'objectName' : 'Referential Integrity',
2505N/A 'expectedRC' : 0 }
3960N/A </call>
2505N/A
2505N/A <call function="'testCase_Postamble'"/>
2505N/A </sequence>
2505N/A </testcase>
2505N/A
2505N/A
2505N/A
2505N/A
2505N/A<!--
3188N/A#@TestMarker Plugin referential integrity on groups
3188N/A#@TestName The referential integrity is disabled
3188N/A#@TestPurpose Check the server behavior when referential integrity is disabled
3188N/A#@TestPreamble none
2454N/A#@TestStep Disable the referential integrity plugin
2505N/A#@TestStep Delete an user
2454N/A#@TestStep Check that the references to the deleted user are still present
3188N/A#@TestPostamble none
2454N/A#@TestResult all steps must be success
2454N/A-->
2454N/A
2454N/A
2454N/A <testcase name="getTestCaseName('Referential integrity on groups is disabled')">
2454N/A <sequence>
2454N/A <call function="'testCase_Preamble'"/>
2454N/A
2454N/A
2454N/A <message>'###### Disable the referential integrity plugin. ###### '</message>
2454N/A <message>' '</message>
2454N/A
2454N/A <call function="'dsconfig'">
2454N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
2454N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
3060N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3060N/A 'subcommand' : 'set-plugin-prop' ,
3060N/A 'objectType' : 'plugin-name' ,
3060N/A 'objectName' : 'Referential Integrity',
3060N/A 'optionsString' : '--set enabled:false',
2454N/A 'expectedRC' : 0 }
2454N/A </call>
2454N/A
2624N/A <message>'###### Set the list of attribute-type ###### '</message>
2454N/A <message>' '</message>
3960N/A
2454N/A <call function="'dsconfig'">
2454N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
2454N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
3060N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3060N/A 'subcommand' : 'set-plugin-prop' ,
3060N/A 'objectType' : 'plugin-name' ,
3060N/A 'objectName' : 'Referential Integrity',
3960N/A 'optionsString' : '--set attribute-type:uniquemember',
2454N/A 'expectedRC' : 0 }
2454N/A </call>
3960N/A
3960N/A <call function="'dsconfig'">
3960N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
3960N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
3960N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3960N/A 'subcommand' : 'set-plugin-prop' ,
3960N/A 'objectType' : 'plugin-name' ,
3960N/A 'objectName' : 'Referential Integrity',
3960N/A 'optionsString' : '--add attribute-type:member',
3960N/A 'expectedRC' : 0 }
3960N/A </call>
2454N/A
3960N/A <message>'###### Get the Referential Integrity Plugin ###### '</message>
3960N/A <call function="'dsconfig'">
3960N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
3960N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
3960N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3960N/A 'subcommand' : 'get-plugin-prop' ,
3960N/A 'objectType' : 'plugin-name' ,
3960N/A 'objectName' : 'Referential Integrity',
3960N/A 'expectedRC' : 0 }
3960N/A </call>
2454N/A
2454N/A <!-- Delete an entry -->
2454N/A <message>'###### Delete an user entry###### '</message>
2454N/A <message>' '</message>
2454N/A
2454N/A <call function="'DeleteEntry'">
2454N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
3060N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
3060N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
2454N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3060N/A 'dsBaseDN' : 'cn=user07,%s' % (DIRECTORY_INSTANCE_SFX),
2454N/A }
2454N/A </call>
2454N/A
2454N/A
2454N/A <!-- Check the new configuration is applied -->
2454N/A <message>'Check the new configuration is applied'</message>
2454N/A
2454N/A <call function="'SearchObject'">
3060N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
2454N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
2454N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
3060N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3060N/A 'dsBaseDN' : DIRECTORY_INSTANCE_SFX,
3060N/A 'dsFilter' : 'objectclass=groupOfUniqueNames' ,
3060N/A 'attributes' : 'uniquemember',
3060N/A 'expectedRC' : 0 }
3154N/A </call>
3154N/A
2454N/A <script>
2454N/A returnString = STAXResult[0][1]
2454N/A </script>
3154N/A <message>'The references to the delete user must be still present ' </message>
2454N/A <call function="'searchStringForSubstring'">
2454N/A { 'returnString' : returnString ,
2505N/A 'testString' : 'user07',
3060N/A 'expectedResult' : '1' }
3154N/A </call>
3154N/A
2454N/A <call function="'testCase_Postamble'"/>
2454N/A </sequence>
2454N/A </testcase>
3154N/A
2454N/A </sequence>
4618N/A <finally>
4618N/A <sequence>
4618N/A <!-- Test Suite Cleanup -->
4618N/A <message>'Finally: Global Referential Integrety Plugin Cleanup.'</message>
4618N/A <try>
4618N/A <call function="'common_cleanup'" />
4618N/A <catch exception="'STAFException'">
4618N/A <sequence>
4618N/A <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
4618N/A </sequence>
4618N/A </catch>
4618N/A <finally>
4618N/A <call function="'testSuite_Postamble'"/>
4618N/A </finally>
4618N/A </try>
4618N/A </sequence>
4618N/A </finally>
4618N/A
4618N/A </try>
4618N/A </block>
4618N/A </function>
2454N/A</stax>