plugins_entryUUID.xml revision 4618
2788N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2788N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
2788N/A<!--
2788N/A ! CDDL HEADER START
2788N/A !
2788N/A ! The contents of this file are subject to the terms of the
2788N/A ! Common Development and Distribution License, Version 1.0 only
2788N/A ! (the "License"). You may not use this file except in compliance
2788N/A ! with the License.
2788N/A !
2788N/A ! You can obtain a copy of the license at
2788N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
2788N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
2788N/A ! See the License for the specific language governing permissions
2788N/A ! and limitations under the License.
2788N/A !
2788N/A ! When distributing Covered Code, include this CDDL HEADER in each
2788N/A ! file and include the License file at
2788N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
2788N/A ! add the following below this CDDL HEADER, with the fields enclosed
2788N/A ! by brackets "[]" replaced with your own identifying information:
2788N/A ! Portions Copyright [yyyy] [name of copyright owner]
2788N/A !
2788N/A ! CDDL HEADER END
2788N/A !
3215N/A ! Copyright 2007-2009 Sun Microsystems, Inc.
2788N/A ! -->
2788N/A<stax>
2788N/A <defaultcall function="plugins_entryUUID"/>
2788N/A <function name="plugins_entryUUID" scope="local">
2788N/A <block name="STAXCurrentFunction">
2788N/A <try>
2788N/A <sequence>
2788N/A <script>
2788N/A CurrentTestPath['suite']=STAXCurrentFunction
2788N/A </script>
2788N/A <call function="'testSuite_Preamble'" />
2788N/A
2788N/A <call function="'common_setup'">
4153N/A {
2788N/A 'quickStart' : True ,
2788N/A 'startServer' : True ,
2788N/A 'stopServer' : False
2788N/A }
2788N/A </call>
2788N/A
2788N/A <!--- Test Suite information
2788N/A #@TestSuiteName Plugin entryUUID
2788N/A #@TestSuitePurpose Verify the plugin entryUUID
2788N/A #@TestSuiteID Plugins
2788N/A #@TestSuiteGroup Plugins
2788N/A #@TestGroup Plugins
2788N/A #@TestScript plugins_entryUUID.xml
2788N/A #@TestHTMLLink http://opends.dev.java.net/
2788N/A -->
2788N/A
2788N/A
2788N/A <!---
2788N/A #@TestMarker Plugin entryUUID
2788N/A #@TestName Plugin entryUUID setup
2788N/A #@TestPurpose Plugins entryUUID setup
2788N/A #@TestPreamble none
2788N/A #@TestStep Disable the virtual attribute entryUUID
2788N/A #@TestPostamble none
2788N/A #@TestResult none
2788N/A -->
2788N/A
2788N/A <testcase name="getTestCaseName('Plugins entryUUID setup')">
2788N/A <sequence>
2788N/A <call function="'testCase_Preamble'"/>
2788N/A
2788N/A <message>'-- Disable the virtual attribute entryUUID --'</message>
2788N/A <call function="'dsconfig'">
2788N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
2788N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
2788N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
2788N/A 'subcommand' : 'set-virtual-attribute-prop' ,
2788N/A 'objectType' : 'name',
2788N/A 'objectName' : 'entryUUID',
2788N/A 'optionsString' : '--set enabled:false',
2788N/A 'expectedRC' : 0 }
2788N/A </call>
2788N/A
2788N/A <call function="'testCase_Postamble'"/>
3194N/A </sequence>
2788N/A </testcase>
2949N/A
2949N/A
2998N/A <!---
2949N/A #@TestMarker Plugin entryUUID
2950N/A #@TestName Plugin entryUUID enable
2949N/A #@TestPurpose Check the serve behavior when the plugin entryUUID is activated
2949N/A #@TestPreamble none
2949N/A #@TestStep Enable the plugin entryUUID
3951N/A #@TestStep Disable the virtual attribute entryUUID
3951N/A #@TestStep Add an entry
3951N/A #@TestStep Execute ldapsearch request to get entryUUID attribute
3951N/A #@TestPostamble none
3951N/A #@TestResult The test is passed if the attribute entryUUID is returned
3951N/A -->
2788N/A
2788N/A <testcase name="getTestCaseName('Plugins entryUUID enable')">
2788N/A <sequence>
2788N/A <call function="'testCase_Preamble'"/>
2788N/A
2788N/A <message>'-- Activate the entryUUID plugin --'</message>
2788N/A <call function="'dsconfig'">
2788N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
2788N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
2788N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
2788N/A 'subcommand' : 'set-plugin-prop' ,
2788N/A 'objectType' : 'plugin-name' ,
2788N/A 'objectName' : 'Entry UUID',
2788N/A 'optionsString' : '--set enabled:true',
2788N/A 'expectedRC' : 0 }
2788N/A </call>
2788N/A
2788N/A
2788N/A <message>'###### Add an entry ###### '</message>
2788N/A <!-- Add an entry -->
2788N/A <script>
2788N/A listAttr = []
2788N/A listAttr.append('objectclass:top')
2788N/A listAttr.append('objectclass:organizationalperson')
2788N/A listAttr.append('objectclass:inetorgperson')
2788N/A listAttr.append('objectclass:person')
2788N/A listAttr.append('givenname:testuser_entryuuid')
2788N/A listAttr.append('sn:testuser_entryuuid')
2788N/A listAttr.append('cn:testuser_entryuuid')
2788N/A listAttr.append('mail:testuser_entryuuid')
2788N/A </script>
2788N/A
2949N/A
2949N/A <call function="'addAnEntry'">
2949N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
2949N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
3951N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
3951N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
2788N/A 'DNToAdd' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
2788N/A 'listAttributes' : listAttr,
2788N/A 'expectedRC' : 0
3194N/A }
2788N/A </call>
2788N/A
2788N/A
2788N/A <!-- Check the plugin -->
2788N/A <message>'###### Check the plugin entryUUID ###### '</message>
2788N/A <call function="'SearchObject'">
2788N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
2788N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
2788N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
2788N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
2788N/A 'dsBaseDN' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
2788N/A 'dsFilter' : 'objectclass=*' ,
2788N/A 'dsScope' : 'base',
2788N/A 'attributes' : 'entryUUID',
2788N/A 'expectedRC' : 0 }
2788N/A </call>
2788N/A
4153N/A <script>
2788N/A returnString = STAXResult[0][1]
2788N/A </script>
2788N/A
2788N/A <call function="'searchStringForSubstring'">
2788N/A { 'returnString' : returnString,
2788N/A 'testString' : 'entryUUID',
2788N/A 'expectedResult' : '1' }
3847N/A </call>
2788N/A
2788N/A
2788N/A <!-- Cleanup -->
2788N/A <message>'###### Cleanup ###### '</message>
2788N/A <message>'-- Delete the test entry --'</message>
2788N/A <call function="'DeleteEntry'">
2788N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
2788N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
2788N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
2788N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
2788N/A 'dsBaseDN' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
2788N/A }
2788N/A </call>
2788N/A
2788N/A <message>'-- Disable the entryUUID plugin --'</message>
2788N/A <call function="'dsconfig'">
2788N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
2788N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
2788N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
2788N/A 'subcommand' : 'set-plugin-prop' ,
2788N/A 'objectType' : 'plugin-name' ,
2788N/A 'objectName' : 'Entry UUID',
2788N/A 'optionsString' : '--set enabled:false',
2788N/A 'expectedRC' : 0 }
2788N/A </call>
2788N/A <call function="'testCase_Postamble'"/>
2788N/A </sequence>
2788N/A </testcase>
2788N/A
2788N/A <!---
2788N/A #@TestMarker Plugin entryUUID
2788N/A #@TestName Plugin entryUUID disable
2788N/A #@TestPurpose Check the server behavior when the plugin entryUUID is disabled
2788N/A #@TestPreamble none
2788N/A #@TestStep Disable the plugin entryUUID
2788N/A #@TestStep Disable the virtual attribute entryUUID
2788N/A #@TestStep Add an entry
2788N/A #@TestStep Execute ldapsearch request to get entryUUID attribute
2788N/A #@TestPostamble none
2788N/A #@TestResult The test is passed if the attribute entryUUID is not returned
2788N/A -->
2788N/A
2788N/A <testcase name="getTestCaseName('Plugins entryUUID disable')">
2788N/A <sequence>
2788N/A
2788N/A <call function="'testCase_Preamble'"/>
2788N/A
2788N/A <message>'-- Disable the entryUUID plugin --'</message>
2788N/A <call function="'dsconfig'">
2788N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
2788N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
2788N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
2788N/A 'subcommand' : 'set-plugin-prop' ,
2788N/A 'objectType' : 'plugin-name' ,
2788N/A 'objectName' : 'Entry UUID',
2788N/A 'optionsString' : '--set enabled:false',
2788N/A 'expectedRC' : 0 }
2788N/A </call>
2788N/A
2788N/A
2788N/A <!-- Add an entry -->
2788N/A <message>'###### Add an entry ###### '</message>
2788N/A <script>
2788N/A listAttr = []
2788N/A listAttr.append('objectclass:top')
2788N/A listAttr.append('objectclass:organizationalperson')
2788N/A listAttr.append('objectclass:inetorgperson')
2788N/A listAttr.append('objectclass:person')
2788N/A listAttr.append('givenname:testuser_entryuuid')
2788N/A listAttr.append('sn:testuser_entryuuid')
2788N/A listAttr.append('cn:testuser_entryuuid')
2788N/A listAttr.append('mail:testuser_entryuuid')
2788N/A </script>
2788N/A
2788N/A <call function="'addAnEntry'">
2788N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
2788N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
2788N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
2788N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
2788N/A 'DNToAdd' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
2788N/A 'listAttributes' : listAttr,
2788N/A 'expectedRC' : 0
2788N/A }
2788N/A </call>
2788N/A
2788N/A <!-- The plugin is disabled. the attribute entryUUID should not be returned -->
2788N/A <message>'###### Check the plugin entryUUID ###### '</message>
2788N/A <call function="'SearchObject'">
2788N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
2788N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
2788N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
2788N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
2788N/A 'dsBaseDN' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
2788N/A 'dsFilter' : 'objectclass=*' ,
2788N/A 'dsScope' : 'base',
2788N/A 'attributes' : 'entryUUID',
2788N/A 'expectedRC' : 0 }
2788N/A </call>
2788N/A
2788N/A <script>
2788N/A returnString = STAXResult[0][1]
2788N/A </script>
2788N/A <call function="'searchStringForSubstring'">
2788N/A { 'returnString' : returnString ,
2788N/A 'testString' : 'entryUUID',
2788N/A 'expectedResult' : '0' }
2788N/A </call>
2788N/A
2788N/A <message>'###### Cleanup ###### '</message>
2788N/A <message>'-- Delete the test entry --'</message>
2788N/A <call function="'DeleteEntry'">
2788N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
2788N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
2788N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
2788N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
2788N/A 'dsBaseDN' : 'uid=testuser_entryuuid,%s' % DIRECTORY_INSTANCE_SFX,
2788N/A }
2788N/A </call>
2788N/A
2788N/A <call function="'testCase_Postamble'"/>
2788N/A </sequence>
2788N/A </testcase>
2788N/A
2788N/A </sequence>
2788N/A <finally>
2788N/A <sequence>
2788N/A <!-- Test Suite Cleanup -->
2788N/A <message>'Finally: Global UUID Plugin Cleanup.'</message>
2788N/A <try>
2788N/A <call function="'common_cleanup'" />
2788N/A <catch exception="'STAFException'">
2788N/A <sequence>
2788N/A <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
2788N/A </sequence>
2788N/A </catch>
2788N/A <finally>
2788N/A <call function="'testSuite_Postamble'"/>
2788N/A </finally>
2788N/A </try>
2788N/A </sequence>
2788N/A </finally>
2788N/A
2788N/A </try>
2788N/A </block>
2788N/A </function>
2788N/A</stax>
2788N/A