<?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 2007-2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="logging_rotation_properties"/>
<function name="logging_rotation_properties" 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 Rotation Policy Properties Tests
#@TestSuitePurpose Verify the Rotation Policy properties
#@TestSuiteID Logging
#@TestSuiteGroup Logging
#@TestGroup Logging
#@TestScript logging_rotation_properties.xml
#@TestHTMLLink http://opends.dev.java.net/
-->
<!--- Test Case : Rotation policy -->
<!---
#@TestMarker Rotation Policy Properties Tests
#@TestName size limit Rotation policy
#@TestPurpose Check the size limit rotation policy properties.
#@TestPreamble none
#@TestStep Check the size limit rotation policy's properties are correctly set and get using dsconfig
#@TestStep Set a property
#@TestStep Get the property and check it has been correctly updated
#@TestPostamble none
#@TestResult Success if OpenDS returns 0 for all operations
-->
<testcase name="getTestCaseName('size limit Rotation policy')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'---- Check the size limit Rotation policy properties -----'
</message>
<!-- create-log-rotation-policy with the type size-limit -->
<message>'------ create a size limit rotation policy --' </message>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'subcommand' : 'create-log-rotation-policy',
'objectType' : 'policy-name',
'objectName' : 'my size rotation policy',
'optionsString' : '--type size-limit --set file-size-limit:5mb',
'expectedRC' : 0
}
</call>
<message>'------ get file-size-limit --' </message>
<call function="'dsconfigGet'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'objectName' : 'log-rotation-policy',
'propertyType' : 'policy',
'propertyName' : 'my size rotation policy',
'attributeName' : 'file-size-limit',
'expectedAttributeValue' : '5 mb'
}
</call>
<!-- set file-size-limit -->
<message>'------ set file-size-limit to 6kb --' </message>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-log-rotation-policy-prop',
'objectType' : 'policy-name',
'objectName' : 'my size rotation policy',
'optionsString' : '--set file-size-limit:5kb',
'expectedRC' : 0
}
</call>
<message>'------ get file-size-limit --' </message>
<call function="'dsconfigGet'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'objectName' : 'log-rotation-policy',
'propertyType' : 'policy',
'propertyName' : 'my size rotation policy',
'attributeName' : 'file-size-limit',
'expectedAttributeValue' : '5 kb'
}
</call>
<message>'------ delete a size limit rotation policy --' </message>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'subcommand' : 'delete-log-rotation-policy',
'objectType' : 'policy-name',
'objectName' : 'my size rotation policy',
'expectedRC' : 0
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case : time limit Rotation policy -->
<!---
#@TestMarker Rotation Policy Properties Tests
#@TestName time limit Rotation policy
#@TestPurpose Check the time limit rotation policy properties.
#@TestPreamble none
#@TestStep Check the time limit rotation policy's properties are correctly set and get using dsconfig
#@TestStep Set a property
#@TestStep Get the property and check it has been correctly updated
#@TestPostamble none
#@TestResult Success if OpenDS returns 0 for all operations
-->
<testcase name="getTestCaseName('time limit Rotation policy')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'---- Check the time limit Rotation policy properties -----'
</message>
<!-- ################################-->
<!-- create-log-rotation-policy with the type time-limit -->
<message>
'------ create a time limit rotation policy --'
</message>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'subcommand' : 'create-log-rotation-policy',
'objectType' : 'policy-name',
'objectName' : 'my time rotation policy',
'optionsString' : '--type time-limit --set rotation-interval:3d',
'expectedRC' : 0
}
</call>
<message>'------ get rotation-interval --' </message>
<call function="'dsconfigGet'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'objectName' : 'log-rotation-policy',
'propertyType' : 'policy',
'propertyName' : 'my time rotation policy',
'attributeName' : 'rotation-interval',
'extraParams' : '-m d',
'expectedAttributeValue' : '3 d'
}
</call>
<!-- set rotation-interval -->
<message>'------ set rotation-interval to 3s --' </message>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'subcommand' : 'set-log-rotation-policy-prop',
'objectType' : 'policy-name',
'objectName' : 'my time rotation policy',
'optionsString' : '--set rotation-interval:3s',
'expectedRC' : 0
}
</call>
<message>'------ get rotation-interval --' </message>
<call function="'dsconfigGet'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'objectName' : 'log-rotation-policy',
'propertyType' : 'policy',
'propertyName' : 'my time rotation policy',
'attributeName' : 'rotation-interval',
'extraParams' : '-m s',
'expectedAttributeValue' : '3 s'
}
</call>
<message>'------ delete a time limit rotation policy --' </message>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'subcommand' : 'delete-log-rotation-policy',
'objectType' : 'policy-name',
'objectName' : 'my time rotation policy',
'expectedRC' : 0
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case : fixed time limit Rotation policy -->
<!---
#@TestMarker Rotation Policy Properties Tests
#@TestName fixed time limit Rotation policy
#@TestIssue
#@TestPurpose Check the fixed time limit rotation policy properties.
#@TestPreamble none
#@TestStep Check the fixed time limit rotation policy's properties are correctly set and get using dsconfig
#@TestStep Set a property
#@TestStep Get the property and check it has been correctly updated
#@TestPostamble none
#@TestResult Success if OpenDS returns 0 for all operations
-->
<testcase name="getTestCaseName('fixed time limit Rotation policy')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'---- Check the fixed time limit Rotation policy properties -----'
</message>
<!-- create-log-rotation-policy with the type fixed-time -->
<message>'------ create a fixed time limit rotation policy --' </message>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'subcommand' : 'create-log-rotation-policy',
'objectType' : 'policy-name',
'objectName' : 'my fixedtime rotation policy',
'optionsString' : '--type fixed-time --set time-of-day:1203',
'expectedRC' : 0
}
</call>
<message>'------ get time-of-day --' </message>
<call function="'dsconfigGet'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'objectName' : 'log-rotation-policy',
'propertyType' : 'policy',
'propertyName' : 'my fixedtime rotation policy',
'attributeName' : 'time-of-day',
'expectedAttributeValue' : '1203'
}
</call>
<!-- set time-of-day -->
<message>'------ set time-of-day to 3s --' </message>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'subcommand' : 'set-log-rotation-policy-prop',
'objectType' : 'policy-name',
'objectName' : 'my fixedtime rotation policy',
'optionsString' : '--set time-of-day:0934',
'expectedRC' : 0
}
</call>
<message>'------ get time-of-day --' </message>
<call function="'dsconfigGet'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'objectName' : 'log-rotation-policy' ,
'propertyType' : 'policy' ,
'propertyName' : 'my fixedtime rotation policy',
'attributeName' : 'time-of-day',
'expectedAttributeValue' : '0934'
}
</call>
<!-- delete-log-rotation-policy with the type fixed-time -->
<message>'------ delete a fixed time limit rotation policy --' </message>
<call function="'dsconfig'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'subcommand' : 'delete-log-rotation-policy',
'objectType' : 'policy-name',
'objectName' : 'my fixedtime rotation policy',
'expectedRC' : 0
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
</sequence>
<finally>
<sequence>
<!-- Test Suite Cleanup -->
<message>'Finally: Global Log Rotation Properties 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>