From 7618e56a4348e72c93b3b6dfaf2d483101e9109b Mon Sep 17 00:00:00 2001
From: al_xipe <al_xipe@localhost>
Date: Sat, 25 Aug 2007 12:21:54 +0000
Subject: [PATCH] massive retrofit of the logging tests into the framework
---
opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_writer.xml | 531 +++----
opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_rotation.xml | 499 +++---
opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_setup.xml | 82
opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_properties.xml | 2214 +++++++++++++++++----------------
opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_retention.xml | 481 +++---
opendj-sdk/opends/tests/functional-tests/testcases/logging/logging.xml | 56
opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_cleanup.xml | 82
7 files changed, 1,999 insertions(+), 1,946 deletions(-)
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging.xml b/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging.xml
index 5ad5a5d..f160f83 100755
--- a/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging.xml
@@ -26,56 +26,26 @@
! Portions Copyright 2006-2007 Sun Microsystems, Inc.
! -->
<stax>
-
<defaultcall function="main_logging"/>
-
<function name="main_logging">
-
<sequence>
-
<block name="'logging'">
-
<sequence>
-
- <script>
- CurrentTestPath['group']='logging'
- CurrentTestPath['suite']=STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
- file="'%s/testcases/logging/logging_setup.xml' % (TESTS_DIR)"/>
- <call function="'logging_setup'"/>
-
- <import machine="'%s' % STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/logging/logging_rotation.xml' % (TESTS_DIR)"/>
- <call function="'logging_rotation'" />
-
- <import machine="'%s' % STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/logging/logging_properties.xml' % (TESTS_DIR)"/>
- <call function="'logging_properties'" />
-
- <import machine="'%s' % STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/logging/logging_writer.xml' % (TESTS_DIR)"/>
- <call function="'logging_writer'" />
-
- <import machine="'%s' % STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/logging/logging_retention.xml' % (TESTS_DIR)"/>
- <call function="'logging_retention'" />
-
- <import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
- file="'%s/testcases/logging/logging_cleanup.xml' % (TESTS_DIR)"/>
- <call function="'logging_cleanup'"/>
-
- <call function="'testSuite_Postamble'"/>
-
+ <script>
+ CurrentTestPath['group']=STAXCurrentBlock
+ </script>
+
+ <call function="'testGroup_Preamble'" />
+ <iterate var="_test" in="['setup','rotation','properties','writer','retention','cleanup']" >
+ <sequence>
+ <import machine="STAF_LOCAL_HOSTNAME"
+ file="'%s/testcases/logging/logging_%s.xml' % (TESTS_DIR,_test)"/>
+ <call function="'logging_%s' % _test" />
+ </sequence>
+ </iterate>
+ <call function="'testGroup_Postamble'" />
</sequence>
-
</block>
-
</sequence>
-
</function>
-
</stax>
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_cleanup.xml b/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_cleanup.xml
index 74584b2..bc8dfe4 100755
--- a/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_cleanup.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_cleanup.xml
@@ -26,69 +26,55 @@
! Portions Copyright 2007 Sun Microsystems, Inc.
! -->
<stax>
-
<defaultcall function="logging_cleanup"/>
-
<function name="logging_cleanup">
-
<sequence>
-
<block name="'cleanup'">
-
<sequence>
-
-
- <block name="'Block DS Process Stop'">
+ <block name="'Block DS Process Stop'">
<!--- Stop DS -->
- <sequence>
+ <sequence>
<message>
- 'Stop DS running on port %s' % (DIRECTORY_INSTANCE_PORT)
+ '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 }
+ '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>
+ <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>
-
+ </sequence>
+ <!-- End Block Remove DS Topology-->
+ </block>
+ </sequence>
+ </block>
+ </sequence>
</function>
-
</stax>
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_properties.xml b/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_properties.xml
index d4c6782..39ac660 100755
--- a/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_properties.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_properties.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE stax SYSTEM "../../../stax.dtd">
+<!DOCTYPE stax SYSTEM "../../shared/stax.dtd">
<!--
! CDDL HEADER START
!
@@ -26,1079 +26,1157 @@
! Portions Copyright 2006-2007 Sun Microsystems, Inc.
! -->
<stax>
-
-<defaultcall function="logging_properties"/>
-<function name="logging_properties" scope="local">
-
-<sequence>
-
- <!--- Test Case : access logger -->
- <!---
- #@TestMarker access logger
- #@TestName access logger properties check
- #@TestIssue
- #@TestPurpose check the access logger properties.
- #@TestPreamble none
- #@TestStep Check the Access Logger'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
+ <defaultcall function="logging_properties"/>
+ <function name="logging_properties" scope="local">
+ <sequence>
+ <script>
+ CurrentTestPath['suite']=STAXCurrentFunction
+ </script>
+ <call function="'testSuite_Preamble'" />
+ <!--- Test Case : access logger -->
+ <!---
+ #@TestMarker access logger
+ #@TestName access logger properties check
+ #@TestIssue
+ #@TestPurpose check the access logger properties.
+ #@TestPreamble none
+ #@TestStep Check the Access Logger'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="'logging : properties checks: Access logger '">
-
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '---- Check the Access logger s properties -----'
- </message>
-
- <!-- create a logger publisher-->
- <message>'------ create logger publisher --' </message>
-
- <!-- DESACTRIVATED : bug 2107]-->
- <call function="'testFailed'"/>
- <script>
- bug=2107
- </script>
- <if expr="bug == 0">
- <sequence>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'create-log-publisher' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--type file-based-access --set asynchronous:false --set log-file-mode:555 --set log-file:logs/access --set enabled:true ',
- 'expectedRC' : 0 }
- </call>
- </sequence>
- </if>
-
- <!-- auto-flush -->
- <message>'------ set auto-flush to true --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--set auto-flush:true',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get auto-flush --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'File-Based Access Logger',
- 'attributeName' : 'auto-flush',
- 'expectedAttributeValue' : 'true' }
- </call>
-
- <!-- append -->
- <message>'------ set append to false --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--set append:false',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get append --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'File-Based Access Logger',
- 'attributeName' : 'append',
- 'expectedAttributeValue' : 'false' }
- </call>
-
- <!-- asynchronous -->
- <message>'------ set asynchronous to true --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--set asynchronous:true',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get asynchronous --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'File-Based Access Logger',
- 'attributeName' : 'asynchronous',
- 'expectedAttributeValue' : 'true' }
- </call>
-
- <!-- buffer-size -->
- <message>'------ set buffer-size to 10mb --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--set buffer-size:10mb',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get buffer-size --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'File-Based Access Logger',
- 'attributeName' : 'buffer-size',
- 'expectedAttributeValue' : '10 mb' }
- </call>
-
- <!-- time-interval -->
- <message>'------ set time-interval to 3m --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--set time-interval:3m',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get time-interval --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'File-Based Access Logger',
- 'attributeName' : 'time-interval',
- 'extraParams' : '-M s',
- 'expectedAttributeValue' : '180 s' }
- </call>
-
- <!-- log-file -->
- <message>'------ set log-file to logs/testaccess --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--set log-file:logs/testaccess',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get log-file --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'File-Based Access Logger',
- 'attributeName' : 'log-file',
- 'expectedAttributeValue' : 'logs/testaccess' }
- </call>
- <!-- log-file -->
- <message>'------ set log-file to logs/access --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--set log-file:logs/access',
- 'expectedRC' : 0 }
- </call>
+ <testcase name="getTestCaseName('Access logger')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '---- Check the Access logger s properties -----'
+ </message>
- <!-- log-file-mode -->
- <message>'------ set log-file-mode to 777 --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--set log-file-mode:777',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get log-file-mode --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'File-Based Access Logger',
- 'attributeName' : 'log-file-mode',
- 'expectedAttributeValue' : '777' }
- </call>
-
- <!-- queue-size -->
- <message>'------ set queue-size to 1000 --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--set queue-size:1000',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get queue-size --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'File-Based Access Logger',
- 'attributeName' : 'queue-size',
- 'expectedAttributeValue' : '1000' }
- </call>
-
- <!-- suppress-synchronization-operations -->
- <message>'------ set suppress-synchronization-operations to 1000 --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--set suppress-synchronization-operations:true',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get suppress-synchronization-operations --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'File-Based Access Logger',
- 'attributeName' : 'suppress-synchronization-operations',
- 'expectedAttributeValue' : 'true' }
- </call>
+ <!-- create a logger publisher-->
+ <message>
+ '------ create logger publisher --'
+ </message>
-
- <!-- suppress-internal-operations -->
- <message>'------ set suppress-internal-operations to false --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--set suppress-internal-operations:false',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get suppress-synchronization-operations --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'File-Based Access Logger',
- 'attributeName' : 'suppress-internal-operations',
- 'expectedAttributeValue' : 'false' }
- </call>
-
- <!-- delete a logger publisher-->
- <if expr="bug == 0">
- <sequence>
- <message>'------ delete logger publisher --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'delete-log-publisher' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'expectedRC' : 0 }
- </call>
- </sequence>
- </if>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case : Error logger -->
- <!---
- #@TestMarker error logger
- #@TestName error logger properties check
- #@TestIssue
- #@TestPurpose check the error logger properties.
- #@TestPreamble none
- #@TestStep Check the error Logger'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="'logging : properties checks: Error logger '">
-
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '---- Check the Error logger s properties -----'
- </message>
-
-
- <!-- default-severity -->
- <message>'------ set default-severity to mild-error --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Error Logger',
- 'optionsString' : '--set default-severity:mild-error',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get default-severity --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'File-Based Error Logger',
- 'attributeName' : 'default-severity',
- 'expectedAttributeValue' : 'mild-error' }
- </call>
-
- <!-- override-severity -->
- <message>'------ set override-severity --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Error Logger',
- 'optionsString' : '--set "override-severity:request=info,schema"',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get override-severity --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'File-Based Error Logger',
- 'attributeName' : 'override-severity',
- 'expectedAttributeValue' : 'request=info,schema' }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-
- <!--- Test Case : Debug logger -->
- <!---
- #@TestMarker Debug logger
- #@TestName Debug logger properties check
- #@TestIssue
- #@TestPurpose check the Debug logger properties.
- #@TestPreamble none
- #@TestStep Check the Debug Logger'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="'logging : properties checks: Debug logger '">
-
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '---- Check the Debug loggers properties -----'
- </message>
-
- <!-- default-debug-category -->
- <message>'------ set default-debug-category --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Debug Logger',
- 'optionsString' : '--set default-debug-category:thrown',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get default-debug-category --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'File-Based Debug Logger',
- 'attributeName' : 'default-debug-category',
- 'expectedAttributeValue' : 'thrown' }
- </call>
-
- <!-- default-debug-level -->
- <message>'------ set default-debug-level --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Debug Logger',
- 'optionsString' : '--set default-debug-level:verbose',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get default-debug-level --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'File-Based Debug Logger',
- 'attributeName' : 'default-debug-level',
- 'expectedAttributeValue' : 'verbose' }
- </call>
-
-
- <!-- default-include-throwable-cause -->
- <message>'------ set default-include-throwable-cause --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Debug Logger',
- 'optionsString' : '--set default-include-throwable-cause:true',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get default-include-throwable-cause --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'File-Based Debug Logger',
- 'attributeName' : 'default-include-throwable-cause',
- 'expectedAttributeValue' : 'true' }
- </call>
-
-
- <!-- default-omit-method-entry-arguments -->
- <message>'------ set default-omit-method-entry-arguments --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Debug Logger',
- 'optionsString' : '--set default-omit-method-entry-arguments:true',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get default-omit-method-entry-arguments --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'File-Based Debug Logger',
- 'attributeName' : 'default-omit-method-entry-arguments',
- 'expectedAttributeValue' : 'true' }
- </call>
-
-
- <!-- default-omit-method-return-value -->
- <message>'------ set default-include-throwable-cause --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Debug Logger',
- 'optionsString' : '--set default-omit-method-return-value:true',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get default-omit-method-return-value --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'File-Based Debug Logger',
- 'attributeName' : 'default-omit-method-return-value',
- 'expectedAttributeValue' : 'true' }
- </call>
-
-
- <!-- default-throwable-stack-frames -->
- <message>'------ set default-throwable-stack-frames --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Debug Logger',
- 'optionsString' : '--set default-throwable-stack-frames:2',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get default-throwable-stack-frames --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'File-Based Debug Logger',
- 'attributeName' : 'default-throwable-stack-frames',
- 'expectedAttributeValue' : '2' }
- </call>
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
- <!--- Test Case : Rotation policy -->
- <!---
- #@TestMarker Rotation policy
- #@TestName Check dsconfig properties of Rotation policy
- #@TestIssue
- #@TestPurpose check the rotation policy properties.
- #@TestPreamble none
- #@TestStep Check the 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="'logging : properties checks: Rotation policy '">
-
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '---- Check the 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,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- '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>
-
+ <!-- DESACTRIVATED : bug 2107]-->
+ <!--<call function="'testFailed'"/>-->
+ <script>
+ bug=2107
+ </script>
+ <if expr="bug == 0">
+ <sequence>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'create-log-publisher',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--type file-based-access --set asynchronous:false --set log-file-mode:555 --set log-file:logs/access --set enabled:true ',
+ 'expectedRC' : 0
+ }
+ </call>
+ </sequence>
+ </if>
- <message>'------ get file-size-limit --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- '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,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- '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,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- '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,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'delete-log-rotation-policy' ,
- 'objectType' : 'policy-name' ,
- 'objectName' : 'my size rotation policy',
- 'expectedRC' : 0 }
- </call>
-
- <!-- ################################-->
- <!-- create-log-rotation-policy with the type time-limit -->
- <message>'------ create a time limit rotation policy --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- '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,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- '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,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- '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,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- '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,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'delete-log-rotation-policy' ,
- 'objectType' : 'policy-name' ,
- 'objectName' : 'my time rotation policy',
- 'expectedRC' : 0 }
- </call>
-
- <!-- ################################-->
- <!-- 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,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- '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,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- '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,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- '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,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- '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,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- '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>
-
-
-
- <!--- Test Case : Retention policy -->
- <!---
- #@TestMarker retention policy
- #@TestName Check dsconfig properties of retention policy
- #@TestIssue
- #@TestPurpose check the retention policy properties.
- #@TestPreamble none
- #@TestStep Check the retention 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
+ <!-- auto-flush -->
+ <message>'------ set auto-flush to true --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--set auto-flush:true',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>
+ '------ get auto-flush --'
+ </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Access Logger',
+ 'attributeName' : 'auto-flush',
+ 'expectedAttributeValue' : 'true'
+ }
+ </call>
+ <!-- append -->
+ <message>'------ set append to false --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--set append:false',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get append --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Access Logger',
+ 'attributeName' : 'append',
+ 'expectedAttributeValue' : 'false'
+ }
+ </call>
+
+ <!-- asynchronous -->
+ <message>'------ set asynchronous to true --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--set asynchronous:true',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get asynchronous --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'objectName' : 'log-publisher' ,
+ 'propertyType' : 'publisher' ,
+ 'propertyName' : 'File-Based Access Logger',
+ 'attributeName' : 'asynchronous',
+ 'expectedAttributeValue' : 'true' }
+ </call>
+
+ <!-- buffer-size -->
+ <message>'------ set buffer-size to 10mb --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-log-publisher-prop' ,
+ 'objectType' : 'publisher-name' ,
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--set buffer-size:10mb',
+ 'expectedRC' : 0 }
+ </call>
+ <message>'------ get buffer-size --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Access Logger',
+ 'attributeName' : 'buffer-size',
+ 'expectedAttributeValue' : '10 mb'
+ }
+ </call>
+
+ <!-- time-interval -->
+ <message>'------ set time-interval to 3m --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--set time-interval:3m',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get time-interval --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Access Logger',
+ 'attributeName' : 'time-interval',
+ 'extraParams' : '-M s',
+ 'expectedAttributeValue' : '180 s'
+ }
+ </call>
+
+ <!-- log-file -->
+ <message>'------ set log-file to logs/testaccess --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--set log-file:logs/testaccess',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get log-file --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Access Logger',
+ 'attributeName' : 'log-file',
+ 'expectedAttributeValue' : 'logs/testaccess'
+ }
+ </call>
+ <!-- log-file -->
+ <message>'------ set log-file to logs/access --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--set log-file:logs/access',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <!-- log-file-mode -->
+ <message>'------ set log-file-mode to 777 --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--set log-file-mode:777',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get log-file-mode --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Access Logger',
+ 'attributeName' : 'log-file-mode',
+ 'expectedAttributeValue' : '777'
+ }
+ </call>
+
+ <!-- queue-size -->
+ <message>'------ set queue-size to 1000 --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--set queue-size:1000',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get queue-size --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Access Logger',
+ 'attributeName' : 'queue-size',
+ 'expectedAttributeValue' : '1000'
+ }
+ </call>
+
+ <!-- suppress-synchronization-operations -->
+ <message>
+ '------ set suppress-synchronization-operations to 1000 --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--set suppress-synchronization-operations:true',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>
+ '------ get suppress-synchronization-operations --'
+ </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Access Logger',
+ 'attributeName' : 'suppress-synchronization-operations',
+ 'expectedAttributeValue' : 'true'
+ }
+ </call>
+
+ <!-- suppress-internal-operations -->
+ <message>
+ '------ set suppress-internal-operations to false --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--set suppress-internal-operations:false',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>
+ '------ get suppress-synchronization-operations --'
+ </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Access Logger',
+ 'attributeName' : 'suppress-internal-operations',
+ 'expectedAttributeValue' : 'false'
+ }
+ </call>
+
+ <!-- delete a logger publisher-->
+ <if expr="bug == 0">
+ <sequence>
+ <message>'------ delete logger publisher --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'delete-log-publisher',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'expectedRC' : 0
+ }
+ </call>
+ </sequence>
+ </if>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case : Error logger -->
+ <!---
+ #@TestMarker error logger
+ #@TestName error logger properties check
+ #@TestIssue
+ #@TestPurpose check the error logger properties.
+ #@TestPreamble none
+ #@TestStep Check the error Logger'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="'logging : properties checks: retention policy '">
-
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '---- Check the retention policy properties -----'
- </message>
-
-
- <!-- create-log-retention-policy with the type size-limit -->
- <message>'------ create a size limit retention policy --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'create-log-retention-policy' ,
- 'objectType' : 'policy-name' ,
- 'objectName' : 'my size retention policy',
- 'optionsString' : '--type size-limit --set disk-space-used:5mb',
- 'expectedRC' : 0 }
- </call>
-
-
- <message>'------ get file-size-limit --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-retention-policy' ,
- 'propertyType' : 'policy' ,
- 'propertyName' : 'my size retention policy',
- 'attributeName' : 'disk-space-used',
- 'expectedAttributeValue' : '5 mb' }
- </call>
-
- <!-- set disk-space-used -->
- <message>'------ set file-size-limit to 5kb --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-retention-policy-prop' ,
- 'objectType' : 'policy-name' ,
- 'objectName' : 'my size retention policy',
- 'optionsString' : '--set disk-space-used:5kb',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get disk-space-used --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-retention-policy' ,
- 'propertyType' : 'policy' ,
- 'propertyName' : 'my size retention policy',
- 'attributeName' : 'disk-space-used',
- 'expectedAttributeValue' : '5 kb' }
- </call>
-
- <message>'------ delete a size limit retention policy --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'delete-log-retention-policy' ,
- 'objectType' : 'policy-name' ,
- 'objectName' : 'my size retention policy',
- 'expectedRC' : 0 }
- </call>
-
- <!-- ################################-->
- <!-- create-log-retention-policy with the type free-disk-space -->
- <message>'------ create a free-disk-space limit retention policy --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'create-log-retention-policy' ,
- 'objectType' : 'policy-name' ,
- 'objectName' : 'my free-disk-space retention policy',
- 'optionsString' : '--type free-disk-space --set free-disk-space:6Gb',
- 'expectedRC' : 0 }
- </call>
-
- <message>'------ get free_disk-space --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-retention-policy' ,
- 'propertyType' : 'policy' ,
- 'propertyName' : 'my free-disk-space retention policy',
- 'attributeName' : 'free-disk-space',
- 'expectedAttributeValue' : '6 gb' }
- </call>
-
- <!-- set free_disk-space -->
- <message>'------ set free_disk-space to 4mb --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-retention-policy-prop' ,
- 'objectType' : 'policy-name' ,
- 'objectName' : 'my free-disk-space retention policy',
- 'optionsString' : '--set free-disk-space:4mb',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get free_disk-space --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-retention-policy' ,
- 'propertyType' : 'policy' ,
- 'propertyName' : 'my free-disk-space retention policy',
- 'attributeName' : 'free-disk-space',
- 'expectedAttributeValue' : '4 mb' }
- </call>
-
- <message>'------ delete a free-disk-space retention policy --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'delete-log-retention-policy' ,
- 'objectType' : 'policy-name' ,
- 'objectName' : 'my free-disk-space retention policy',
- 'expectedRC' : 0 }
- </call>
-
- <!-- ################################-->
- <!-- create-log-retention-policy with the type file-count -->
- <message>'------ create a fixed time limit retention policy --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'create-log-retention-policy' ,
- 'objectType' : 'policy-name' ,
- 'objectName' : 'my filecount retention policy',
- 'optionsString' : '--type file-count --set number-of-files:10',
- 'expectedRC' : 0 }
- </call>
-
- <message>'------ get number-of-files --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-retention-policy' ,
- 'propertyType' : 'policy' ,
- 'propertyName' : 'my filecount retention policy',
- 'attributeName' : 'number-of-files',
- 'expectedAttributeValue' : '10' }
- </call>
-
- <!-- set number-of-files -->
- <message>'------ set number-of-files to 32 --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-retention-policy-prop' ,
- 'objectType' : 'policy-name' ,
- 'objectName' : 'my filecount retention policy',
- 'optionsString' : '--set number-of-files:32',
- 'expectedRC' : 0 }
- </call>
- <message>'------ get number-of-files --' </message>
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-retention-policy' ,
- 'propertyType' : 'policy' ,
- 'propertyName' : 'my filecount retention policy',
- 'attributeName' : 'number-of-files',
- 'expectedAttributeValue' : '32' }
- </call>
-
- <!-- delete-log-retention-policy with the type file-count -->
- <message>'------ delete a fixed file-count retention policy --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'delete-log-retention-policy' ,
- 'objectType' : 'policy-name' ,
- 'objectName' : 'my filecount retention policy',
- 'expectedRC' : 0 }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
+ <testcase name="getTestCaseName('Error logger')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '---- Check the Error logger s properties -----'
+ </message>
+ <!-- default-severity -->
+ <message>
+ '------ set default-severity to mild-error --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Error Logger',
+ 'optionsString' : '--set default-severity:mild-error',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get default-severity --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Error Logger',
+ 'attributeName' : 'default-severity',
+ 'expectedAttributeValue' : 'mild-error'
+ }
+ </call>
+
+ <!-- override-severity -->
+ <message>'------ set override-severity --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Error Logger',
+ 'optionsString' : '--set "override-severity:request=info,schema"',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>
+ '------ get override-severity --'
+ </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Error Logger',
+ 'attributeName' : 'override-severity',
+ 'expectedAttributeValue' : 'request=info,schema'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
-</sequence>
-</function>
-
+ <!--- Test Case : Debug logger -->
+ <!---
+ #@TestMarker Debug logger
+ #@TestName Debug logger properties check
+ #@TestIssue
+ #@TestPurpose check the Debug logger properties.
+ #@TestPreamble none
+ #@TestStep Check the Debug Logger'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('Debug logger')">
+ <sequence>
+ <call function="'testCase_Preamble'" />
+ <message>
+ '---- Check the Debug loggers properties -----'
+ </message>
+
+ <!-- default-debug-category -->
+ <message>'------ set default-debug-category --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Debug Logger',
+ 'optionsString' : '--set default-debug-category:thrown',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get default-debug-category --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Debug Logger',
+ 'attributeName' : 'default-debug-category',
+ 'expectedAttributeValue' : 'thrown'
+ }
+ </call>
+
+ <!-- default-debug-level -->
+ <message>'------ set default-debug-level --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Debug Logger',
+ 'optionsString' : '--set default-debug-level:verbose',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get default-debug-level --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Debug Logger',
+ 'attributeName' : 'default-debug-level',
+ 'expectedAttributeValue' : 'verbose'
+ }
+ </call>
+
+ <!-- default-include-throwable-cause -->
+ <message>
+ '------ set default-include-throwable-cause --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Debug Logger',
+ 'optionsString' : '--set default-include-throwable-cause:true',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get default-include-throwable-cause --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Debug Logger',
+ 'attributeName' : 'default-include-throwable-cause',
+ 'expectedAttributeValue' : 'true'
+ }
+ </call>
+
+ <!-- default-omit-method-entry-arguments -->
+ <message>
+ '------ set default-omit-method-entry-arguments --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Debug Logger',
+ 'optionsString' : '--set default-omit-method-entry-arguments:true',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>
+ '------ get default-omit-method-entry-arguments --'
+ </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Debug Logger',
+ 'attributeName' : 'default-omit-method-entry-arguments',
+ 'expectedAttributeValue' : 'true'
+ }
+ </call>
+
+ <!-- default-omit-method-return-value -->
+ <message>
+ '------ set default-include-throwable-cause --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-log-publisher-prop' ,
+ 'objectType' : 'publisher-name' ,
+ 'objectName' : 'File-Based Debug Logger',
+ 'optionsString' : '--set default-omit-method-return-value:true',
+ 'expectedRC' : 0 }
+ </call>
+ <message>'------ get default-omit-method-return-value --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Debug Logger',
+ 'attributeName' : 'default-omit-method-return-value',
+ 'expectedAttributeValue' : 'true'
+ }
+ </call>
+
+ <!-- default-throwable-stack-frames -->
+ <message>
+ '------ set default-throwable-stack-frames --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Debug Logger',
+ 'optionsString' : '--set default-throwable-stack-frames:2',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get default-throwable-stack-frames --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Debug Logger',
+ 'attributeName' : 'default-throwable-stack-frames',
+ 'expectedAttributeValue' : '2'
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+
+ <!--- Test Case : Rotation policy -->
+ <!---
+ #@TestMarker Rotation policy
+ #@TestName Check dsconfig properties of Rotation policy
+ #@TestIssue
+ #@TestPurpose check the rotation policy properties.
+ #@TestPreamble none
+ #@TestStep Check the 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('Rotation policy')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '---- Check the 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,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ '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,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ '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,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ '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,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ '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,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'delete-log-rotation-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my size rotation policy',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <!-- ################################-->
+ <!-- create-log-rotation-policy with the type time-limit -->
+ <message>
+ '------ create a time limit rotation policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ '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,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ '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,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ '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,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ '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,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'delete-log-rotation-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my time rotation policy',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <!-- ################################-->
+ <!-- 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,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ '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,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ '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,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ '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,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ '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,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ '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>
+
+
+ <!--- Test Case : Retention policy -->
+ <!---
+ #@TestMarker retention policy
+ #@TestName Check dsconfig properties of retention policy
+ #@TestIssue
+ #@TestPurpose check the retention policy properties.
+ #@TestPreamble none
+ #@TestStep Check the retention 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('retention policy')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '---- Check the retention policy properties -----'
+ </message>
+ <!-- create-log-retention-policy with the type size-limit -->
+ <message>
+ '------ create a size limit retention policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'create-log-retention-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my size retention policy',
+ 'optionsString' : '--type size-limit --set disk-space-used:5mb',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get file-size-limit --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-retention-policy',
+ 'propertyType' : 'policy',
+ 'propertyName' : 'my size retention policy',
+ 'attributeName' : 'disk-space-used',
+ 'expectedAttributeValue' : '5 mb'
+ }
+ </call>
+
+ <!-- set disk-space-used -->
+ <message>'------ set file-size-limit to 5kb --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-retention-policy-prop',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my size retention policy',
+ 'optionsString' : '--set disk-space-used:5kb',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get disk-space-used --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-retention-policy',
+ 'propertyType' : 'policy',
+ 'propertyName' : 'my size retention policy',
+ 'attributeName' : 'disk-space-used',
+ 'expectedAttributeValue' : '5 kb'
+ }
+ </call>
+
+ <message>
+ '------ delete a size limit retention policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'delete-log-retention-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my size retention policy',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <!-- ################################-->
+ <!-- create-log-retention-policy with the type free-disk-space -->
+ <message>
+ '------ create a free-disk-space limit retention policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'create-log-retention-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my free-disk-space retention policy',
+ 'optionsString' : '--type free-disk-space --set free-disk-space:6Gb',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <message>
+ '------ get free_disk-space --'
+ </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'objectName' : 'log-retention-policy' ,
+ 'propertyType' : 'policy' ,
+ 'propertyName' : 'my free-disk-space retention policy',
+ 'attributeName' : 'free-disk-space',
+ 'expectedAttributeValue' : '6 gb'
+ }
+ </call>
+
+ <!-- set free_disk-space -->
+ <message>'------ set free_disk-space to 4mb --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-retention-policy-prop',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my free-disk-space retention policy',
+ 'optionsString' : '--set free-disk-space:4mb',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get free_disk-space --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-retention-policy',
+ 'propertyType' : 'policy',
+ 'propertyName' : 'my free-disk-space retention policy',
+ 'attributeName' : 'free-disk-space',
+ 'expectedAttributeValue' : '4 mb'
+ }
+ </call>
+
+ <message>
+ '------ delete a free-disk-space retention policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'delete-log-retention-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my free-disk-space retention policy',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <!-- ################################-->
+ <!-- create-log-retention-policy with the type file-count -->
+ <message>
+ '------ create a fixed time limit retention policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'create-log-retention-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my filecount retention policy',
+ 'optionsString' : '--type file-count --set number-of-files:10',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <message>'------ get number-of-files --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'objectName' : 'log-retention-policy' ,
+ 'propertyType' : 'policy' ,
+ 'propertyName' : 'my filecount retention policy',
+ 'attributeName' : 'number-of-files',
+ 'expectedAttributeValue' : '10'
+ }
+ </call>
+
+ <!-- set number-of-files -->
+ <message>'------ set number-of-files to 32 --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-retention-policy-prop',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my filecount retention policy',
+ 'optionsString' : '--set number-of-files:32',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>'------ get number-of-files --' </message>
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-retention-policy',
+ 'propertyType' : 'policy',
+ 'propertyName' :'my filecount retention policy',
+ 'attributeName' : 'number-of-files',
+ 'expectedAttributeValue' : '32'
+ }
+ </call>
+
+ <!-- delete-log-retention-policy with the type file-count -->
+ <message>
+ '------ delete a fixed file-count retention policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'delete-log-retention-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my filecount retention policy',
+ 'expectedRC' : 0
+ }
+ </call>
+ <call function="'testCase_Postamble'"/>
+ </sequence>
+ </testcase>
+ <call function="'testSuite_Postamble'" />
+ </sequence>
+ </function>
</stax>
-
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_retention.xml b/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_retention.xml
index 2fb6c94..b5ec10b 100755
--- a/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_retention.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_retention.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE stax SYSTEM "../../../stax.dtd">
+<!DOCTYPE stax SYSTEM "../../shared/stax.dtd">
<!--
! CDDL HEADER START
!
@@ -26,232 +26,257 @@
! Portions Copyright 2006-2007 Sun Microsystems, Inc.
! -->
<stax>
-
-<defaultcall function="logging_retention"/>
-<function name="logging_retention" scope="local">
-
-<sequence>
-
-<!--- Test Case : retention policy -->
-<!---
-#@TestMarker size limit retention
-#@TestName size limit retention
-#@TestIssue Check the size limit retention policy
-#@TestPreamble none
-#@TestStep Create a new size limit retention policy
-#@TestStep Configure the Size Limit retention policy with a Max file to 3
-#@TestStep Execute ldapsearch request until the log are cleaned
-#@TestPostamble none
-#@TestResult the number of logs must not exceed 3
- -->
-
-
- <testcase name="'logging : Retention policy : file count '">
-
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '---- Check the file count -----'
- </message>
-
- <!-- set the max number of files to keep -->
- <script>
- numberFiles=5
- maxFiles=6
- </script>
-
-<call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsBaseDN' : DIRECTORY_INSTANCE_SFX,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsFilter' : 'objectclass=*',
- 'dsScope' : 'base',
- 'expectedRC' : 0 }
- </call>
-
- <message>'-- create a new file count retention policy --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'create-log-retention-policy' ,
- 'objectType' : 'policy-name' ,
- 'objectName' : 'my file count retention policy',
- 'optionsString' : '--type file-count --set number-of-files:%s' % (numberFiles),
- 'expectedRC' : 0 }
- </call>
-
- <message>'------ Add this retention policy to the Access log publisher --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--add retention-policy-dn:"cn=my file count retention policy,cn=Log Retention Policies,cn=config"',
- 'expectedRC' : 0 }
- </call>
-
- <message>'-- create a new size limit rotation policy --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'create-log-rotation-policy' ,
- 'objectType' : 'policy-name' ,
- 'objectName' : 'my size Limit Rotation Policy',
- 'optionsString' : '--type size-limit --set file-size-limit:4kb',
- 'expectedRC' : 0 }
- </call>
-
- <message>'------ Add this rotation policy to the Access log publisher --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--add rotation-policy-dn:"cn=my size Limit Rotation Policy,cn=Log Rotation Policies,cn=config"',
- 'expectedRC' : 0 }
- </call>
-
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--add auto-flush:true --set append:true --set asynchronous:false',
- 'expectedRC' : 0 }
- </call>
-
- <!-- Starting loop -->
-
- <!-- Execute ldapsearch until we detect a log rotation -->
- <!-- Check the number of logs files never exceed the number-of-files -->
- <script>
- cpt=0
- error=0
- </script>
-
- <loop from="1" to="10" until="error != 0">
- <sequence>
- <message>'###########################'</message>
- <message>' LOOP %s :' % cpt </message>
- <message>'###########################'</message>
- <message>'--- Execute a Search request ---'</message>
-
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsBaseDN' : DIRECTORY_INSTANCE_SFX,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsFilter' : 'objectclass=*',
- 'dsScope' : 'base',
- 'expectedRC' : 0 }
- </call>
-
- <call function="'listFolder'">
- { 'location' : '%s' % (DIRECTORY_INSTANCE_HOST),
- 'foldername' : '%s/%s/logs' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME),
- 'filename' : 'access'
- }
- </call>
-
- <if expr="int(len(cmdResult)) > maxFiles">
- <sequence>
- <script>
- error=1
- </script>
- <message>'Error, the number of logs files exceed the retention policy'</message>
- <call function="'testFailed'"/>
- </sequence>
- </if>
-
- <script>
- cpt=cpt+1
- </script>
- </sequence>
- </loop>
-
- <if expr="error == 0" >
+ <defaultcall function="logging_retention"/>
+ <function name="logging_retention" scope="local">
+ <block name="STAXCurrentFunction">
<sequence>
- <message>'SUCCESS: the retention policy has been checked'</message>
- <call function="'testPassed'"/>
- </sequence>
- </if>
-
- <!-- cleanup -->
- <message>'------ remove this rotation policy to the Access log publisher --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--remove rotation-policy-dn:"cn=my size Limit Rotation Policy,cn=Log Rotation Policies,cn=config"',
- 'expectedRC' : 0 }
- </call>
-
-
- <message>'------ remove this retention policy to the Access log publisher --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--remove retention-policy-dn:"cn=my file count retention policy,cn=Log Retention Policies,cn=config"',
- 'expectedRC' : 0 }
- </call>
-
-
- <message>'-- delete a new file count retention policy --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'delete-log-retention-policy' ,
- 'objectType' : 'policy-name' ,
- 'objectName' : 'my file count retention policy',
- 'expectedRC' : 0 }
- </call>
-
-
- <message>'-- delete a new size limit rotation policy --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'delete-log-rotation-policy' ,
- 'objectType' : 'policy-name' ,
- 'objectName' : 'my size Limit Rotation Policy',
- 'expectedRC' : 0 }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-</sequence>
-</function>
-
+ <script>
+ CurrentTestPath['suite']=STAXCurrentFunction
+ </script>
+ <call function="'testSuite_Preamble'" />
+ <!--- Test Case : retention policy -->
+ <!---
+ #@TestMarker size limit retention
+ #@TestName size limit retention
+ #@TestIssue Check the size limit retention policy
+ #@TestPreamble none
+ #@TestStep Create a new size limit retention policy
+ #@TestStep Configure the Size Limit retention policy with a Max file to 3
+ #@TestStep Execute ldapsearch request until the log are cleaned
+ #@TestPostamble none
+ #@TestResult the number of logs must not exceed 3
+ -->
+ <testcase name="getTestCaseName('file count')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '---- Check the file count -----'
+ </message>
+ <!-- set the max number of files to keep -->
+ <script>
+ numberFiles=5
+ maxFiles=6
+ </script>
+
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsBaseDN' : DIRECTORY_INSTANCE_SFX,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsFilter' : 'objectclass=*',
+ 'dsScope' : 'base',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <message>
+ '-- create a new file count retention policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'create-log-retention-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my file count retention policy',
+ 'optionsString' : '--type file-count --set number-of-files:%s' % (numberFiles),
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <message>
+ '------ Add this retention policy to the Access log publisher --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--add retention-policy-dn:"cn=my file count retention policy,cn=Log Retention Policies,cn=config"',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>
+ '-- create a new size limit rotation policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'create-log-rotation-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my size Limit Rotation Policy',
+ 'optionsString' : '--type size-limit --set file-size-limit:4kb',
+ 'expectedRC' : 0
+ }
+ </call>
+ <message>
+ '------ Add this rotation policy to the Access log publisher --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--add rotation-policy-dn:"cn=my size Limit Rotation Policy,cn=Log Rotation Policies,cn=config"',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--add auto-flush:true --set append:true --set asynchronous:false',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <!-- Starting loop -->
+
+ <!-- Execute ldapsearch until we detect a log rotation -->
+ <!-- Check the number of logs files never exceed the number-of-files -->
+ <script>
+ cpt=0
+ error=0
+ </script>
+
+ <loop from="1" to="10" until="error != 0">
+ <sequence>
+ <message>'###########################'</message>
+ <message>' LOOP %s :' % cpt </message>
+ <message>'###########################'</message>
+ <message>'--- Execute a Search request ---'</message>
+
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsBaseDN' : DIRECTORY_INSTANCE_SFX,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsFilter' : 'objectclass=*',
+ 'dsScope' : 'base',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <call function="'listFolder'">
+ { 'location' : DIRECTORY_INSTANCE_HOST,
+ 'foldername' : '%s/%s/logs' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME),
+ 'filename' : 'access'
+ }
+ </call>
+
+ <if expr="int(len(cmdResult)) > maxFiles">
+ <sequence>
+ <script>
+ error=1
+ </script>
+ <message>
+ 'Error, the number of logs files exceed the retention policy'
+ </message>
+ <call function="'testFailed'" />
+ </sequence>
+ </if>
+
+ <script>
+ cpt=cpt+1
+ </script>
+ </sequence>
+ </loop>
+
+ <if expr="error == 0" >
+ <sequence>
+ <message>
+ 'SUCCESS: the retention policy has been checked'
+ </message>
+ <call function="'testPassed'"/>
+ </sequence>
+ </if>
+
+ <!-- cleanup -->
+ <message>
+ '------ remove this rotation policy to the Access log publisher --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--remove rotation-policy-dn:"cn=my size Limit Rotation Policy,cn=Log Rotation Policies,cn=config"',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <message>
+ '------ remove this retention policy to the Access log publisher --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--remove retention-policy-dn:"cn=my file count retention policy,cn=Log Retention Policies,cn=config"',
+ 'expectedRC' : 0
+ }
+ </call>
+
+
+ <message>
+ '-- delete a new file count retention policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'delete-log-retention-policy' ,
+ 'objectType' : 'policy-name' ,
+ 'objectName' : 'my file count retention policy',
+ 'expectedRC' : 0
+ }
+ </call>
+
+
+ <message>
+ '-- delete a new size limit rotation policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'delete-log-rotation-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my size Limit Rotation Policy',
+ '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/logging/logging_rotation.xml b/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_rotation.xml
index e672dc0..4141b16 100755
--- a/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_rotation.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_rotation.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE stax SYSTEM "../../../stax.dtd">
+<!DOCTYPE stax SYSTEM "../../shared/stax.dtd">
<!--
! CDDL HEADER START
!
@@ -26,250 +26,265 @@
! Portions Copyright 2006-2007 Sun Microsystems, Inc.
! -->
<stax>
-
-<defaultcall function="logging_rotation"/>
-<function name="logging_rotation" scope="local">
-
-<sequence>
-
-
- <!---
- #@TestMarker size limit rotation
- #@TestName size limit rotation
- #@TestIssue Check the size limit rotation policy
- #@TestPreamble none
- #@TestStep Create a new size limit rotation policy
- #@TestStep Configure the Size Limit rotation policy with a Max size to 4kb
- #@TestStep Execute ldapsearch request until the log are rotate
- #@TestPostamble none
- #@TestResult the logs size must match the rotation size
+ <defaultcall function="logging_rotation"/>
+ <function name="logging_rotation" scope="local">
+ <sequence>
+ <script>
+ CurrentTestPath['suite']=STAXCurrentFunction
+ </script>
+ <call function="'testSuite_Preamble'" />
+ <!---
+ #@TestMarker size limit rotation
+ #@TestName size limit rotation
+ #@TestIssue Check the size limit rotation policy
+ #@TestPreamble none
+ #@TestStep Create a new size limit rotation policy
+ #@TestStep Configure the Size Limit rotation policy with a Max size to 4kb
+ #@TestStep Execute ldapsearch request until the log are rotate
+ #@TestPostamble none
+ #@TestResult the logs size must match the rotation size
-->
-
- <testcase name="'logging : Rotation policy : size limit '">
-
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '---- Check the size limit rotation -----'
- </message>
-
- <message>'-- create a new size limit rotation policy --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'create-log-rotation-policy' ,
- 'objectType' : 'policy-name' ,
- 'objectName' : 'my size Limit Rotation Policy',
- 'optionsString' : '--type size-limit --set file-size-limit:4kb',
- 'expectedRC' : 0 }
- </call>
-
- <message>'------ Add this rotation policy to the Access log publisher --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--add rotation-policy-dn:"cn=my size Limit Rotation Policy,cn=Log Rotation Policies,cn=config"',
- 'expectedRC' : 0 }
- </call>
-
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--add auto-flush:true --set append:true --set asynchronous:false --set buffer-size:64kb',
- 'expectedRC' : 0 }
- </call>
-
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'File-Based Access Logger',
- 'attributeName' : 'rotation-policy-dn'
- }
- </call>
-
-
- <call function="'Sleep'">
+ <testcase name="getTestCaseName('size limit')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '---- Check the size limit rotation -----'
+ </message>
+
+ <message>
+ '-- create a new size limit rotation policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'create-log-rotation-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my size Limit Rotation Policy',
+ 'optionsString' : '--type size-limit --set file-size-limit:4kb',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <message>
+ '------ Add this rotation policy to the Access log publisher --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--add rotation-policy-dn:"cn=my size Limit Rotation Policy,cn=Log Rotation Policies,cn=config"',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--add auto-flush:true --set append:true --set asynchronous:false --set buffer-size:64kb',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Access Logger',
+ 'attributeName' : 'rotation-policy-dn'
+ }
+ </call>
+
+ <call function="'Sleep'">
{ 'sleepForMilliSeconds' : 20000 }
- </call>
-
- <!-- Starting loop -->
- <script>
- listName=[]
- listSize=[]
- </script>
- <script>
- cpt=0
- nbLog=0
- </script>
- <!-- Execute ldapsearch until we detect a log rotation -->
- <!-- Stop when the first rotation is done -->
-
- <loop from="1" to="50" until="RC != 0">
- <sequence>
- <message>'###########################'</message>
- <message>' LOOP %s :' % cpt </message>
- <message>'###########################'</message>
- <message>'--- Execute a Search request ---'</message>
-
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsBaseDN' : DIRECTORY_INSTANCE_SFX,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsFilter' : 'objectclass=*',
- 'dsScope' : 'base',
- 'expectedRC' : 0 }
- </call>
-
-
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'File-Based Access Logger',
- 'attributeName' : 'rotation-policy-dn'
- }
- </call>
-
- <message>'--- Check log files ---'</message>
- <call function="'listFolder'">
- { 'location' : '%s' % (DIRECTORY_INSTANCE_HOST),
- 'foldername' : '%s/%s/logs' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME),
- 'filename' : 'access'
- }
- </call>
-
- <if expr="len(cmdResult) > 0">
- <sequence>
- <iterate var="result" in="cmdResult">
- <sequence>
- <script>
- logname=result["name"]
- logsize=result["size"]
- found=0
- </script>
- <message>'the log file status for file "%s" is %s ' % (logname,logsize)</message>
- <script>
- for currentLog in listName:
- if currentLog == logname:
- found=1
- currentIndex=listName.index(currentLog)
- currentSize=listSize[currentIndex]
- if currentSize != logsize:
- listSize[currentIndex]=logsize
-
- if found == 0:
- if nbLog != 0:
- RC=1
- newlogName=logname
- newlogSize=logsize
- listName.append(logname)
- listSize.append(logsize)
- </script>
- </sequence>
- </iterate>
- <!-- set nbLog when we find a log file -->
+ </call>
+
+ <!-- Starting loop -->
<script>
- nbLog=1
- </script>
- <message>'The new log file status is : %s : %s' % (listName,listSize)</message>
- </sequence>
- </if>
- <script>
- cpt=cpt+1
- </script>
- </sequence>
- </loop>
-
-
- <!-- ############################### -->
- <!-- Check log file size -->
- <!-- all the log file size must be around 4kb -->
- <!-- ############################### -->
-
- <if expr="RC == 1">
- <sequence>
- <message>'A log rotation has been done. The new rotation file is "%s" (size = %s) ' % (newlogName,newlogSize)</message>
-
- <if expr="int(newlogSize) < 4100 and int(newlogSize) > 4000" >
- <sequence>
- <message>'SUCCESS. The rotation based on size limit is successfull. The file "%s" (size = %s) ' % (newlogName,newlogSize)</message>
- <call function="'testPassed'"/>
- </sequence>
- <else>
- <sequence>
- <message>'ERROR in the rotation. The file "%s" (size = %s) does not match the rotation size ' % (newlogName,newlogSize)</message>
- <call function="'testFailed'"/>
- </sequence>
- </else>
- </if>
- </sequence>
- <else>
- <sequence>
- <message>'ERROR. The rotation process didn t work.'</message>
- <call function="'testFailed'"/>
- </sequence>
- </else>
- </if>
-
-
- <!-- ############################### -->
- <!-- clean rotation policy -->
- <!-- ############################### -->
-
- <message>'------ remove this rotation policy to the Access log publisher --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--remove rotation-policy-dn:"cn=my size Limit Rotation Policy,cn=Log Rotation Policies,cn=config"',
- 'expectedRC' : 0 }
- </call>
-
-
- <message>'-- delete a new size limit rotation policy --'</message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'delete-log-rotation-policy' ,
- 'objectType' : 'policy-name' ,
- 'objectName' : 'my size Limit Rotation Policy',
- 'expectedRC' : 0 }
- </call>
-
- <call function="'testCase_Postamble'"/>
- </sequence>
- </testcase>
-
-</sequence>
-</function>
-
+ listName=[]
+ listSize=[]
+ cpt=0
+ nbLog=0
+ </script>
+ <!-- Execute ldapsearch until we detect a log rotation -->
+ <!-- Stop when the first rotation is done -->
+
+ <loop from="1" to="50" until="RC != 0">
+ <sequence>
+ <message>'###########################'</message>
+ <message>' LOOP %s :' % cpt </message>
+ <message>'###########################'</message>
+ <message>'--- Execute a Search request ---'</message>
+
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsBaseDN' : DIRECTORY_INSTANCE_SFX,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsFilter' : 'objectclass=*',
+ 'dsScope' : 'base',
+ 'expectedRC' : 0
+ }
+ </call>
+
+
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Access Logger',
+ 'attributeName' : 'rotation-policy-dn'
+ }
+ </call>
+
+ <message>'--- Check log files ---'</message>
+ <call function="'listFolder'">
+ { 'location' : DIRECTORY_INSTANCE_HOST,
+ 'foldername' : '%s/%s/logs' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME),
+ 'filename' : 'access'
+ }
+ </call>
+
+ <if expr="len(cmdResult) > 0">
+ <sequence>
+ <iterate var="result" in="cmdResult">
+ <sequence>
+ <script>
+ logname=result["name"]
+ logsize=result["size"]
+ found=0
+ </script>
+ <message>
+ 'the log file status for file "%s" is %s ' % (logname,logsize)
+ </message>
+ <script>
+ for currentLog in listName:
+ if currentLog == logname:
+ found=1
+ currentIndex=listName.index(currentLog)
+ currentSize=listSize[currentIndex]
+ if currentSize != logsize:
+ listSize[currentIndex]=logsize
+
+ if found == 0:
+ if nbLog != 0:
+ RC=1
+ newlogName=logname
+ newlogSize=logsize
+ listName.append(logname)
+ listSize.append(logsize)
+ </script>
+ </sequence>
+ </iterate>
+ <!-- set nbLog when we find a log file -->
+ <script>
+ nbLog=1
+ </script>
+ <message>
+ 'The new log file status is : %s : %s' % (listName,listSize)
+ </message>
+ </sequence>
+ </if>
+ <script>
+ cpt=cpt+1
+ </script>
+ </sequence>
+ </loop>
+
+
+ <!-- ############################### -->
+ <!-- Check log file size -->
+ <!-- all the log file size must be around 4kb -->
+ <!-- ############################### -->
+
+ <if expr="RC == 1">
+ <sequence>
+ <message>
+ 'A log rotation has been done. The new rotation file is "%s" (size = %s) ' % (newlogName,newlogSize)
+ </message>
+
+ <if expr="int(newlogSize) < 4100 and int(newlogSize) > 4000" >
+ <sequence>
+ <message>
+ 'SUCCESS. The rotation based on size limit is successfull. The file "%s" (size = %s) ' % (newlogName,newlogSize)
+ </message>
+ <call function="'testPassed'"/>
+ </sequence>
+ <else>
+ <sequence>
+ <message>
+ 'ERROR in the rotation. The file "%s" (size = %s) does not match the rotation size ' % (newlogName,newlogSize)
+ </message>
+ <call function="'testFailed'"/>
+ </sequence>
+ </else>
+ </if>
+ </sequence>
+ <else>
+ <sequence>
+ <message>'ERROR. The rotation process didn t work.'</message>
+ <call function="'testFailed'"/>
+ </sequence>
+ </else>
+ </if>
+
+ <!-- ############################### -->
+ <!-- clean rotation policy -->
+ <!-- ############################### -->
+
+ <message>
+ '------ remove this rotation policy to the Access log publisher --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--remove rotation-policy-dn:"cn=my size Limit Rotation Policy,cn=Log Rotation Policies,cn=config"',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <message>
+ '-- delete a new size limit rotation policy --'
+ </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'delete-log-rotation-policy',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'my size Limit Rotation Policy',
+ 'expectedRC' : 0
+ }
+ </call>
+ <call function="'testCase_Postamble'" />
+ </sequence>
+ </testcase>
+ <call function="'testSuite_Postamble'" />
+ </sequence>
+ </function>
</stax>
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_setup.xml b/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_setup.xml
index e19cbc3..55da17a 100755
--- a/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_setup.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_setup.xml
@@ -26,74 +26,60 @@
! Portions Copyright 2007 Sun Microsystems, Inc.
! -->
<stax>
-
<defaultcall function="logging_setup"/>
-
<function name="logging_setup">
-
<sequence>
-
<block name="'setup'">
-
<sequence>
-
-
- <block name="'Block Create DS Topology'">
- <!-- Create the topology necessary to the test group/suite -->
- <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'
+ 'Create DS topology as described in config.py'
</message>
-
- <call function="'createTopology'">
- { 'initialiseInstance' : True }
- </call>
-
- <call function="'checkRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
+
+ <call function="'createTopology'">
+ { 'initialiseInstance' : True }
</call>
-
- </sequence>
- <!--- End Block Create DS Topology -->
- </block>
-
-
- <block name="'Block DS Process Active'">
- <!--- Start DS -->
- <sequence>
-
+
+ <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)
+ 'Start DS to run on port %s' % (DIRECTORY_INSTANCE_PORT)
</message>
-
+
<!--- Start DS -->
<call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
+ { 'location' : STAF_REMOTE_HOSTNAME }
</call>
-
+
<call function="'checkRC'">
- { 'returncode' : RC ,
- 'result' : STAXResult }
+ { 'returncode' : RC ,
+ 'result' : STAXResult
+ }
</call>
-
+
<!--- Check that DS started -->
<call function="'isAlive'">
{ 'noOfLoops' : 5 ,
- 'noOfMilliSeconds' : 2000 }
- </call>
-
+ 'noOfMilliSeconds' : 2000
+ }
+ </call>
</sequence>
- <!--- End Block DS Process Active -->
- </block>
-
-
- </sequence>
+ <!--- End Block DS Process Active -->
+ </block>
+ </sequence>
</block>
-
</sequence>
-
</function>
-
</stax>
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_writer.xml b/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_writer.xml
index 2494f12..89e2868 100755
--- a/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_writer.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/logging/logging_writer.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE stax SYSTEM "../../../stax.dtd">
+<!DOCTYPE stax SYSTEM "../../shared/stax.dtd">
<!--
! CDDL HEADER START
!
@@ -26,277 +26,270 @@
! Portions Copyright 2006-2007 Sun Microsystems, Inc.
! -->
<stax>
-
-<defaultcall function="logging_writer"/>
-<function name="logging_writer" scope="local">
-
-<sequence>
-
-
-<!-- #################################### -->
-<!--
- #@TestMarker access logger
- #@TestName access logger properties check
- #@TestIssue
- #@TestPurpose check the asynchronous mode with auto-flush works
- #@TestPreamble none
- #@TestStep Set the Access Logger's properties to be an asynchronous mode
- #@TestStep Set the auto-flush to TRUE
- #@TestStep Set the append property to false
- #@TestStep Configure the Size Limit rotation policy with a Max size to 1mb
- #@TestStep Execute ldapsearch request until the log are writen in the disk
- #@TestPostamble none
- #@TestResult The recors must be written to disk after each operation
- -->
-<!-- #################################### -->
-
-
-<testcase name="'logging : Synchronous mode- auto-flush=true : Access logger '">
-
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '---- Check the Synchronous mode for Access loggers -----'
- </message>
-
-
- <message>
- ' asynchronous:false - auto-flush:true - append:false - buffer-size:20kb '
- </message>
-
-
- <message>'------ set properties --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Access Logger',
- 'optionsString' : '--set auto-flush:true --set append:false --set asynchronous:false --set buffer-size:20kb',
- 'expectedRC' : 0 }
- </call>
-
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-rotation-policy-prop' ,
- 'objectType' : 'policy-name' ,
- 'objectName' : 'Size Limit Rotation Policy',
- 'optionsString' : '--set file-size-limit:1mb',
- 'expectedRC' : 0 }
- </call>
-
- <!-- Starting loop -->
- <script>
- listName=[]
- listSize=[]
- </script>
- <script>
- cpt=0
- </script>
-
- <!-- Execute ldapsearch until logs are written to disk -->
- <!-- as auto-flush is true, the logs must be written after each operation -->
- <loop from="1" to="5" until="RC != 0">
- <sequence>
- <message>'###########################'</message>
- <message>' LOOP %s :' % cpt </message>
- <message>'###########################'</message>
- <message>'--- Execute a Search request ---'</message>
-
- <call function="'ldapSearchWithScript'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsBaseDN' : DIRECTORY_INSTANCE_SFX,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
- 'dsFilter' : 'objectclass=*' ,
- 'dsScope' : 'base',
- 'expectedRC' : 0 }
- </call>
-
-
- <call function="'dsconfigGet'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'objectName' : 'log-publisher' ,
- 'propertyType' : 'publisher' ,
- 'propertyName' : 'File-Based Access Logger',
- 'attributeName' : 'rotation-policy-dn'
- }
- </call>
-
- <message>'--- Check log files ---'</message>
- <call function="'listFolder'">
- { 'location' : '%s' % (DIRECTORY_INSTANCE_HOST),
- 'foldername' : '%s/%s/logs' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME),
- 'filename' : 'access'
- }
- </call>
-
- <if expr="len(cmdResult) > 0">
- <sequence>
- <iterate var="result" in="cmdResult">
- <sequence>
- <script>
- logname=result["name"]
- logsize=result["size"]
- found=0
- </script>
- <message>'log file status for file %s is %s ' % (logname,logsize)</message>
- <script>
- for currentLog in listName:
- if currentLog == logname:
- found=1
- currentIndex=listName.index(currentLog)
- currentSize=listSize[currentIndex]
- if currentSize != logsize:
- RC=1
- listSize[currentIndex]=logsize
- break
-
- if found == 0:
- listName.append(logname)
- listSize.append(logsize)
- </script>
- </sequence>
- </iterate>
- </sequence>
- </if>
- <message>'The new log file status is : %s : %s' % (listName,listSize)</message>
- <script>
- cpt=cpt+1
- </script>
- </sequence>
- </loop>
- <message>'The log file status of the file "%s" has changed ' % logname</message>
-
- <!-- Check log file -->
- <!-- records must be writen after each operation -->
- <!-- we should exit the loop after the first ldapsearch -->
- <if expr="cpt != 2">
- <sequence>
- <message>'ERROR. The writer are not flushed after every log records'</message>
- <call function="'testFailed'"/>
- </sequence>
- <else>
- <sequence>
- <message>'SUCCESS. The writer are flushed after every log records' </message>
- <call function="'testPassed'"/>
- </sequence>
- </else>
- </if>
-
- </sequence>
- </testcase>
-
-
-<!-- #################################### -->
-<!--
- #@TestMarker Debug logger
- #@TestName Debug logger properties check
- #@TestIssue
- #@TestPurpose Basic tests on the Debug logger
- #@TestPreamble none
- #@TestStep Enabled the Debug Logger
- #@TestStep Define a spefic log file for debug message
- #@TestStep set the debug-log-level to All
- #@TestStep Restart the server
- #@TestStep Execute a ldapsearch request
- #@TestPostamble none
- #@TestResult Check the debug log file has been created and contains datas
- -->
-<!-- #################################### -->
-
-
-<testcase name="'logging : basic tests on Debug logger '">
-
- <sequence>
- <call function="'testCase_Preamble'"/>
- <message>
- '---- Basic tests on Debug loggers -----'
- </message>
-
- <message>'------ Enabled Debug logger --' </message>
- <call function="'dsconfig'">
- { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'set-log-publisher-prop' ,
- 'objectType' : 'publisher-name' ,
- 'objectName' : 'File-Based Debug Logger',
- 'optionsString' : '--set enabled:true --set default-debug-level:all --set log-file:logs/mydebug',
- 'expectedRC' : 0 }
- </call>
-
- <call function="'RestartDs'">
- { 'dsHost' : DIRECTORY_INSTANCE_HOST,
- 'dsPort' : DIRECTORY_INSTANCE_PORT,
- 'dsBindDN' : DIRECTORY_INSTANCE_DN,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
- </call>
-
- <message>'--- Check log files ---'</message>
- <call function="'listFolder'">
- { 'location' : '%s' % (DIRECTORY_INSTANCE_HOST),
- 'foldername' : '%s/%s/logs' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME),
- 'filename' : 'mydebug'
- }
- </call>
-
- <script>
- error=0
- </script>
- <if expr="len(cmdResult) == 0">
- <sequence>
- <message>'ERROR. The Debug logger should be created'</message>
+ <defaultcall function="logging_writer"/>
+ <function name="logging_writer" scope="local">
+ <sequence>
<script>
- error=1
- </script>
- </sequence>
- <else>
- <sequence>
- <iterate var="result" in="cmdResult">
+ CurrentTestPath['suite']=STAXCurrentFunction
+ </script>
+ <call function="'testSuite_Preamble'"/>
+ <!-- #################################### -->
+ <!--
+ #@TestMarker access logger
+ #@TestName access logger properties check
+ #@TestIssue
+ #@TestPurpose check the asynchronous mode with auto-flush works
+ #@TestPreamble none
+ #@TestStep Set the Access Logger's properties to be an asynchronous mode
+ #@TestStep Set the auto-flush to TRUE
+ #@TestStep Set the append property to false
+ #@TestStep Configure the Size Limit rotation policy with a Max size to 1mb
+ #@TestStep Execute ldapsearch request until the log are writen in the disk
+ #@TestPostamble none
+ #@TestResult The recors must be written to disk after each operation
+ -->
+ <!-- #################################### -->
+ <testcase name="getTestCaseName('Synchronous mode- auto-flush=true - Access logger')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '---- Check the Synchronous mode for Access loggers -----'
+ </message>
+ <message>
+ ' asynchronous:false - auto-flush:true - append:false - buffer-size:20kb '
+ </message>
+ <message>'------ set properties --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Access Logger',
+ 'optionsString' : '--set auto-flush:true --set append:false --set asynchronous:false --set buffer-size:20kb',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-rotation-policy-prop',
+ 'objectType' : 'policy-name',
+ 'objectName' : 'Size Limit Rotation Policy',
+ 'optionsString' : '--set file-size-limit:1mb',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <!-- Starting loop -->
+ <script>
+ listName=[]
+ listSize=[]
+ cpt=0
+ </script>
+
+ <!-- Execute ldapsearch until logs are written to disk -->
+ <!-- as auto-flush is true, the logs must be written after each operation -->
+ <loop from="1" to="5" until="RC != 0">
<sequence>
- <script>
- logsize=result["size"]
- </script>
+ <message>'###########################'</message>
+ <message>' LOOP %s :' % cpt </message>
+ <message>'###########################'</message>
+ <message>'--- Execute a Search request ---'</message>
- <if expr="logsize == 0">
- <sequence>
- <message>'ERROR. The Debug logger should contain data'</message>
+ <call function="'ldapSearchWithScript'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsBaseDN' : DIRECTORY_INSTANCE_SFX,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'dsFilter' : 'objectclass=*',
+ 'dsScope' : 'base',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <call function="'dsconfigGet'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'objectName' : 'log-publisher',
+ 'propertyType' : 'publisher',
+ 'propertyName' : 'File-Based Access Logger',
+ 'attributeName' : 'rotation-policy-dn'
+ }
+ </call>
+
+ <message>'--- Check log files ---'</message>
+ <call function="'listFolder'">
+ { 'location' : '%s' % (DIRECTORY_INSTANCE_HOST),
+ 'foldername' : '%s/%s/logs' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME),
+ 'filename' : 'access'
+ }
+ </call>
+
+ <if expr="len(cmdResult) > 0">
+ <sequence>
+ <iterate var="result" in="cmdResult">
+ <sequence>
<script>
- error=1
- </script>
- </sequence>
- </if>
- </sequence>
- </iterate>
- </sequence>
- </else>
- </if>
+ logname=result["name"]
+ logsize=result["size"]
+ found=0
+ </script>
+ <message>
+ 'log file status for file %s is %s ' % (logname,logsize)
+ </message>
+ <script>
+ for currentLog in listName:
+ if currentLog == logname:
+ found=1
+ currentIndex=listName.index(currentLog)
+ currentSize=listSize[currentIndex]
+ if currentSize != logsize:
+ RC=1
+ listSize[currentIndex]=logsize
+ break
+
+ if found == 0:
+ listName.append(logname)
+ listSize.append(logsize)
+ </script>
+ </sequence>
+ </iterate>
+ </sequence>
+ </if>
+ <message>
+ 'The new log file status is : %s : %s' % (listName,listSize)
+ </message>
+ <script>
+ cpt=cpt+1
+ </script>
+ </sequence>
+ </loop>
+ <message>
+ 'The log file status of the file "%s" has changed ' % logname
+ </message>
+
+ <!-- Check log file -->
+ <!-- records must be writen after each operation -->
+ <!-- we should exit the loop after the first ldapsearch -->
+ <if expr="cpt != 2">
+ <sequence>
+ <message>
+ 'ERROR. The writer are not flushed after every log records'
+ </message>
+ <call function="'testFailed'"/>
+ </sequence>
+ <else>
+ <sequence>
+ <message>
+ 'SUCCESS. The writer are flushed after every log records'
+ </message>
+ <call function="'testPassed'"/>
+ </sequence>
+ </else>
+ </if>
+ </sequence>
+ </testcase>
+
+ <!-- #################################### -->
+ <!--
+ #@TestMarker Debug logger
+ #@TestName Debug logger properties check
+ #@TestIssue
+ #@TestPurpose Basic tests on the Debug logger
+ #@TestPreamble none
+ #@TestStep Enabled the Debug Logger
+ #@TestStep Define a spefic log file for debug message
+ #@TestStep set the debug-log-level to All
+ #@TestStep Restart the server
+ #@TestStep Execute a ldapsearch request
+ #@TestPostamble none
+ #@TestResult Check the debug log file has been created and contains datas
+ -->
+ <!-- #################################### -->
+
+ <testcase name="getTestCaseName('basic tests on Debug logger')">
+ <sequence>
+ <call function="'testCase_Preamble'"/>
+ <message>
+ '---- Basic tests on Debug loggers -----'
+ </message>
+
+ <message>'------ Enabled Debug logger --' </message>
+ <call function="'dsconfig'">
+ { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
+ 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
+ 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
+ 'subcommand' : 'set-log-publisher-prop',
+ 'objectType' : 'publisher-name',
+ 'objectName' : 'File-Based Debug Logger',
+ 'optionsString' : '--set enabled:true --set default-debug-level:all --set log-file:logs/mydebug',
+ 'expectedRC' : 0
+ }
+ </call>
+
+ <call function="'RestartDs'">
+ { 'dsHost' : DIRECTORY_INSTANCE_HOST,
+ 'dsPort' : DIRECTORY_INSTANCE_PORT,
+ 'dsBindDN' : DIRECTORY_INSTANCE_DN,
+ 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
+ }
+ </call>
+ <message>'--- Check log files ---'</message>
+ <call function="'listFolder'">
+ { 'location' : '%s' % DIRECTORY_INSTANCE_HOST,
+ 'foldername' : '%s/%s/logs' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME),
+ 'filename' : 'mydebug'
+ }
+ </call>
- <if expr="error == 0">
- <sequence>
- <call function="'testPassed'"/>
- </sequence>
- <else>
- <sequence>
- <call function="'testFailed'"/>
- </sequence>
- </else>
- </if>
- </sequence>
- </testcase>
-
-</sequence>
-</function>
-
+ <script>
+ error=0
+ </script>
+ <if expr="len(cmdResult) == 0">
+ <sequence>
+ <message>'ERROR. The Debug logger should be created'</message>
+ <script>
+ error=1
+ </script>
+ </sequence>
+ <else>
+ <sequence>
+ <iterate var="result" in="cmdResult">
+ <sequence>
+ <script>
+ logsize=result["size"]
+ </script>
+ <if expr="logsize == 0">
+ <sequence>
+ <message>'ERROR. The Debug logger should contain data'</message>
+ <script>
+ error=1
+ </script>
+ </sequence>
+ </if>
+ </sequence>
+ </iterate>
+ </sequence>
+ </else>
+ </if>
+
+ <if expr="error == 0">
+ <call function="'testPassed'"/>
+ <else>
+ <call function="'testFailed'"/>
+ </else>
+ </if>
+ </sequence>
+ </testcase>
+ </sequence>
+ </function>
</stax>
--
Gitblit v1.10.0