From f9207af17a3994c98df910c607517b81cb5204ec Mon Sep 17 00:00:00 2001
From: smaguin <smaguin@localhost>
Date: Fri, 08 Feb 2008 11:23:05 +0000
Subject: [PATCH] test the  plugin 7-bit clean

---
 opends/tests/functional-tests/testcases/plugins/plugins_7bit.xml |  268 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 268 insertions(+), 0 deletions(-)

diff --git a/opends/tests/functional-tests/testcases/plugins/plugins_7bit.xml b/opends/tests/functional-tests/testcases/plugins/plugins_7bit.xml
new file mode 100644
index 0000000..c384909
--- /dev/null
+++ b/opends/tests/functional-tests/testcases/plugins/plugins_7bit.xml
@@ -0,0 +1,268 @@
+<?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 2007-2008 Sun Microsystems, Inc.
+ ! -->
+<stax>
+  <defaultcall function="plugins_7bit"/>
+  <function name="plugins_7bit" scope="local">
+    <block name="STAXCurrentFunction">    
+    <sequence>
+      <script>
+        CurrentTestPath['suite']=STAXCurrentFunction
+      </script>
+      <call function="'testSuite_Preamble'" />
+      
+      <!--- Test Suite information
+#@TestSuiteName       Plugin 7bit
+#@TestSuitePurpose    Verify the plugin 7bit
+#@TestSuiteID         Plugins 
+#@TestSuiteGroup      Plugins
+#@TestGroup           Plugins
+#@TestScript          plugins_7bit.xml
+#@TestHTMLLink        http://opends.dev.java.net/
+-->
+      
+      <!---
+#@TestMarker            Plugin 7bit
+#@TestName              Plugin 7bit setup
+#@TestPurpose           Plugins 7bit setup
+#@TestPreamble          none
+#@TestStep              enable the 7-bit plugin
+#@TestPostamble         none
+#@TestResult            none
+-->  
+    
+ <testcase name="getTestCaseName('Plugins 7-Bit Clean setup')">
+  <sequence>
+    <call function="'testCase_Preamble'"/>
+    
+    <message>'-- Enable the plugin 7-Bit Clean --'</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'           : '7-Bit Clean',
+      'optionsString'        : '--set enabled:true',
+      'expectedRC'           : 0 } 
+    </call>    
+    
+    <call function="'testCase_Postamble'"/>
+  </sequence>
+ </testcase>
+ 
+ 
+ <!---
+#@TestMarker            Plugin 7bit
+#@TestName              Plugin 7bit with default attribute-type
+#@TestPurpose           Check the serve behavior when the plugin 7bit is activated
+#@TestPreamble          none
+#@TestStep              Enable the plugin 7bit
+#@TestStep              Add an entry with a userPassword containing a non-ASCII 
+                        character
+#@TestPostamble         none
+#@TestResult            The test is passed if the add operation is rejected
+-->  
+    
+ <testcase name="getTestCaseName('Plugins 7bit Clean with default attribute-type')">
+  <sequence>
+    <call function="'testCase_Preamble'"/>
+
+    <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('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'     :  255
+      }
+    </call>
+
+              
+    <call function="'testCase_Postamble'"/>
+  </sequence>
+ </testcase>            
+
+                       
+<!---
+#@TestMarker            Plugin 7bit
+#@TestName              Plugin 7bit with a new attribute-type
+#@TestPurpose           Check the serve behavior when the plugin 7bit is checked on a new attribut-type
+#@TestPreamble          none
+#@TestStep              set a new attribut-type to the attribut street
+#@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 rejected
+-->  
+    
+ <testcase name="getTestCaseName('Plugins 7bit Clean with a new attribute-type')">
+  <sequence>
+    <call function="'testCase_Preamble'"/>
+
+    <message>'-- disable the plugin 7-Bit Clean --'</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'           : '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'     :  255
+      }
+    </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,
+      'dsInstancePort'       : DIRECTORY_INSTANCE_PORT ,
+      '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>     
+ 
+ 
+ <call function="'testSuite_Postamble'" />
+ </sequence>
+ </block>      
+</function>
+</stax>

--
Gitblit v1.10.0