From 7c19b329d757adbe7ee80d8bd555482e662ea109 Mon Sep 17 00:00:00 2001
From: smaguin <smaguin@localhost>
Date: Fri, 01 Feb 2008 08:17:01 +0000
Subject: [PATCH] new monitoring testsuite

---
 opendj-sdk/opends/tests/functional-tests/testcases/monitoring/monitoring_provider.xml  |  506 +++++++++++++++++++++++++++++
 opendj-sdk/opends/tests/functional-tests/testcases/monitoring/monitoring_setup.xml     |   89 +++++
 opendj-sdk/opends/tests/functional-tests/testcases/monitoring/monitoring.xml           |   58 +++
 opendj-sdk/opends/tests/functional-tests/testcases/monitoring/monitoring_cleanup.xml   |   74 ++++
 opendj-sdk/opends/tests/functional-tests/testcases/monitoring/monitoring_componant.xml |  268 +++++++++++++++
 5 files changed, 995 insertions(+), 0 deletions(-)

diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/monitoring/monitoring.xml b/opendj-sdk/opends/tests/functional-tests/testcases/monitoring/monitoring.xml
new file mode 100644
index 0000000..28228e2
--- /dev/null
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/monitoring/monitoring.xml
@@ -0,0 +1,58 @@
+<?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, exclude this CDDL HEADER in each
+ ! file and exclude 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 2008 Sun Microsystems, Inc.
+! -->
+
+<!--
+            Place group-specific test information here.
+            #@TestGroupName		Monitoring
+            #@TestGroupPurpose		Test the ability of the server to monitor informations
+-->
+
+<stax>
+  <defaultcall function="main_monitoring"/>
+  <function name="main_monitoring">
+    <sequence>
+      <block name="'monitoring'">
+        <sequence>
+          <script>
+            CurrentTestPath['group']='monitoring'
+          </script>
+          
+          <call function="'testGroup_Preamble'" />
+          <iterate var="_test" in="['setup','provider','componant','cleanup']" >
+            <sequence>
+              <import machine="STAF_LOCAL_HOSTNAME"
+                      file="'%s/testcases/monitoring/monitoring_%s.xml' % (TESTS_DIR,_test)"/>
+              <call function="'monitoring_%s' % _test" />
+            </sequence>
+          </iterate>
+          <call function="'testGroup_Postamble'" />
+        </sequence>
+      </block>
+    </sequence>
+  </function>
+</stax>
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/monitoring/monitoring_cleanup.xml b/opendj-sdk/opends/tests/functional-tests/testcases/monitoring/monitoring_cleanup.xml
new file mode 100755
index 0000000..fd0f450
--- /dev/null
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/monitoring/monitoring_cleanup.xml
@@ -0,0 +1,74 @@
+<?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 2008 Sun Microsystems, Inc.
+! -->
+<stax>
+  
+  <defaultcall function="monitoring_cleanup"/>
+  <function name="monitoring_cleanup">
+    <sequence>
+      <block name="'cleanup'">
+        <sequence>
+          <block name="'Block DS Process Stop'">				
+            <!--- Stop DS -->
+            <sequence>
+              <message>
+                'Stop DS running on port %s' % (DIRECTORY_INSTANCE_PORT)
+              </message>
+              
+              <call function="'StopDsWithScript'">
+                { 'location'  : STAF_REMOTE_HOSTNAME,
+                'dsHost'    : DIRECTORY_INSTANCE_HOST,
+                'dsPort'    : DIRECTORY_INSTANCE_PORT,
+                'dsBindDN'  : DIRECTORY_INSTANCE_DN,
+                'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
+              </call>
+              <call function="'checkRC'">
+                { 'returncode' : RC ,
+                'result'     : STAXResult }
+              </call>
+            </sequence>			  
+            <!--- End Block DS Process Stop -->
+          </block>
+          <block name="'Block Remove DS Topology'">
+            <!-- Remove  the topology created for the test suite -->
+            <sequence>
+              <message>
+                'Remove DS topology created for the Test Suite'
+              </message>				  
+              <call function="'removeTopology'"/>
+              <call function="'checkRC'">
+                { 'returncode' : RC ,
+                'result'     : STAXResult }
+              </call>
+            </sequence>			  
+            <!-- End Block Remove DS Topology-->  
+          </block>	  														  
+        </sequence>        
+      </block>
+    </sequence>
+  </function>
+</stax>
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/monitoring/monitoring_componant.xml b/opendj-sdk/opends/tests/functional-tests/testcases/monitoring/monitoring_componant.xml
new file mode 100644
index 0000000..b98d3d2
--- /dev/null
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/monitoring/monitoring_componant.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 2008 Sun Microsystems, Inc.
+! -->
+<stax>
+  <defaultcall function="monitoring_componant"/>
+  <function name="monitoring_componant" scope="local">
+    <block name="STAXCurrentFunction">    
+      <sequence>
+        <script>
+          CurrentTestPath['suite']=STAXCurrentFunction
+        </script>
+        <call function="'testSuite_Preamble'" />
+        
+        
+        <!--- Test Suite information
+#@TestSuiteName       Monitoring componants
+#@TestSuitePurpose    Verify the monitoring of  componants
+#@TestSuiteID         Monitoring
+#@TestSuiteGroup      Monitoring
+#@TestGroup           Monitoring
+#@TestScript          monitoring_componants.xml
+#@TestHTMLLink        http://opends.dev.java.net/
+-->
+
+        <!---
+#@TestMarker            monitoring componants
+#@TestName              monitoring componants
+#@TestIssue             Check the monitoring of the componant LDIF connection handler
+#@TestPreamble          none
+#@TestStep               Check the entry on cn=LDIF Connection Handler,cn=monitor is available
+#@TestStep              Disable the LDIF connection handler componant
+#@TestStep              Check the entry on cn=LDIF Connection Handler,cn=monitor is not more available
+#@TestPostamble         none
+
+-->  
+    
+        <testcase name="getTestCaseName('LDIF connection handler monitoring')">
+          <sequence>
+            <call function="'testCase_Preamble'"/>
+            
+            <!-- Check the entry on cn=LDIF Connection Handler,cn=monitor is available -->  
+            <message>'######  Monitor the LDIF connection handler ###### '</message>     
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+              'dsInstancePort'     : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'       : DIRECTORY_INSTANCE_DN,
+              'dsInstancePswd'     : DIRECTORY_INSTANCE_PSWD ,	
+              'dsBaseDN'           : 'cn=LDIF Connection Handler,cn=monitor',
+              'dsFilter'           : 'objectclass=*',
+              'expectedRC'	   :  0 }
+            </call>  	    
+            
+            <message>'-- Disable the LDIF Connection Handler --'</message>   
+            <call function="'dsconfig'">
+              { 'dsInstanceHost'     : DIRECTORY_INSTANCE_HOST,
+              'dsInstancePort'       : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'         : DIRECTORY_INSTANCE_DN ,
+              'dsInstancePswd'       : DIRECTORY_INSTANCE_PSWD ,
+              'subcommand'           : 'set-connection-handler-prop' ,
+              'objectType'           : 'handler-name',
+              'objectName'           : 'LDIF Connection Handler',
+              'optionsString'        : '--set enabled:false',
+              'expectedRC'           : 0 } 
+            </call>    
+            
+            
+            <!-- Check the entry on cn=LDIF Connection Handler,cn=monitor is not available -->  
+            <message>'######  Monitor the LDIF Connection Handler  ###### '</message>     
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'    : DIRECTORY_INSTANCE_HOST ,
+              'dsInstancePort'      : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'        : DIRECTORY_INSTANCE_DN,
+              'dsInstancePswd'      : DIRECTORY_INSTANCE_PSWD ,	
+              'dsBaseDN'            : 'cn=LDIF Connection Handler,cn=monitor',
+              'dsFilter'            : 'objectclass=*',
+              'expectedRC'	    :  32 }
+            </call> 
+            
+            <message>'-- Enabled the LDIF Connection Handler --'</message>   
+            <call function="'dsconfig'">
+              { 'dsInstanceHost'     : DIRECTORY_INSTANCE_HOST,
+              'dsInstancePort'       : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'         : DIRECTORY_INSTANCE_DN ,
+              'dsInstancePswd'       : DIRECTORY_INSTANCE_PSWD ,
+              'subcommand'           : 'set-connection-handler-prop' ,
+              'objectType'           : 'handler-name',
+              'objectName'           : 'LDIF Connection Handler',
+              'optionsString'        : '--set enabled:true',
+              'expectedRC'           : 0 } 
+            </call>              
+            <call function="'testCase_Postamble'"/>
+          </sequence>
+        </testcase>
+        
+        <!---
+#@TestMarker            monitoring componants
+#@TestName              monitoring componants
+#@TestIssue             Check the monitoring of a NEW componant LDIF connection handler
+#@TestPreamble          none
+#@TestStep              Create a new LDIF connection handler
+#@TestStep              Check the entry on cn=myLDIF,cn=monitor is available
+#@TestStep              Delete the new LDIF connection handler componant
+#@TestPostamble         none
+
+-->  
+        <testcase name="getTestCaseName('Monitoring a new LDIF connection handler')">
+          <sequence>
+            <call function="'testCase_Preamble'"/>
+            
+            <message>'-- Create a new  LDIF Connection Handler --'</message>   
+            <call function="'dsconfig'">
+              { 'dsInstanceHost'     : DIRECTORY_INSTANCE_HOST,
+              'dsInstancePort'       : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'         : DIRECTORY_INSTANCE_DN ,
+              'dsInstancePswd'       : DIRECTORY_INSTANCE_PSWD ,
+              'subcommand'           : 'create-connection-handler' ,
+              'objectType'           : 'handler-name',
+              'objectName'           : 'myLDIF',
+              'optionsString'        : '--type ldif --set enabled:true',
+              'expectedRC'           : 0 } 
+            </call>              
+            
+            <!-- Check the entry on cn=myLDIF,cn=monitor is available -->  
+            <message>'######  Monitor the new LDIF connection handler ###### '</message>     
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+              'dsInstancePort'     : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'       : DIRECTORY_INSTANCE_DN,
+              'dsInstancePswd'     : DIRECTORY_INSTANCE_PSWD ,	
+              'dsBaseDN'           : 'cn=myLDIF,cn=monitor',
+              'dsFilter'           : 'objectclass=*',
+              'expectedRC'	   :  0 }
+            </call>  	    
+            
+            <message>'-- Delete the new  LDIF Connection Handler --'</message>   
+            <call function="'dsconfig'">
+              { 'dsInstanceHost'     : DIRECTORY_INSTANCE_HOST,
+              'dsInstancePort'       : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'         : DIRECTORY_INSTANCE_DN ,
+              'dsInstancePswd'       : DIRECTORY_INSTANCE_PSWD ,
+              'subcommand'           : 'delete-connection-handler' ,
+              'objectType'           : 'handler-name',
+              'objectName'           : 'myLDIF',
+              'expectedRC'           : 0 } 
+            </call>     
+            <call function="'testCase_Postamble'"/>
+          </sequence>
+        </testcase>
+        
+        
+        <!---
+#@TestMarker            monitoring componants
+#@TestName              monitoring componants
+#@TestIssue             Check the monitoring of the componant Backup Backend
+#@TestPreamble          none
+#@TestStep              Check the entry on cn=backup Backend,cn=monitor,cn=monitor is available
+#@TestPostamble         none
+
+-->  
+    
+        <testcase name="getTestCaseName('Backup Backend monitoring')">
+          <sequence>
+            <call function="'testCase_Preamble'"/>
+            
+            <!-- Check the entry on cn=backup Backend,cn=monitor is available -->  
+            <message>'######  Monitor the Backup Backend ###### '</message>     
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+              'dsInstancePort'     : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'       : DIRECTORY_INSTANCE_DN,
+              'dsInstancePswd'     : DIRECTORY_INSTANCE_PSWD ,	
+              'dsBaseDN'           : 'cn=backup Backend,cn=monitor',
+              'dsFilter'           : 'objectclass=*',
+              'expectedRC'	   :  0 }
+            </call>  	    
+            <call function="'testCase_Postamble'"/>
+          </sequence>
+        </testcase>
+        
+        <!---
+#@TestMarker            monitoring componants
+#@TestName              monitoring componants
+#@TestIssue             Check the monitoring of the componant userRoot Backend
+#@TestPreamble          none
+#@TestStep               Check the entry on cn=userRoot Backend,cn=monitor,cn=monitor is available
+#@TestPostamble         none
+
+-->  
+    
+        <testcase name="getTestCaseName('userRoot Backend monitoring')">
+          <sequence>
+            <call function="'testCase_Preamble'"/>
+            
+            <!-- Check the entry on cn=userRoot Backend,cn=monitor is available -->  
+            <message>'######  Monitor the userRoot Backend ###### '</message>     
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+              'dsInstancePort'     : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'       : DIRECTORY_INSTANCE_DN,
+              'dsInstancePswd'     : DIRECTORY_INSTANCE_PSWD ,	
+              'dsBaseDN'           : 'cn=userRoot Backend,cn=monitor',
+              'dsFilter'           : 'objectclass=*',
+              'expectedRC'	   :  0 }
+            </call>  	    
+            <call function="'testCase_Postamble'"/>
+          </sequence>
+        </testcase>
+        
+        
+        <!---
+#@TestMarker            monitoring componants
+#@TestName              monitoring componants
+#@TestIssue             Check the monitoring of the componant tasks Backend
+#@TestPreamble          none
+#@TestStep               Check the entry on cn=tasks Backend,cn=monitor,cn=monitor is available
+#@TestPostamble         none
+
+-->  
+    
+        <testcase name="getTestCaseName('tasks Backend monitoring')">
+          <sequence>
+            <call function="'testCase_Preamble'"/>
+            
+            <!-- Check the entry on cn=tasks Backend,cn=monitor is available -->  
+            <message>'######  Monitor the tasks Backend ###### '</message>     
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+              'dsInstancePort'     : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'       : DIRECTORY_INSTANCE_DN,
+              'dsInstancePswd'     : DIRECTORY_INSTANCE_PSWD ,	
+              'dsBaseDN'           : 'cn=tasks Backend,cn=monitor',
+              'dsFilter'           : 'objectclass=*',
+              'expectedRC'	   :  0 }
+            </call>  	    
+            <call function="'testCase_Postamble'"/>
+          </sequence>
+        </testcase>
+        
+        
+        <call function="'testSuite_Postamble'" />
+      </sequence>
+    </block>      
+  </function>
+</stax>
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/monitoring/monitoring_provider.xml b/opendj-sdk/opends/tests/functional-tests/testcases/monitoring/monitoring_provider.xml
new file mode 100644
index 0000000..134cde0
--- /dev/null
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/monitoring/monitoring_provider.xml
@@ -0,0 +1,506 @@
+<?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 2008 Sun Microsystems, Inc.
+! -->
+<stax>
+  <defaultcall function="monitoring_provider"/>
+  <function name="monitoring_provider" scope="local">
+    <block name="STAXCurrentFunction">    
+      <sequence>
+        <script>
+          CurrentTestPath['suite']=STAXCurrentFunction
+        </script>
+        <call function="'testSuite_Preamble'" />
+        
+ 
+<!--- Test Suite information
+#@TestSuiteName       Monitoring Provider Tests
+#@TestSuitePurpose    Verify the monitoring Provider
+#@TestSuiteID         Monitoring Provider
+#@TestSuiteGroup      Monitoring
+#@TestGroup           Monitoring
+#@TestScript          monitoring_provider.xml
+#@TestHTMLLink        http://opends.dev.java.net/
+-->
+
+
+        <!---
+#@TestMarker            Monitoring Provider Tests
+#@TestName              Client Connections monitoring Provider
+#@TestPurpose           Test the  Client Connections monitoring Provider
+#@TestPreamble          none
+#@TestStep               Check the entry on cn=Client Connections,cn=monitor is available
+#@TestStep              Disable the Client Connections monitoring Provider
+#@TestStep              Check the entry on cn=Client Connections,cn=monitor is not more available
+#@TestPostamble         none
+
+-->  
+    
+        <testcase name="getTestCaseName('Client Connections monitoring Provider')">
+          <sequence>
+            <call function="'testCase_Preamble'"/>
+            
+            
+            <!-- Check the entry on cn=Client Connections,cn=monitor is available -->  
+            <message>'######  Monitor the Client Connections  ###### '</message>     
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+              'dsInstancePort'     : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'       : DIRECTORY_INSTANCE_DN,
+              'dsInstancePswd'     : DIRECTORY_INSTANCE_PSWD ,	
+              'dsBaseDN'           : 'cn=Client Connections,cn=monitor',
+              'dsFilter'           : 'objectclass=*',
+              'expectedRC'	   :  0 }
+            </call>  	    
+            
+            <message>'-- Disable the Client Connections monitor provider --'</message>   
+            <call function="'dsconfig'">
+              { 'dsInstanceHost'     : DIRECTORY_INSTANCE_HOST,
+              'dsInstancePort'       : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'         : DIRECTORY_INSTANCE_DN ,
+              'dsInstancePswd'       : DIRECTORY_INSTANCE_PSWD ,
+              'subcommand'           : 'set-monitor-provider-prop' ,
+              'objectType'           : 'provider-name',
+              'objectName'           : 'Client Connections',
+              'optionsString'        : '--set enabled:false',
+              'expectedRC'           : 0 } 
+            </call>    
+            
+            
+            <!-- Check the entry on cn=Client Connections,cn=monitor is not available -->  
+            <message>'######  Monitor the Client Connections  ###### '</message>     
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'    : DIRECTORY_INSTANCE_HOST ,
+              'dsInstancePort'      : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'        : DIRECTORY_INSTANCE_DN,
+              'dsInstancePswd'      : DIRECTORY_INSTANCE_PSWD ,	
+              'dsBaseDN'            : 'cn=Client Connections,cn=monitor',
+              'dsFilter'            : 'objectclass=*',
+              'expectedRC'	    :  32 }
+            </call> 
+            
+            <call function="'testCase_Postamble'"/>
+          </sequence>
+        </testcase>
+        
+        <!---
+#@TestMarker            Monitoring Provider Tests
+#@TestName              Entry Caches monitoring Provider
+#@TestPurpose           Test the Entry Caches monitoring Provider
+#@TestPreamble          none
+#@TestStep               Check the entry on cn=Entry Caches,cn=monitor is available
+#@TestStep              Disable the Entry Caches monitoring Provider
+#@TestStep              Check the entry on cn=Entry Caches,cn=monitor is not more available
+#@TestPostamble         none
+
+-->  
+    
+        <testcase name="getTestCaseName('Entry Caches monitoring Provider')">
+          <sequence>
+            <call function="'testCase_Preamble'"/>
+            
+            
+            <!-- Check the entry on cn=Entry Caches,cn=monitor is available -->  
+            <message>'######  Monitor the Entry Caches  ###### '</message>     
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+              'dsInstancePort'     : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'       : DIRECTORY_INSTANCE_DN,
+              'dsInstancePswd'     : DIRECTORY_INSTANCE_PSWD ,	
+              'dsBaseDN'           : 'cn=Entry Caches,cn=monitor',
+              'dsFilter'           : 'objectclass=*',
+              'expectedRC'	   :  0 }
+            </call>  	    
+            
+            <message>'-- Disable the Entry Caches monitor provider --'</message>   
+            <call function="'dsconfig'">
+              { 'dsInstanceHost'     : DIRECTORY_INSTANCE_HOST,
+              'dsInstancePort'       : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'         : DIRECTORY_INSTANCE_DN ,
+              'dsInstancePswd'       : DIRECTORY_INSTANCE_PSWD ,
+              'subcommand'           : 'set-monitor-provider-prop' ,
+              'objectType'           : 'provider-name',
+              'objectName'           : 'Entry Caches',
+              'optionsString'        : '--set enabled:false',
+              'expectedRC'           : 0 } 
+            </call>    
+            
+            
+            <!-- Check the entry on cn=Entry Caches,cn=monitor is not available -->  
+            <message>'######  Monitor the Entry Caches  ###### '</message>     
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'    : DIRECTORY_INSTANCE_HOST ,
+              'dsInstancePort'      : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'        : DIRECTORY_INSTANCE_DN,
+              'dsInstancePswd'      : DIRECTORY_INSTANCE_PSWD ,	
+              'dsBaseDN'            : 'cn=Entry Caches,cn=monitor',
+              'dsFilter'            : 'objectclass=*',
+              'expectedRC'	    :  32 }
+            </call> 
+            
+            <call function="'testCase_Postamble'"/>
+          </sequence>
+        </testcase>
+        
+        <!---
+#@TestMarker            Monitoring Provider Tests
+#@TestName              JVM Memory Usage monitoring Provider
+#@TestPurpose           Test the JVM Memory Usage monitoring Provider
+#@TestPreamble          none
+#@TestStep              Check the entry on cn=JVM Memory Usage,cn=monitor is available
+#@TestStep              Disable the JVM Memory Usage monitoring Provider
+#@TestStep              Check the entry on cn=JVM Memory Usage,cn=monitor is not more available
+#@TestPostamble         none
+
+-->  
+    
+        <testcase name="getTestCaseName('JVM Memory Usage monitoring Provider')">
+          <sequence>
+            <call function="'testCase_Preamble'"/>
+            
+            
+            <!-- Check the entry on cn=JVM Memory Usage,cn=monitor is available -->  
+            <message>'######  Monitor the JVM Memory Usage  ###### '</message>     
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+              'dsInstancePort'     : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'       : DIRECTORY_INSTANCE_DN,
+              'dsInstancePswd'     : DIRECTORY_INSTANCE_PSWD ,	
+              'dsBaseDN'           : 'cn=JVM Memory Usage,cn=monitor',
+              'dsFilter'           : 'objectclass=*',
+              'expectedRC'	   :  0 }
+            </call>  	    
+            
+            <message>'-- Disable the JVM Memory Usage monitor provider --'</message>   
+            <call function="'dsconfig'">
+              { 'dsInstanceHost'     : DIRECTORY_INSTANCE_HOST,
+              'dsInstancePort'       : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'         : DIRECTORY_INSTANCE_DN ,
+              'dsInstancePswd'       : DIRECTORY_INSTANCE_PSWD ,
+              'subcommand'           : 'set-monitor-provider-prop' ,
+              'objectType'           : 'provider-name',
+              'objectName'           : 'JVM Memory Usage',
+              'optionsString'        : '--set enabled:false',
+              'expectedRC'           : 0 } 
+            </call>    
+            
+            
+            <!-- Check the entry on cn=JVM Memory Usage,cn=monitor is not available -->  
+            <message>'######  Monitor the JVM Memory Usage  ###### '</message>     
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'    : DIRECTORY_INSTANCE_HOST ,
+              'dsInstancePort'      : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'        : DIRECTORY_INSTANCE_DN,
+              'dsInstancePswd'      : DIRECTORY_INSTANCE_PSWD ,	
+              'dsBaseDN'            : 'cn=JVM Memory Usage,cn=monitor',
+              'dsFilter'            : 'objectclass=*',
+              'expectedRC'	    :  32 }
+            </call> 
+            
+            <call function="'testCase_Postamble'"/>
+          </sequence>
+        </testcase>
+        
+        
+        <!---
+#@TestMarker            Monitoring Provider Tests
+#@TestName              JVM Stack Trace monitoring Provider
+#@TestPurpose           Test the JVM Stack Trace monitoring Provider
+#@TestPreamble          none
+#@TestStep               Check the entry on cn=JVM Stack Trace,cn=monitor is available
+#@TestStep              Disable the JVM Stack Trace monitoring Provider
+#@TestStep              Check the entry on cn=JVM Stack Trace,cn=monitor is not more available
+#@TestPostamble         none
+
+-->  
+    
+        <testcase name="getTestCaseName('JVM Stack Trace monitoring Provider')">
+          <sequence>
+            <call function="'testCase_Preamble'"/>
+            
+            
+            <!-- Check the entry on cn=JVM Stack Trace,cn=monitor is available -->  
+            <message>'######  Monitor the JVM Stack Trace  ###### '</message>     
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+              'dsInstancePort'     : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'       : DIRECTORY_INSTANCE_DN,
+              'dsInstancePswd'     : DIRECTORY_INSTANCE_PSWD ,	
+              'dsBaseDN'           : 'cn=JVM Stack Trace,cn=monitor',
+              'dsFilter'           : 'objectclass=*',
+              'expectedRC'	   :  0 }
+            </call>  	    
+            
+            <message>'-- Disable the JVM Stack Trace monitor provider --'</message>   
+            <call function="'dsconfig'">
+              { 'dsInstanceHost'     : DIRECTORY_INSTANCE_HOST,
+              'dsInstancePort'       : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'         : DIRECTORY_INSTANCE_DN ,
+              'dsInstancePswd'       : DIRECTORY_INSTANCE_PSWD ,
+              'subcommand'           : 'set-monitor-provider-prop' ,
+              'objectType'           : 'provider-name',
+              'objectName'           : 'JVM Stack Trace',
+              'optionsString'        : '--set enabled:false',
+              'expectedRC'           : 0 } 
+            </call>    
+            
+            
+            <!-- Check the entry on cn=JVM Stack Trace,cn=monitor is not available -->  
+            <message>'######  Monitor the JVM Stack Trace  ###### '</message>     
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'    : DIRECTORY_INSTANCE_HOST ,
+              'dsInstancePort'      : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'        : DIRECTORY_INSTANCE_DN,
+              'dsInstancePswd'      : DIRECTORY_INSTANCE_PSWD ,	
+              'dsBaseDN'            : 'cn=JVM Stack Trace,cn=monitor',
+              'dsFilter'            : 'objectclass=*',
+              'expectedRC'	    :  32 }
+            </call> 
+            
+            <call function="'testCase_Postamble'"/>
+          </sequence>
+        </testcase>
+        
+        <!---
+#@TestMarker            Monitoring Provider Tests
+#@TestName              System Info monitoring Provider
+#@TestPurpose           Test the System Info monitoring Provider
+#@TestPreamble          none
+#@TestStep              Check the entry on cn=System Info,cn=monitor is available
+#@TestStep              Disable the System Info monitoring Provider
+#@TestStep              Check the entry on cn=System Info,cn=monitor is not more available
+#@TestPostamble         none
+
+-->  
+    
+        <testcase name="getTestCaseName('System Info monitoring Provider')">
+          <sequence>
+            <call function="'testCase_Preamble'"/>
+            
+            
+            <!-- Check the entry on cn=System Info,cn=monitor is available -->  
+            <message>'######  Monitor the System Info  ###### '</message>     
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+              'dsInstancePort'     : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'       : DIRECTORY_INSTANCE_DN,
+              'dsInstancePswd'     : DIRECTORY_INSTANCE_PSWD ,	
+              'dsBaseDN'           : 'cn=System Info,cn=monitor',
+              'dsFilter'           : 'objectclass=*',
+              'expectedRC'	   :  0 }
+            </call>  	    
+            
+            <message>'-- Disable the System Info monitor provider --'</message>   
+            <call function="'dsconfig'">
+              { 'dsInstanceHost'     : DIRECTORY_INSTANCE_HOST,
+              'dsInstancePort'       : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'         : DIRECTORY_INSTANCE_DN ,
+              'dsInstancePswd'       : DIRECTORY_INSTANCE_PSWD ,
+              'subcommand'           : 'set-monitor-provider-prop' ,
+              'objectType'           : 'provider-name',
+              'objectName'           : 'System Info',
+              'optionsString'        : '--set enabled:false',
+              'expectedRC'           : 0 } 
+            </call>    
+            
+            
+            <!-- Check the entry on cn=System Info,cn=monitor is not available -->  
+            <message>'######  Monitor the System Info  ###### '</message>     
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'    : DIRECTORY_INSTANCE_HOST ,
+              'dsInstancePort'      : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'        : DIRECTORY_INSTANCE_DN,
+              'dsInstancePswd'      : DIRECTORY_INSTANCE_PSWD ,	
+              'dsBaseDN'            : 'cn=System Info,cn=monitor',
+              'dsFilter'            : 'objectclass=*',
+              'expectedRC'	    :  32 }
+            </call> 
+            
+            <call function="'testCase_Postamble'"/>
+          </sequence>
+        </testcase>
+        
+        
+        
+        <!---
+#@TestMarker            Monitoring Provider Tests
+#@TestName              Version monitoring Provider
+#@TestPurpose           Test the Version monitoring Provider
+#@TestPreamble          none
+#@TestStep              Check the entry on cn=Version,cn=monitor is available
+#@TestStep              Disable the Version monitoring Provider
+#@TestStep              Check the entry on cn=Version,cn=monitor is not more available
+#@TestPostamble         none
+
+-->  
+    
+        <testcase name="getTestCaseName('Version monitoring Provider')">
+          <sequence>
+            <call function="'testCase_Preamble'"/>
+            
+            
+            <!-- Check the entry on cn=Version,cn=monitor is available -->  
+            <message>'######  Monitor the Version  ###### '</message>     
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+              'dsInstancePort'     : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'       : DIRECTORY_INSTANCE_DN,
+              'dsInstancePswd'     : DIRECTORY_INSTANCE_PSWD ,	
+              'dsBaseDN'           : 'cn=Version,cn=monitor',
+              'dsFilter'           : 'objectclass=*',
+              'expectedRC'	   :  0 }
+            </call>  	    
+            
+            <message>'-- Disable the Version monitor provider --'</message>   
+            <call function="'dsconfig'">
+              { 'dsInstanceHost'     : DIRECTORY_INSTANCE_HOST,
+              'dsInstancePort'       : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'         : DIRECTORY_INSTANCE_DN ,
+              'dsInstancePswd'       : DIRECTORY_INSTANCE_PSWD ,
+              'subcommand'           : 'set-monitor-provider-prop' ,
+              'objectType'           : 'provider-name',
+              'objectName'           : 'Version',
+              'optionsString'        : '--set enabled:false',
+              'expectedRC'           : 0 } 
+            </call>    
+            
+            <!-- Check the entry on cn=Version,cn=monitor is not available -->  
+            <message>'######  Monitor the Version  ###### '</message>     
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'    : DIRECTORY_INSTANCE_HOST ,
+              'dsInstancePort'      : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'        : DIRECTORY_INSTANCE_DN,
+              'dsInstancePswd'      : DIRECTORY_INSTANCE_PSWD ,	
+              'dsBaseDN'            : 'cn=Version,cn=monitor',
+              'dsFilter'            : 'objectclass=*',
+              'expectedRC'	    :  32 }
+            </call> 
+            
+            <call function="'testCase_Postamble'"/>
+          </sequence>
+        </testcase>
+        
+        <!---
+#@TestMarker            Monitoring Provider Tests
+#@TestName              new monitoring provider
+#@TestPurpose           Test the creation of monitoring provider using dsconfig
+#@TestPreamble          none
+#@TestStep              create a new monitoring provider to manage version using dsconfig
+#@TestStep              Enable this monitoring Provider
+#@TestStep              Disable the initial monitoring Provider which manages the Version
+#@TestStep              Check the entry on cn=Version,cn=monitor is available
+#@TestStep              Delete the new monitor Provider 
+#@TestPostamble         none
+
+-->  
+    
+        <testcase name="getTestCaseName('Use a new monitoring Provider')">
+          <sequence>
+            <call function="'testCase_Preamble'"/>
+            
+            <message>'-- Create a new  monitor provider for Version --'</message>   
+            <call function="'dsconfig'">
+              { 'dsInstanceHost'     : DIRECTORY_INSTANCE_HOST,
+              'dsInstancePort'       : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'         : DIRECTORY_INSTANCE_DN ,
+              'dsInstancePswd'       : DIRECTORY_INSTANCE_PSWD ,
+              'subcommand'           : 'create-monitor-provider' ,
+              'objectType'           : 'provider-name',
+              'objectName'           : 'myVersion',
+              'optionsString'        : '--type version --set enabled:false',
+              'expectedRC'           : 0 } 
+            </call>    
+            
+            <message>'-- Disable the Version monitor provider --'</message>   
+            <call function="'dsconfig'">
+              { 'dsInstanceHost'     : DIRECTORY_INSTANCE_HOST,
+              'dsInstancePort'       : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'         : DIRECTORY_INSTANCE_DN ,
+              'dsInstancePswd'       : DIRECTORY_INSTANCE_PSWD ,
+              'subcommand'           : 'set-monitor-provider-prop' ,
+              'objectType'           : 'provider-name',
+              'objectName'           : 'Version',
+              'optionsString'        : '--set enabled:false',
+              'expectedRC'           : 0 } 
+            </call>    
+            
+            <!-- Check the entry on cn=Version,cn=monitor is not available -->  
+            <message>'######  Monitor the Version  ###### '</message>     
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'    : DIRECTORY_INSTANCE_HOST ,
+              'dsInstancePort'      : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'        : DIRECTORY_INSTANCE_DN,
+              'dsInstancePswd'      : DIRECTORY_INSTANCE_PSWD ,	
+              'dsBaseDN'            : 'cn=Version,cn=monitor',
+              'dsFilter'            : 'objectclass=*',
+              'expectedRC'	    :  32 }
+            </call> 
+            
+            <message>'-- Enable the new Version monitor provider --'</message>   
+            <call function="'dsconfig'">
+              { 'dsInstanceHost'     : DIRECTORY_INSTANCE_HOST,
+              'dsInstancePort'       : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'         : DIRECTORY_INSTANCE_DN ,
+              'dsInstancePswd'       : DIRECTORY_INSTANCE_PSWD ,
+              'subcommand'           : 'set-monitor-provider-prop' ,
+              'objectType'           : 'provider-name',
+              'objectName'           : 'myVersion',
+              'optionsString'        : '--set enabled:true',
+              'expectedRC'           : 0 } 
+            </call>    
+            
+            <!-- Check the entry on cn=Version,cn=monitor is available -->  
+            <message>'######  Monitor the Version  ###### '</message>     
+            <call function="'SearchObject'">
+              { 'dsInstanceHost'   : DIRECTORY_INSTANCE_HOST ,
+              'dsInstancePort'     : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'       : DIRECTORY_INSTANCE_DN,
+              'dsInstancePswd'     : DIRECTORY_INSTANCE_PSWD ,	
+              'dsBaseDN'           : 'cn=Version,cn=monitor',
+              'dsFilter'           : 'objectclass=*',
+              'expectedRC'	   :  0 }
+            </call>  	    
+            
+            <message>'-- Delete the new  monitor provider for Version --'</message>   
+            <call function="'dsconfig'">
+              { 'dsInstanceHost'     : DIRECTORY_INSTANCE_HOST,
+              'dsInstancePort'       : DIRECTORY_INSTANCE_PORT ,
+              'dsInstanceDn'         : DIRECTORY_INSTANCE_DN ,
+              'dsInstancePswd'       : DIRECTORY_INSTANCE_PSWD ,
+              'subcommand'           : 'delete-monitor-provider' ,
+              'objectType'           : 'provider-name',
+              'objectName'           : 'myVersion',
+              'expectedRC'           : 0 } 
+            </call>                
+            <call function="'testCase_Postamble'"/>
+          </sequence>
+        </testcase>
+        
+        <call function="'testSuite_Postamble'" />
+      </sequence>
+    </block>      
+  </function>
+</stax>
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/monitoring/monitoring_setup.xml b/opendj-sdk/opends/tests/functional-tests/testcases/monitoring/monitoring_setup.xml
new file mode 100755
index 0000000..c6e1b93
--- /dev/null
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/monitoring/monitoring_setup.xml
@@ -0,0 +1,89 @@
+<?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 2008 Sun Microsystems, Inc.
+! -->
+<stax>
+
+  <defaultcall function="monitoring_setup"/>
+  <function name="monitoring_setup">
+    <sequence>
+      <block name="'setup'">
+        <sequence>
+          <block name="'Block Create DS Topology'">
+            <!-- Create the topology necessary to the test group/suite -->
+            <sequence>
+              <message>
+                'Create DS topology as described in config.py'
+              </message>
+              <call function="'createTopology'">
+                { 'initialiseInstance' : True }
+              </call>
+              <call function="'checkRC'">
+                { 'returncode' : RC ,
+                'result'     : STAXResult }
+              </call>
+            </sequence>
+            <!--- End Block Create DS Topology -->
+          </block>
+          <block name="'Block DS Process Active'">
+            <!--- Start DS -->
+            <sequence>
+              <message>
+                'Start DS to run on port %s' % (DIRECTORY_INSTANCE_PORT)
+              </message>
+              
+              <!--- Start DS -->
+              <call function="'StartDsWithScript'">
+                { 'location'  : STAF_REMOTE_HOSTNAME }
+              </call>
+              
+              <call function="'checkRC'">
+                { 'returncode' : RC ,
+                'result'     : STAXResult }
+              </call>
+              
+              <!--- Check that DS started -->
+              <call function="'isAlive'">
+                { 'noOfLoops'        : 5 ,
+                'noOfMilliSeconds' : 2000 }
+              </call>			
+              
+              <call function="'ldapSearchWithScript'"> 
+                { 'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
+                'dsInstanceDn'	   : DIRECTORY_INSTANCE_DN ,
+                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
+                'dsBaseDN'	   : 'dc=com' ,
+                'dsFilter'	   : 'objectclass=*' }
+              </call>
+              
+            </sequence>
+            <!--- End Block DS Process Active -->
+          </block>			  			
+        </sequence>        
+      </block>
+    </sequence>
+  </function>
+</stax>
\ No newline at end of file

--
Gitblit v1.10.0