<?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
|
!
|
! Portions Copyright 2006-2007 Sun Microsystems, Inc.
|
! -->
|
<stax>
|
<defaultcall function="plugins_entryUUID"/>
|
<function name="plugins_entryUUID" scope="local">
|
<block name="STAXCurrentFunction">
|
<sequence>
|
<script>
|
CurrentTestPath['suite']=STAXCurrentFunction
|
</script>
|
<call function="'testSuite_Preamble'" />
|
|
|
<!---
|
#@TestMarker Plugin entryUUID
|
#@TestName Plugin entryUUID
|
#@TestIssue Check the plugin entryUUID
|
#@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 setup')">
|
<sequence>
|
<call function="'testCase_Preamble'"/>
|
|
<message>'-- Disable the virtual attribute entryUUID --'</message>
|
<call function="'dsconfig'">
|
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
|
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
|
'subcommand' : 'set-virtual-attribute-prop' ,
|
'objectType' : 'attribute-name',
|
'objectName' : 'entryUUID',
|
'optionsString' : '--set enabled:false',
|
'expectedRC' : 0 }
|
</call>
|
|
<call function="'testCase_Postamble'"/>
|
</sequence>
|
</testcase>
|
|
|
<!---
|
#@TestMarker Plugin entryUUID
|
#@TestName Plugin entryUUID
|
#@TestIssue Check the plugin entryUUID
|
#@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,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'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,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'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
|
#@TestIssue Check the plugin entryUUID
|
#@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,
|
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
|
'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>
|
|
<call function="'testSuite_Postamble'" />
|
</sequence>
|
</block>
|
</function>
|
</stax>
|