10139N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
10139N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
10139N/A<!--
10139N/A ! CDDL HEADER START
10139N/A !
10139N/A ! The contents of this file are subject to the terms of the
10139N/A ! Common Development and Distribution License, Version 1.0 only
17185N/A ! (the "License"). You may not use this file except in compliance
10139N/A ! with the License.
17180N/A !
18644N/A ! You can obtain a copy of the license at
17180N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
10139N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
10139N/A ! See the License for the specific language governing permissions
12132N/A ! and limitations under the License.
12132N/A !
10139N/A ! When distributing Covered Code, include this CDDL HEADER in each
11041N/A ! file and include the License file at
10139N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
10139N/A ! add the following below this CDDL HEADER, with the fields enclosed
10139N/A ! by brackets "[]" replaced with your own identifying information:
10139N/A ! Portions Copyright [yyyy] [name of copyright owner]
10139N/A !
10139N/A ! CDDL HEADER END
10139N/A !
10139N/A ! Copyright 2007-2009 Sun Microsystems, Inc.
10139N/A ! -->
10139N/A<stax>
10139N/A <defaultcall function="plugins_7bit"/>
16349N/A <function name="plugins_7bit" scope="local">
16349N/A <block name="STAXCurrentFunction">
16349N/A <try>
10139N/A <sequence>
10139N/A <script>
10139N/A CurrentTestPath['suite']=STAXCurrentFunction
10139N/A </script>
10139N/A <call function="'testSuite_Preamble'" />
10139N/A
10139N/A <call function="'common_setup'">
10139N/A {
10139N/A 'quickStart' : True ,
10139N/A 'startServer' : True ,
10139N/A 'stopServer' : False
10139N/A }
10139N/A </call>
16349N/A
10139N/A <!--- Test Suite information
10139N/A #@TestSuiteName Plugin 7bit
10139N/A #@TestSuitePurpose Verify the plugin 7bit
10139N/A #@TestSuiteID Plugins
10139N/A #@TestSuiteGroup Plugins
10139N/A #@TestGroup Plugins
10139N/A #@TestScript plugins_7bit.xml
10139N/A #@TestHTMLLink http://opends.dev.java.net/
10139N/A -->
10139N/A
10139N/A <!---
10139N/A #@TestMarker Plugin 7bit
10139N/A #@TestName Plugin 7bit setup
10139N/A #@TestPurpose Plugins 7bit setup
11137N/A #@TestPreamble none
12773N/A #@TestStep enable the 7-bit plugin
12773N/A #@TestPostamble none
12773N/A #@TestResult none
10139N/A -->
10139N/A
10139N/A <testcase name="getTestCaseName('Plugins 7-Bit Clean setup')">
10668N/A <sequence>
10668N/A <call function="'testCase_Preamble'"/>
10668N/A
10668N/A <message>'-- Enable the plugin 7-Bit Clean --'</message>
10139N/A <call function="'dsconfig'">
10139N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
10139N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
10139N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
10139N/A 'subcommand' : 'set-plugin-prop' ,
10139N/A 'objectType' : 'plugin-name',
10139N/A 'objectName' : '7-Bit Clean',
10139N/A 'optionsString' : '--set enabled:true',
10139N/A 'expectedRC' : 0 }
10139N/A </call>
10139N/A
10139N/A <call function="'testCase_Postamble'"/>
10139N/A </sequence>
10139N/A </testcase>
10668N/A
10668N/A
10668N/A <!---
10139N/A #@TestMarker Plugin 7bit
10139N/A #@TestName Plugin 7bit with default attribute-type
10139N/A #@TestPurpose Check the server behavior when the plugin 7bit is activated
10139N/A #@TestPreamble none
10139N/A #@TestStep Enable the plugin 7bit
10139N/A #@TestStep Add an entry with a userPassword containing a non-ASCII
10139N/A character
10139N/A #@TestPostamble none
10139N/A #@TestResult The test is passed if the add operation is rejected
10139N/A -->
10139N/A
10139N/A <testcase name="getTestCaseName('Plugins 7bit Clean with default attribute-type')">
10139N/A <sequence>
10139N/A <call function="'testCase_Preamble'"/>
10139N/A
10139N/A <message>'###### Add an entry ###### '</message>
10139N/A <!-- Add an entry -->
10139N/A <script>
10139N/A listAttr = []
10139N/A listAttr.append('objectclass:top')
10139N/A listAttr.append('objectclass:organizationalperson')
10139N/A listAttr.append('objectclass:inetorgperson')
10139N/A listAttr.append('objectclass:person')
16349N/A listAttr.append('givenname:testuser_7bit')
16349N/A listAttr.append('sn:testuser_7bit')
11137N/A listAttr.append('cn:testuser_7bit')
11137N/A listAttr.append('mail:testuser_7bit')
10668N/A listAttr.append('userPassword:342à')
10668N/A </script>
10668N/A
10668N/A <call function="'addAnEntry'">
10139N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
10139N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
10139N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
10139N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
10139N/A 'DNToAdd' : 'uid=testuser_7bit,%s' % DIRECTORY_INSTANCE_SFX,
10139N/A 'listAttributes' : listAttr,
10139N/A 'expectedRC' : 19
10139N/A }
10139N/A </call>
10139N/A
10139N/A <!-- Cleanup -->
10139N/A <message>'###### Cleanup ###### '</message>
10139N/A <message>'-- Delete the test entry --'</message>
10139N/A <call function="'DeleteEntry'">
10139N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
10139N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
10139N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
10139N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
10139N/A 'dsBaseDN' : 'uid=testuser_7bit,%s' % DIRECTORY_INSTANCE_SFX,
10139N/A 'expectedRC' : 'noCheck'
10139N/A }
10139N/A </call>
10139N/A
10139N/A <call function="'testCase_Postamble'"/>
10139N/A </sequence>
10139N/A </testcase>
10139N/A
10139N/A
10139N/A <!---
10139N/A #@TestMarker Plugin 7bit
10139N/A #@TestName Plugin 7bit with a new attribute-type
10139N/A #@TestPurpose Check the serve behavior when the plugin 7bit is checked on a new attribut-type
10139N/A #@TestPreamble none
10139N/A #@TestStep set a new attribut-type to the attribut street
10139N/A #@TestStep Add an entry with the attribut street containing a non-ASCII character
10139N/A #@TestPostamble none
10139N/A #@TestResult The test is passed if the add operation is rejected
10139N/A -->
10139N/A
10139N/A <testcase name="getTestCaseName('Plugins 7bit Clean with a new attribute-type')">
10139N/A <sequence>
10139N/A <call function="'testCase_Preamble'"/>
10139N/A
10139N/A <message>'-- configure a new attribute-type for the plugin 7-Bit --'</message>
10139N/A <call function="'dsconfig'">
10139N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
10139N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-plugin-prop' ,
'objectType' : 'plugin-name',
'objectName' : '7-Bit Clean',
'optionsString' : '--add attribute-type:street',
'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_7bit')
listAttr.append('sn:testuser_7bit')
listAttr.append('cn:testuser_7bit')
listAttr.append('mail:testuser_7bit')
listAttr.append('street:342à')
listAttr.append('userPassword:342')
</script>
<call function="'addAnEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'DNToAdd' : 'uid=testuser_7bit,%s' % DIRECTORY_INSTANCE_SFX,
'listAttributes' : listAttr,
'expectedRC' : 19
}
</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_7bit,%s' % DIRECTORY_INSTANCE_SFX,
'expectedRC' : 'noCheck'
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!---
#@TestMarker Plugin 7bit
#@TestName disable Plugin 7bit
#@TestPurpose Check the server behavior when the plugin 7bit is disabled
#@TestPreamble none
#@TestStep Disable the plugin 7-bit clean
#@TestStep Add an entry with the attribut street containing a non-ASCII character
#@TestPostamble none
#@TestResult The test is passed if the add operation is accepted
-->
<testcase name="getTestCaseName('Plugins 7bit Clean is disabled')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>'-- disable the plugin 7-Bit Clean --'</message>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-plugin-prop' ,
'objectType' : 'plugin-name',
'objectName' : '7-Bit Clean',
'optionsString' : '--set enabled:false',
'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_7bit')
listAttr.append('sn:testuser_7bit')
listAttr.append('cn:testuser_7bit')
listAttr.append('mail:testuser_7bit')
listAttr.append('street:342à')
listAttr.append('userPassword:342')
</script>
<call function="'addAnEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'DNToAdd' : 'uid=testuser_7bit,%s' % DIRECTORY_INSTANCE_SFX,
'listAttributes' : listAttr,
'expectedRC' : 0
}
</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_7bit,%s' % DIRECTORY_INSTANCE_SFX,
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
</sequence>
<finally>
<sequence>
<!-- Test Suite Cleanup -->
<message>'Finally: Global 7 Bit 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>