plugins_lastmod.xml revision d25372dc8e65a9ed019a88fdf659ca61313f1b31
<?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_lastmod"/>
<function name="plugins_lastmod" scope="local">
<block name="STAXCurrentFunction">
<sequence>
<script>
CurrentTestPath['suite']=STAXCurrentFunction
</script>
<call function="'testSuite_Preamble'" />
<testcase name="getTestCaseName('Plugins lastmod enabled for add operations')">
<sequence>
<call function="'testCase_Preamble'"/>
<!-- 3Add an entry -->
<!-- Execute ldapsearch request to get createTimestamp attribute -->
<!-- Add an entry -->
<message>'###### Add an entry ###### '</message>
<script>
listAttr = []
listAttr.append('objectclass:top')
listAttr.append('objectclass:organizationalperson')
listAttr.append('objectclass:inetorgperson')
listAttr.append('objectclass:person')
listAttr.append('givenname:testuser_lastmod_enabled')
listAttr.append('sn:testuser_lastmod_enabled')
listAttr.append('cn:testuser_lastmod_enabled')
listAttr.append('mail:testuser_lastmod_enabled')
</script>
<call function="'addAnEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'DNToAdd' : 'uid=testuser_lastmod_enabled,%s' % DIRECTORY_INSTANCE_SFX,
'listAttributes' : listAttr,
'expectedRC' : 0
}
</call>
<message>'###### Check the plugin lastmod ###### '</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsBaseDN' : 'uid=testuser_lastmod_enabled,%s' % DIRECTORY_INSTANCE_SFX,
'dsFilter' : 'objectclass=*' ,
'dsScope' : 'base',
'attributes' : 'createTimestamp',
'expectedRC' : 0 }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<!-- the attribute must not be returned -->
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'createTimestamp',
'expectedResult' : '1' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!---
#@TestMarker Plugin lastmod Tests
#@TestName Plugins lastmod enabled for modify operation
#@TestIssue Check the plugin lastmod for modify operations
#@TestPreamble none
#@TestStep Modify an entry
#@TestStep Execute ldapsearch request to get modifyTimestamp attribute
#@TestPostamble none
#@TestResult The test is passed if the attribute modifyTimestamp is returned
-->
<testcase name="getTestCaseName('Plugins lastmod enabled for modify operations')">
<sequence>
<call function="'testCase_Preamble'"/>
<!-- Modify an entry -->
<message>'###### Modify an entry ###### '</message>
<call function="'modifyAnAttribute'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'DNToModify' : 'uid=testuser_lastmod_enabled,%s' % DIRECTORY_INSTANCE_SFX,
'attributeName' : 'description',
'newAttributeValue' : 'lastmod plugin for modify operations',
'changetype' : 'add',
'expectedRC' : 0 }
</call>
<message>'###### Check the plugin lastmod ###### '</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsBaseDN' : 'uid=testuser_lastmod_enabled,%s' % DIRECTORY_INSTANCE_SFX,
'dsFilter' : 'objectclass=*' ,
'dsScope' : 'base',
'attributes' : 'modifyTimestamp',
'expectedRC' : 0 }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<!-- the attribute must be returned -->
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'modifyTimestamp',
'expectedResult' : '1' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!---
#@TestMarker Plugin lastmod Tests
#@TestName Plugins lastmod disabled for add operations
#@TestPurpose Disable the plugin lastmod for add operations
#@TestPreamble none
#@TestStep Disable the plugin lastmod
#@TestStep Add an entry
#@TestStep Execute ldapsearch request to get createTimestamp attribute
#@TestPostamble none
#@TestResult The test is passed if the attribute createTimestamp is not returned
-->
<testcase name="getTestCaseName('Plugins lastmod disabled for add operations')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>'-- Disable the lastmod plugin --'</message>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-plugin-prop' ,
'objectType' : 'plugin-name' ,
'objectName' : 'LastMod',
'optionsString' : '--set enabled:false',
'expectedRC' : 0 }
</call>
<!-- Add an entry -->
<message>'###### Add an entry ###### '</message>
<script>
listAttr = []
listAttr.append('objectclass:top')
listAttr.append('objectclass:organizationalperson')
listAttr.append('objectclass:inetorgperson')
listAttr.append('objectclass:person')
listAttr.append('givenname:testuser_lastmod_disabled')
listAttr.append('sn:testuser_lastmod_disabled')
listAttr.append('cn:testuser_lastmod_disabled')
listAttr.append('mail:testuser_lastmod_disabled')
</script>
<call function="'addAnEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'DNToAdd' : 'uid=testuser_lastmod_disabled,%s' % DIRECTORY_INSTANCE_SFX,
'listAttributes' : listAttr,
'expectedRC' : 0
}
</call>
<message>'###### Check the plugin lastmod ###### '</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsBaseDN' : 'uid=testuser_lastmod_disabled,%s' % DIRECTORY_INSTANCE_SFX,
'dsFilter' : 'objectclass=*' ,
'dsScope' : 'base',
'attributes' : 'createTimestamp',
'expectedRC' : 0 }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<!-- the attribute must not be returned -->
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'createTimestamp',
'expectedResult' : '0' }
</call>
<message>'###### Cleanup ###### '</message>
<message>'-- Enable the lastmod plugin --'</message>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-plugin-prop' ,
'objectType' : 'plugin-name' ,
'objectName' : 'LastMod',
'optionsString' : '--set enabled:true',
'expectedRC' : 0 }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!---
#@TestMarker Plugin lastmod Tests
#@TestName Plugins lastmod disabled for modify operations
#@TestPurpose Disable the plugin lastmod for modify operations
#@TestPreamble none
#@TestStep Disable the plugin lastmod
#@TestStep modify an entry
#@TestStep Execute ldapsearch request to get modifyTimestamp attribute
#@TestPostamble none
#@TestResult The test is passed if the attribute modifyTimestamp is not returned
-->
<testcase name="getTestCaseName('Plugins lastmod disabled for modify operations')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>'-- Disable the lastmod plugin --'</message>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-plugin-prop' ,
'objectType' : 'plugin-name' ,
'objectName' : 'LastMod',
'optionsString' : '--set enabled:false',
'expectedRC' : 0 }
</call>
<!-- Modify an entry -->
<message>'###### Modify an entry ###### '</message>
<call function="'modifyAnAttribute'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'DNToModify' : 'uid=testuser_lastmod_disabled,%s' % DIRECTORY_INSTANCE_SFX,
'attributeName' : 'description',
'newAttributeValue' : 'lastmod plugin for modify operations',
'changetype' : 'add',
'expectedRC' : 0 }
</call>
<message>'###### Check the plugin lastmod ###### '</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsBaseDN' : 'uid=testuser_lastmod_disabled,%s' % DIRECTORY_INSTANCE_SFX,
'dsFilter' : 'objectclass=*' ,
'dsScope' : 'base',
'attributes' : 'modifyTimestamp',
'expectedRC' : 0 }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<!-- the attribute must not be returned -->
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'modifyTimestamp',
'expectedResult' : '0' }
</call>
<message>'###### Cleanup ###### '</message>
<message>'-- Enable the lastmod plugin --'</message>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-plugin-prop' ,
'objectType' : 'plugin-name' ,
'objectName' : 'LastMod',
'optionsString' : '--set enabled:true',
'expectedRC' : 0 }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!---
#@TestMarker Plugin lastmod Tests
#@TestName Plugin lastmod 4
#@TestPurpose Cleanup
#@TestPreamble none
#@TestStep Delete entries
#@TestPostamble none
#@TestResult The test is passed if the entries are deleted
-->
<testcase name="getTestCaseName('Plugins lastmod - cleanup')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>'-- Delete the test entry --'</message>
<call function="'DeleteEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsBaseDN' : 'uid=testuser_lastmod_disabled,%s' % DIRECTORY_INSTANCE_SFX,
}
</call>
<call function="'DeleteEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsBaseDN' : 'uid=testuser_lastmod_enabled,%s' % DIRECTORY_INSTANCE_SFX,
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<call function="'testSuite_Postamble'" />
</sequence>
</block>
</function>
</stax>