3212N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
3212N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
3212N/A<!--
3212N/A ! CDDL HEADER START
3212N/A !
3212N/A ! The contents of this file are subject to the terms of the
3212N/A ! Common Development and Distribution License, Version 1.0 only
3212N/A ! (the "License"). You may not use this file except in compliance
3212N/A ! with the License.
3212N/A !
6982N/A ! You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
6982N/A ! or http://forgerock.org/license/CDDLv1.0.html.
3212N/A ! See the License for the specific language governing permissions
3212N/A ! and limitations under the License.
3212N/A !
3212N/A ! When distributing Covered Code, include this CDDL HEADER in each
6982N/A ! file and include the License file at legal-notices/CDDLv1_0.txt.
6982N/A ! If applicable, add the following below this CDDL HEADER, with the
6982N/A ! fields enclosed by brackets "[]" replaced with your own identifying
6982N/A ! information:
3212N/A ! Portions Copyright [yyyy] [name of copyright owner]
3212N/A !
3212N/A ! CDDL HEADER END
3212N/A !
4618N/A ! Copyright 2007-2009 Sun Microsystems, Inc.
3212N/A ! -->
3212N/A<stax>
3212N/A <defaultcall function="plugins_7bit"/>
3212N/A <function name="plugins_7bit" scope="local">
4618N/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'" />
3212N/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>
4618N/A
4618N/A <!--- Test Suite information
4618N/A #@TestSuiteName Plugin 7bit
4618N/A #@TestSuitePurpose Verify the plugin 7bit
4618N/A #@TestSuiteID Plugins
4618N/A #@TestSuiteGroup Plugins
4618N/A #@TestGroup Plugins
4618N/A #@TestScript plugins_7bit.xml
4618N/A #@TestHTMLLink http://opends.dev.java.net/
4618N/A -->
4618N/A
4618N/A <!---
4618N/A #@TestMarker Plugin 7bit
4618N/A #@TestName Plugin 7bit setup
4618N/A #@TestPurpose Plugins 7bit setup
4618N/A #@TestPreamble none
4618N/A #@TestStep enable the 7-bit plugin
4618N/A #@TestPostamble none
4618N/A #@TestResult none
4618N/A -->
4618N/A
4618N/A <testcase name="getTestCaseName('Plugins 7-Bit Clean setup')">
4618N/A <sequence>
4618N/A <call function="'testCase_Preamble'"/>
4618N/A
4618N/A <message>'-- Enable the plugin 7-Bit Clean --'</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' : '7-Bit Clean',
4618N/A 'optionsString' : '--set enabled:true',
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 7bit
4618N/A #@TestName Plugin 7bit with default attribute-type
4618N/A #@TestPurpose Check the server behavior when the plugin 7bit is activated
4618N/A #@TestPreamble none
4618N/A #@TestStep Enable the plugin 7bit
4618N/A #@TestStep Add an entry with a userPassword containing a non-ASCII
4618N/A character
4618N/A #@TestPostamble none
4618N/A #@TestResult The test is passed if the add operation is rejected
4618N/A -->
4618N/A
4618N/A <testcase name="getTestCaseName('Plugins 7bit Clean with default attribute-type')">
4618N/A <sequence>
4618N/A <call function="'testCase_Preamble'"/>
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_7bit')
4618N/A listAttr.append('sn:testuser_7bit')
4618N/A listAttr.append('cn:testuser_7bit')
4618N/A listAttr.append('mail:testuser_7bit')
4618N/A listAttr.append('userPassword:342à')
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_7bit,%s' % DIRECTORY_INSTANCE_SFX,
4618N/A 'listAttributes' : listAttr,
4618N/A 'expectedRC' : 19
4618N/A }
4618N/A </call>
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_7bit,%s' % DIRECTORY_INSTANCE_SFX,
4618N/A 'expectedRC' : 'noCheck'
4618N/A }
4618N/A </call>
4618N/A
4618N/A <call function="'testCase_Postamble'"/>
4618N/A </sequence>
4618N/A </testcase>
3212N/A
4618N/A
4618N/A <!---
4618N/A #@TestMarker Plugin 7bit
4618N/A #@TestName Plugin 7bit with a new attribute-type
4618N/A #@TestPurpose Check the serve behavior when the plugin 7bit is checked on a new attribut-type
4618N/A #@TestPreamble none
4618N/A #@TestStep set a new attribut-type to the attribut street
4618N/A #@TestStep Add an entry with the attribut street containing a non-ASCII character
4618N/A #@TestPostamble none
4618N/A #@TestResult The test is passed if the add operation is rejected
4618N/A -->
4618N/A
4618N/A <testcase name="getTestCaseName('Plugins 7bit Clean with a new attribute-type')">
4618N/A <sequence>
4618N/A <call function="'testCase_Preamble'"/>
4618N/A
4618N/A <message>'-- configure a new attribute-type for the plugin 7-Bit --'</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' : '7-Bit Clean',
4618N/A 'optionsString' : '--add attribute-type:street',
4618N/A 'expectedRC' : 0 }
4618N/A </call>
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_7bit')
4618N/A listAttr.append('sn:testuser_7bit')
4618N/A listAttr.append('cn:testuser_7bit')
4618N/A listAttr.append('mail:testuser_7bit')
4618N/A listAttr.append('street:342à')
4618N/A listAttr.append('userPassword:342')
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_7bit,%s' % DIRECTORY_INSTANCE_SFX,
4618N/A 'listAttributes' : listAttr,
4618N/A 'expectedRC' : 19
4618N/A }
4618N/A </call>
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_7bit,%s' % DIRECTORY_INSTANCE_SFX,
4618N/A 'expectedRC' : 'noCheck'
4618N/A }
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 7bit
4618N/A #@TestName disable Plugin 7bit
4618N/A #@TestPurpose Check the server behavior when the plugin 7bit is disabled
4618N/A #@TestPreamble none
4618N/A #@TestStep Disable the plugin 7-bit clean
4618N/A #@TestStep Add an entry with the attribut street containing a non-ASCII character
4618N/A #@TestPostamble none
4618N/A #@TestResult The test is passed if the add operation is accepted
4618N/A -->
3212N/A
4618N/A <testcase name="getTestCaseName('Plugins 7bit Clean is disabled')">
4618N/A <sequence>
4618N/A <call function="'testCase_Preamble'"/>
4618N/A
4618N/A
4618N/A <message>'-- disable the plugin 7-Bit Clean --'</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' : '7-Bit Clean',
4618N/A 'optionsString' : '--set enabled:false',
4618N/A 'expectedRC' : 0 }
4618N/A </call>
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_7bit')
4618N/A listAttr.append('sn:testuser_7bit')
4618N/A listAttr.append('cn:testuser_7bit')
4618N/A listAttr.append('mail:testuser_7bit')
4618N/A listAttr.append('street:342à')
4618N/A listAttr.append('userPassword:342')
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_7bit,%s' % DIRECTORY_INSTANCE_SFX,
4618N/A 'listAttributes' : listAttr,
4618N/A 'expectedRC' : 0
4618N/A }
4618N/A </call>
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_7bit,%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 7 Bit 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>
4618N/A
4618N/A </try>
4618N/A </block>
4618N/A </function>
3212N/A</stax>