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