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