<?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 2007-2008 Sun Microsystems, Inc.
|
! -->
|
<stax>
|
<defaultcall function="plugins_refint"/>
|
<function name="plugins_refint" scope="local">
|
<block name="STAXCurrentFunction">
|
<sequence>
|
<script>
|
CurrentTestPath['suite']=STAXCurrentFunction
|
</script>
|
<call function="'testSuite_Preamble'" />
|
|
|
|
|
<!--- Test Suite information
|
#@TestSuiteName Plugin referential integrity on groups
|
#@TestSuitePurpose Validate Plugin referential integrity on groups
|
#@TestSuiteID Plugins
|
#@TestSuiteGroup Plugins
|
#@TestGroup Plugins
|
#@TestScript plugins_refint.xml
|
#@TestHTMLLink http://opends.dev.java.net/
|
-->
|
|
<!--
|
#@TestMarker Plugin referential integrity on groups
|
#@TestName Plugin referential integrity setup
|
#@TestPurpose Setup
|
#@TestPreamble none
|
#@TestStep Create the child_staticgroup static Group of users under dc=group,dc=com
|
#@TestStep Create the top_staticgroup static Group of users under dc=com
|
#@TestPostamble none
|
#@TestResult The test is passed if the creation is done
|
-->
|
|
|
<testcase name="getTestCaseName('Setup')">
|
<sequence>
|
<call function="'testCase_Preamble'"/>
|
|
|
|
<message>'###### Add user entries ###### '</message>
|
<message>' '</message>
|
|
<!-- Add an entry -->
|
<iterate var="username" in="['user01','user02','user03','user04','user05','user06','user07']" >
|
<sequence>
|
<script>
|
listAttr=[]
|
listAttr.append('objectclass:top')
|
listAttr.append('objectclass:organizationalperson')
|
listAttr.append('objectclass:inetorgperson')
|
listAttr.append('objectclass:person')
|
listAttr.append('givenname:%s' % username)
|
listAttr.append('cn:%s' % username)
|
listAttr.append('description:%s' % username)
|
listAttr.append('uid:%s' % username)
|
listAttr.append('sn:%s' % username)
|
</script>
|
|
<call function="'addAnEntry'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'DNToAdd' : 'cn=%s,%s' % (username,DIRECTORY_INSTANCE_SFX),
|
'listAttributes' : listAttr,
|
'expectedRC' : 0
|
}
|
</call>
|
</sequence>
|
</iterate>
|
|
<message>'###### Add a static Group under dc=group ###### '</message>
|
<message>' '</message>
|
|
<script>
|
listAttr = []
|
listAttr.append('objectclass:top')
|
listAttr.append('objectClass:domain')
|
listAttr.append('dc:groups')
|
</script>
|
|
|
<call function="'addAnEntry'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'DNToAdd' : 'dc=groups,%s' % DIRECTORY_INSTANCE_SFX,
|
'listAttributes' : listAttr,
|
'expectedRC' : 0
|
}
|
</call>
|
|
<!-- Add a static group under dc=groups-->
|
<script>
|
listAttr = []
|
listAttr.append('objectclass:top')
|
listAttr.append('objectclass:groupofuniquenames')
|
listAttr.append('description:this is the description of child_staticgroup')
|
listAttr.append('cn:child_staticgroup')
|
listAttr.append('uniqueMember:cn=user01,%s' % DIRECTORY_INSTANCE_SFX)
|
listAttr.append('uniqueMember:cn=user02,%s' % DIRECTORY_INSTANCE_SFX)
|
listAttr.append('uniqueMember:cn=user03,%s' % DIRECTORY_INSTANCE_SFX)
|
listAttr.append('uniqueMember:cn=user04,%s' % DIRECTORY_INSTANCE_SFX)
|
listAttr.append('uniqueMember:cn=user05,%s' % DIRECTORY_INSTANCE_SFX)
|
listAttr.append('uniqueMember:cn=user06,%s' % DIRECTORY_INSTANCE_SFX)
|
listAttr.append('uniqueMember:cn=user07,%s' % DIRECTORY_INSTANCE_SFX)
|
</script>
|
|
<call function="'addAnEntry'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'DNToAdd' : 'cn=child_staticgroup,dc=groups,%s' % DIRECTORY_INSTANCE_SFX,
|
'listAttributes' : listAttr,
|
'expectedRC' : 0
|
}
|
</call>
|
|
|
<!-- Add a static group under DIRECTORY_INSTANCE_SFX-->
|
<script>
|
listAttr = []
|
listAttr.append('objectclass:top')
|
listAttr.append('objectclass:groupofuniquenames')
|
listAttr.append('description:this is the description of top_staticgroup on top ')
|
listAttr.append('cn:top_staticgroup')
|
listAttr.append('uniqueMember:cn=user01,%s' % DIRECTORY_INSTANCE_SFX)
|
listAttr.append('uniqueMember:cn=user02,%s' % DIRECTORY_INSTANCE_SFX)
|
listAttr.append('uniqueMember:cn=user03,%s' % DIRECTORY_INSTANCE_SFX)
|
listAttr.append('uniqueMember:cn=user04,%s' % DIRECTORY_INSTANCE_SFX)
|
listAttr.append('uniqueMember:cn=user05,%s' % DIRECTORY_INSTANCE_SFX)
|
listAttr.append('uniqueMember:cn=user06,%s' % DIRECTORY_INSTANCE_SFX)
|
listAttr.append('uniqueMember:cn=user07,%s' % DIRECTORY_INSTANCE_SFX)
|
</script>
|
|
<call function="'addAnEntry'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'DNToAdd' : 'cn=top_staticgroup,%s' % DIRECTORY_INSTANCE_SFX,
|
'listAttributes' : listAttr,
|
'expectedRC' : 0
|
}
|
</call>
|
|
<!-- Check the group configuration -->
|
<call function="'SearchObject'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'dsBaseDN' : 'cn=top_staticgroup,%s' % DIRECTORY_INSTANCE_SFX,
|
'dsFilter' : 'objectclass=groupOfUniqueNames' ,
|
'attributes' : 'uniqueMember',
|
'expectedRC' : 0 }
|
</call>
|
|
|
<script>
|
returnString = STAXResult[0][1]
|
</script>
|
<call function="'searchStringForSubstring'">
|
{ 'returnString' : returnString ,
|
'testString' : 'uniqueMember',
|
'expectedResult' : '1' }
|
</call>
|
|
<!-- Check the group configuration -->
|
<call function="'SearchObject'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'dsBaseDN' : 'cn=child_staticgroup,dc=groups,%s' % DIRECTORY_INSTANCE_SFX,
|
'dsFilter' : 'objectclass=groupOfUniqueNames' ,
|
'attributes' : 'uniqueMember',
|
'expectedRC' : 0 }
|
</call>
|
|
|
<script>
|
returnString = STAXResult[0][1]
|
</script>
|
<call function="'searchStringForSubstring'">
|
{ 'returnString' : returnString ,
|
'testString' : 'uniqueMember',
|
'expectedResult' : '1' }
|
</call>
|
|
|
<message>'###### Activate the referential integrity 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' : 'Referential Integrity',
|
'optionsString' : '--set enabled:true',
|
'expectedRC' : 0 }
|
</call>
|
|
<call function="'testCase_Postamble'"/>
|
</sequence>
|
</testcase>
|
|
|
<!--
|
#@TestMarker Plugin referential integrity on groups
|
#@TestName Referential check is limited to the scope
|
#@TestPurpose Check the referential integrity check is limited to the specified scope
|
#@TestPreamble none
|
#@TestStep Set the base-dn to dc=groups,dc=com
|
#@TestStep Delete the user06
|
#@TestStep The reference must be limited to the scope dc=groups,dc=com
|
#@TestStep The references to the delete user must be removed under cn=child_staticgroup,dc=group,dc=com
|
#@TestStep The references to the delete user must still be present under cn=top_staticgroup,dc=com
|
#@TestPostamble none
|
#@TestResult all steps must be success
|
-->
|
|
|
<testcase name="getTestCaseName('Check the change of the base-dn attribute')">
|
<sequence>
|
<call function="'testCase_Preamble'"/>
|
|
<message>'###### Set the base-dn to dc=groups,%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' : 'Referential Integrity',
|
'optionsString' : '--set base-dn:dc=groups,%s' % DIRECTORY_INSTANCE_SFX,
|
'expectedRC' : 0 }
|
</call>
|
|
<call function="'dsconfigGet'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
|
'objectName' : 'plugin',
|
'propertyType' : 'plugin',
|
'propertyName' : 'Referential Integrity',
|
'attributeName' : 'base-dn'
|
}
|
</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=user06,%s' % (DIRECTORY_INSTANCE_SFX),
|
}
|
</call>
|
|
<!-- Check the new configuration is applied -->
|
<message>'The reference check must be limited to the scope dc=groups,dc=com'</message>
|
<message>' '</message>
|
|
<message>'The reference check must be done to the base DN dc=groups,dc=com'</message>
|
<call function="'SearchObject'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'dsBaseDN' : 'cn=child_staticgroup,dc=groups,%s' % 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 removed' </message>
|
<call function="'searchStringForSubstring'">
|
{ 'returnString' : returnString ,
|
'testString' : 'user06',
|
'expectedResult' : '0' }
|
</call>
|
|
<message>'The reference check must not be done to the base DN dc=com'</message>
|
|
<call function="'SearchObject'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'dsBaseDN' : 'cn=top_staticgroup,%s' % 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' : 'user06',
|
'expectedResult' : '1' }
|
</call>
|
|
<message>'###### Reset the base-dn ###### '</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' : 'Referential Integrity',
|
'optionsString' : '--reset base-dn',
|
'expectedRC' : 0 }
|
</call>
|
|
|
<call function="'testCase_Postamble'"/>
|
</sequence>
|
</testcase>
|
|
|
<!--
|
#@TestMarker Plugin referential integrity on groups
|
#@TestName The referential integrity plugin removes only references to deleted entries
|
#@TestPurpose Check the referential integrity plugin removes only references to deleted entries
|
#@TestPreamble none
|
#@TestStep Delete a user
|
#@TestStep Check that the references to the deleted user are gone.
|
#@TestStep Check that there is no impact on the others references.
|
#@TestStep The references to an existing user must still be present.
|
#@TestPostamble none
|
#@TestResult all steps must be success
|
-->
|
|
|
<testcase name="getTestCaseName('The referential integrity plugin removes only references to deleted entries')">
|
<sequence>
|
<call function="'testCase_Preamble'"/>
|
|
<message>'###### Delete an user entry###### '</message>
|
<message>' '</message>
|
|
<!-- Delete an entry -->
|
<call function="'DeleteEntry'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'dsBaseDN' : 'cn=user01,%s' % (DIRECTORY_INSTANCE_SFX),
|
}
|
</call>
|
|
|
<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>'references to the delete user must be gone ' </message>
|
<call function="'searchStringForSubstring'">
|
{ 'returnString' : returnString ,
|
'testString' : 'user01',
|
'expectedResult' : '0' }
|
</call>
|
|
<message>'references to an existing user must be still present' </message>
|
<call function="'searchStringForSubstring'">
|
{ 'returnString' : returnString ,
|
'testString' : 'user02',
|
'expectedResult' : '1' }
|
</call>
|
|
<call function="'testCase_Postamble'"/>
|
</sequence>
|
</testcase>
|
|
<!--
|
#@TestMarker Plugin referential integrity on groups
|
#@TestName The referential integrity is checked on the specified attribut-type
|
#@TestPurpose Check the referential integrity is checked on the specified attribut-type
|
#@TestPreamble none
|
#@TestStep Remove the attribute uniquemember from the list of attribute-type
|
#@TestStep Delete a user entry
|
#@TestStep Check that the references to the deleted user are still present
|
#@TestStep Restore the attribute uniquemember from the list of attribute-type
|
#@TestPostamble none
|
#@TestResult all steps must be success
|
-->
|
|
|
<testcase name="getTestCaseName('Check the referential integrity is checked on the specified attribut-type')">
|
<sequence>
|
<call function="'testCase_Preamble'"/>
|
|
<message>'###### Remove the attribute uniquemember from the list of attribute-type ###### '</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' : 'Referential Integrity',
|
'optionsString' : '--remove attribute-type:uniquemember',
|
'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=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,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'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>
|
|
<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,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'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>
|
|
<!-- plugin-type attribute is not dynamic. Need to restart the server -->
|
<call function="'StopDsWithScript'">
|
{ 'location' : STAF_REMOTE_HOSTNAME,
|
'dsHost' : DIRECTORY_INSTANCE_HOST,
|
'dsPort' : DIRECTORY_INSTANCE_PORT,
|
'dsBindDN' : DIRECTORY_INSTANCE_DN,
|
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD,
|
'dsRestart' : ' ' }
|
</call>
|
|
<!--- Check that DS started -->
|
<call function="'isAlive'">
|
{ 'noOfLoops' : 5 ,
|
'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,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'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>
|
|
<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,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'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,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'subcommand' : 'set-plugin-prop' ,
|
'objectType' : 'plugin-name' ,
|
'objectName' : 'Referential Integrity',
|
'optionsString' : '--set attribute-type:uniquemember --set attribute-type:member',
|
'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>
|
|
<call function="'testSuite_Postamble'" />
|
</sequence>
|
</block>
|
</function>
|
</stax>
|