<?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
!
! Copyright 2008-2009 Sun Microsystems, Inc.
! Portions Copyright 2013 ForgeRock AS.
! -->
<stax>
<defaultcall function="monitoring_provider"/>
<function name="monitoring_provider" scope="local">
<block name="STAXCurrentFunction">
<try>
<sequence>
<script>
CurrentTestPath['suite']=STAXCurrentFunction
</script>
<call function="'testSuite_Preamble'" />
<call function="'common_setup'">
{
'quickStart' : True ,
'startServer' : True ,
'stopServer' : False
}
</call>
<!--- 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,
'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,
'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,
'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,
'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
#@TestIssue OPENDJ-876
#@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 ,
'knownIssue' : 'OPENDJ-876' }
</call>
<message>'-- Disable the System Info monitor provider --'</message>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'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,
'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,
'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,
'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,
'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,
'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>
</sequence>
<finally>
<sequence>
<!-- Test Suite Cleanup -->
<message>'Finally: Global Monitoring Component 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>