<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
! 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 legal-notices/CDDLv1_0.txt
! 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 legal-notices/CDDLv1_0.txt.
! 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-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="plugins_entryUUID"/>
<function name="plugins_entryUUID" scope="local">
<block name="STAXCurrentFunction">
<try>
<sequence>
<script>
CurrentTestPath['suite']=STAXCurrentFunction
</script>
<call function="'testSuite_Preamble'" />
<call function="'common_setup'">
{
'quickStart' : True ,
'startServer' : True ,
'stopServer' : False
}
</call>
<!--- Test Suite information
#@TestSuiteName Plugin entryUUID
#@TestSuitePurpose Verify the plugin entryUUID
#@TestSuiteID Plugins
#@TestSuiteGroup Plugins
#@TestGroup Plugins
#@TestScript plugins_entryUUID.xml
#@TestHTMLLink http://opends.dev.java.net/
-->
<!---
#@TestMarker Plugin entryUUID
#@TestName Plugin entryUUID setup
#@TestPurpose Plugins entryUUID setup
#@TestPreamble none
#@TestStep Disable the virtual attribute entryUUID
#@TestPostamble none
#@TestResult none
-->
<testcase name="getTestCaseName('Plugins entryUUID setup')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>'-- Disable the virtual attribute entryUUID --'</message>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-virtual-attribute-prop' ,
'objectType' : 'name',
'objectName' : 'entryUUID',
'optionsString' : '--set enabled:false',
'expectedRC' : 0 }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!---
#@TestMarker Plugin entryUUID
#@TestName Plugin entryUUID enable
#@TestPurpose Check the serve behavior when the plugin entryUUID is activated
#@TestPreamble none
#@TestStep Enable the plugin entryUUID
#@TestStep Disable the virtual attribute entryUUID
#@TestStep Add an entry
#@TestStep Execute ldapsearch request to get entryUUID attribute
#@TestPostamble none
#@TestResult The test is passed if the attribute entryUUID is returned
-->
<testcase name="getTestCaseName('Plugins entryUUID enable')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>'-- Activate the entryUUID 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' : 'Entry UUID',
'optionsString' : '--set enabled:true',
'expectedRC' : 0 }
</call>
<message>'###### Add an entry ###### '</message>
<!-- Add an entry -->
<script>
listAttr = []
listAttr.append('objectclass:top')
listAttr.append('objectclass:organizationalperson')
listAttr.append('objectclass:inetorgperson')
listAttr.append('objectclass:person')
listAttr.append('givenname:testuser_entryuuid')
listAttr.append('sn:testuser_entryuuid')
listAttr.append('cn:testuser_entryuuid')
listAttr.append('mail:testuser_entryuuid')
</script>
<call function="'addAnEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'DNToAdd' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
'listAttributes' : listAttr,
'expectedRC' : 0
}
</call>
<!-- Check the plugin -->
<message>'###### Check the plugin entryUUID ###### '</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsBaseDN' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
'dsFilter' : 'objectclass=*' ,
'dsScope' : 'base',
'attributes' : 'entryUUID',
'expectedRC' : 0 }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString,
'testString' : 'entryUUID',
'expectedResult' : '1' }
</call>
<!-- Cleanup -->
<message>'###### Cleanup ###### '</message>
<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_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
}
</call>
<message>'-- Disable the entryUUID 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' : 'Entry UUID',
'optionsString' : '--set enabled:false',
'expectedRC' : 0 }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!---
#@TestMarker Plugin entryUUID
#@TestName Plugin entryUUID disable
#@TestPurpose Check the server behavior when the plugin entryUUID is disabled
#@TestPreamble none
#@TestStep Disable the plugin entryUUID
#@TestStep Disable the virtual attribute entryUUID
#@TestStep Add an entry
#@TestStep Execute ldapsearch request to get entryUUID attribute
#@TestPostamble none
#@TestResult The test is passed if the attribute entryUUID is not returned
-->
<testcase name="getTestCaseName('Plugins entryUUID disable')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>'-- Disable the entryUUID 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' : 'Entry UUID',
'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_entryuuid')
listAttr.append('sn:testuser_entryuuid')
listAttr.append('cn:testuser_entryuuid')
listAttr.append('mail:testuser_entryuuid')
</script>
<call function="'addAnEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'DNToAdd' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
'listAttributes' : listAttr,
'expectedRC' : 0
}
</call>
<!-- The plugin is disabled. the attribute entryUUID should not be returned -->
<message>'###### Check the plugin entryUUID ###### '</message>
<call function="'SearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsBaseDN' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
'dsFilter' : 'objectclass=*' ,
'dsScope' : 'base',
'attributes' : 'entryUUID',
'expectedRC' : 0 }
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString ,
'testString' : 'entryUUID',
'expectedResult' : '0' }
</call>
<message>'###### Cleanup ###### '</message>
<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_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
</sequence>
<finally>
<sequence>
<!-- Test Suite Cleanup -->
<message>'Finally: Global UUID 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>