10139N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
10139N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
10139N/A<!--
10139N/A ! CDDL HEADER START
10139N/A !
10139N/A ! The contents of this file are subject to the terms of the
10139N/A ! Common Development and Distribution License, Version 1.0 only
10139N/A ! (the "License"). You may not use this file except in compliance
10139N/A ! with the License.
10139N/A !
10139N/A ! You can obtain a copy of the license at
10139N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
10139N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
10139N/A ! See the License for the specific language governing permissions
10139N/A ! and limitations under the License.
10139N/A !
10139N/A ! When distributing Covered Code, include this CDDL HEADER in each
10139N/A ! file and include the License file at
10139N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
10159N/A ! add the following below this CDDL HEADER, with the fields enclosed
10139N/A ! by brackets "[]" replaced with your own identifying information:
10139N/A ! Portions Copyright [yyyy] [name of copyright owner]
10152N/A !
10152N/A ! CDDL HEADER END
10139N/A !
10139N/A ! Copyright 2007-2009 Sun Microsystems, Inc.
10139N/A ! Portions Copyright 2011 ForgeRock AS.
10139N/A! -->
10139N/A<stax>
10139N/A <defaultcall function="allowed-tasks"/>
10139N/A <function name="allowed-tasks" scope="local">
10139N/A <block name="STAXCurrentFunction">
10139N/A <try>
10139N/A <sequence>
10139N/A <script>
10139N/A CurrentTestPath['suite']=STAXCurrentFunction
10139N/A </script>
10139N/A <call function="'testSuite_Preamble'" />
10139N/A
10139N/A <!--- Test Suite information
10139N/A #@TestSuiteName Allowed tasks
10139N/A #@TestSuitePurpose Control which tasks are allowed
10139N/A #@TestSuiteID export Tests
10139N/A #@TestSuiteGroup export
10139N/A #@TestGroup tasks
10139N/A #@TestScript allowed-tasks.xml
10139N/A #@TestHTMLLink http://opends.dev.java.net/
10139N/A -->
10139N/A
10139N/A <call function="'common_setup'">
10139N/A {
10139N/A 'quickStart' : True ,
10139N/A 'startServer' : True ,
10139N/A 'stopServer' : False
10139N/A }
10139N/A </call>
10139N/A
10139N/A
10139N/A <!--- Test Case information
10159N/A #@TestMarker Allowed tasks
10139N/A #@TestName Tasks control
10139N/A #@TestPurpose Control which tasks are allowed
10139N/A #@TestPreamble
10152N/A #@TestStep Change the list of allowed tasks
10139N/A #@TestStep Check we can only schedule allowed tasks
10139N/A #@TestPostamble
10139N/A #@TestResult
10139N/A -->
10139N/A
10139N/A <testcase name="getTestCaseName('Control which tasks are allowed')">
10139N/A <sequence>
10139N/A <call function="'testCase_Preamble'"/>
10139N/A
10139N/A <call function="'dsconfig'">
10139N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
10139N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
10139N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
10139N/A 'subcommand' : 'set-global-configuration-prop',
10139N/A 'optionsString' : '--remove allowed-task:org.opends.server.tasks.ExportTask',
10139N/A 'expectedRC' : 0
10139N/A }
10139N/A </call>
10139N/A
10139N/A <!-- the export task is not allowed. the task must be rejected -->
10139N/A
10139N/A <call function="'exportLdifWithScript'">
10139N/A { 'location' : STAF_REMOTE_HOSTNAME ,
10139N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
10139N/A 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
10139N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
10139N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
10139N/A 'ldifFile' : '%s/tasks/export_asynchronous' % remote.temp,
10139N/A 'startTask' : '0',
10139N/A 'backEnd' : DIRECTORY_INSTANCE_BE,
10139N/A 'expectedRC' : 1}
10139N/A </call>
10139N/A
10139N/A <call function="'dsconfig'">
10139N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
10139N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
10139N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
10139N/A 'subcommand' : 'set-global-configuration-prop',
10139N/A 'optionsString' : '--add allowed-task:org.opends.server.tasks.ExportTask',
10139N/A 'expectedRC' : 0
10139N/A }
10139N/A </call>
10139N/A <call function="'testCase_Postamble'"/>
10139N/A </sequence>
10139N/A </testcase>
10139N/A </sequence>
10139N/A <finally>
10139N/A <sequence>
10139N/A <!-- Test Suite Cleanup -->
10139N/A <message>'Finally: Tasks Cleanup.'</message>
10139N/A <try>
10139N/A <call function="'common_cleanup'" />
10139N/A <catch exception="'STAFException'">
10139N/A <sequence>
10139N/A <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
10139N/A </sequence>
10139N/A </catch>
10139N/A <finally>
10139N/A <call function="'testSuite_Postamble'"/>
10139N/A </finally>
10139N/A </try>
10139N/A </sequence>
10139N/A </finally>
10139N/A
10139N/A </try>
10139N/A
10139N/A </block>
10139N/A </function>
10152N/A</stax>
10152N/A