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