3338N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
3338N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
3338N/A<!--
3338N/A ! CDDL HEADER START
3338N/A !
3338N/A ! The contents of this file are subject to the terms of the
3338N/A ! Common Development and Distribution License, Version 1.0 only
3338N/A ! (the "License"). You may not use this file except in compliance
3338N/A ! with the License.
3338N/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.
3338N/A ! See the License for the specific language governing permissions
3338N/A ! and limitations under the License.
3338N/A !
6982N/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:
3338N/A ! Portions Copyright [yyyy] [name of copyright owner]
3338N/A !
3338N/A ! CDDL HEADER END
3338N/A !
4618N/A ! Copyright 2008-2009 Sun Microsystems, Inc.
3338N/A ! -->
3338N/A<stax>
3338N/A
3338N/A <defaultcall function="clu_manage-tasks_checkbehavior"/>
3338N/A
3338N/A <function name="clu_manage-tasks_checkbehavior">
3338N/A
3338N/A <sequence>
3338N/A
3338N/A <block name="'clu_manage-tasks_checkbehavior'">
4618N/A
4618N/A <try>
3338N/A
4618N/A <sequence>
4618N/A
4618N/A <!--- Test Suite information
4618N/A #@TestSuiteName manage-tasks check behavior tests
4618N/A #@TestSuitePurpose Test the results of the manage-tasks command.
4618N/A #@TestSuiteGroup manage-tasks check behavior tests
4618N/A #@TestScript clu_manage-tasks_checkbehavior.xml
4618N/A -->
4618N/A
4618N/A <script>
4618N/A if not CurrentTestPath.has_key('group'):
4618N/A CurrentTestPath['group'] = 'clu'
4618N/A CurrentTestPath['suite'] = STAXCurrentBlock
4618N/A </script>
4618N/A
4618N/A <call function="'testSuite_Preamble'"/>
3338N/A
4618N/A <call function="'common_setup'">
4618N/A {
4618N/A 'quickStart' : False ,
4618N/A 'loadData' : True ,
4618N/A 'ldifFile' : '%s/clu/clu_start.ldif' % remote.data ,
4618N/A 'startServer' : True ,
4618N/A 'stopServer' : False ,
4618N/A 'allowPreEncodePassword' : True
4618N/A }
4618N/A </call>
4618N/A
4618N/A <!--- Define default value for template -->
4618N/A <script>
4618N/A task = '%s/clu/disconnect.ldif' % remote.data
4618N/A </script>
4618N/A
4618N/A <!--- Test Case information
4618N/A #@TestMarker manage-tasks check behavior tests
4618N/A #@TestName manage-tasks: summary of tasks
4618N/A #@TestIssue none
4618N/A #@TestPurpose Test manage-tasks with summary option
4618N/A #@TestPreamble none
4618N/A #@TestStep Do an manage-tasks with -s option.
4618N/A #@TestStep Check that task 125 and 126 are displayed.
4618N/A #@TestPostamble none
4618N/A #@TestResult Success if manage-tasks returns 0 and if the
4618N/A output is correct.
4618N/A -->
4618N/A <testcase name="getTestCaseName
4618N/A ('manage-tasks: get summary of tasks')">
3338N/A
4618N/A <sequence>
4618N/A
4618N/A <call function="'testCase_Preamble'"/>
4618N/A
4618N/A <message>
4618N/A 'manage-tasks: create two tasks with taskID 125 and 126'
4618N/A </message>
4618N/A
4618N/A <call function="'ldapModifyWithScript'">
4618N/A {
4618N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
4618N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
4618N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
4618N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
4618N/A 'dsAdd' : 'True' ,
4618N/A 'dsFilename' : task
4618N/A }
4618N/A </call>
4618N/A
4618N/A <message>
4618N/A 'manage-tasks: check that these tasks appear in the summary'
4618N/A </message>
4618N/A
4618N/A <call function="'manage-tasks'">
4618N/A {
4618N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
4618N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
4618N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
4618N/A 'dsSummary' : 'True' ,
4618N/A 'dsQuiet' : 'True'
4618N/A }
4618N/A </call>
4618N/A
4618N/A <script>
4618N/A returnString = STAXResult[0][1]
4618N/A msg1 = '125 Disconnect Client Completed with errors'
4618N/A msg2 = '126 Disconnect Client Waiting on start time'
4618N/A </script>
4618N/A
4618N/A <call function="'checktestString'">
4618N/A {
4618N/A 'returnString' : returnString ,
4618N/A 'expectedString' : msg1
4618N/A }
4618N/A </call>
4618N/A
4618N/A <call function="'checktestString'">
4618N/A {
4618N/A 'returnString' : returnString ,
4618N/A 'expectedString' : msg2
4618N/A }
4618N/A </call>
4618N/A
4618N/A <call function="'testCase_Postamble'"/>
4618N/A
4618N/A </sequence>
3338N/A
4618N/A </testcase>
4618N/A
4618N/A <!--- Test Case information
4618N/A #@TestMarker manage-tasks check behavior tests
4618N/A #@TestName manage-tasks: info option
4618N/A #@TestIssue none
4618N/A #@TestPurpose Test manage-tasks with info option
4618N/A #@TestPreamble none
4618N/A #@TestStep Do an manage-tasks with -i option on task 125.
4618N/A #@TestStep Check some information for task 125.
4618N/A #@TestStep Do an manage-tasks with -i option on task 126.
4618N/A #@TestStep Check some information for task 126.
4618N/A #@TestPostamble none
4618N/A #@TestResult Success if manage-tasks returns 0 and if the
4618N/A outputs are correct.
4618N/A -->
4618N/A <testcase name="getTestCaseName
4618N/A ('manage-tasks: get task information')">
3338N/A
4618N/A <sequence>
4618N/A
4618N/A <call function="'testCase_Preamble'"/>
4618N/A
4618N/A <message>
4618N/A 'manage-tasks: get information for task 125'
4618N/A </message>
4618N/A
4618N/A <call function="'manage-tasks'">
4618N/A {
4618N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
4618N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
4618N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
4618N/A 'dsInfo' : 125 ,
4618N/A 'dsQuiet' : 'True'
4618N/A }
4618N/A </call>
4618N/A
4618N/A <script>
4618N/A returnString = STAXResult[0][1]
4618N/A msg1 = 'ID 125'
4618N/A msg2 = 'Type Disconnect Client'
4618N/A msg3 = 'Status Completed with errors'
4618N/A msg4 = 'Scheduled Start Time Immediate execution'
4618N/A </script>
4618N/A
4618N/A <call function="'checktestString'">
4618N/A {
4618N/A 'returnString' : returnString ,
4618N/A 'expectedString' : msg1
4618N/A }
4618N/A </call>
4618N/A
4618N/A <call function="'checktestString'">
4618N/A {
4618N/A 'returnString' : returnString ,
4618N/A 'expectedString' : msg2
4618N/A }
4618N/A </call>
4618N/A
4618N/A <call function="'checktestString'">
4618N/A {
4618N/A 'returnString' : returnString ,
4618N/A 'expectedString' : msg3
4618N/A }
4618N/A </call>
4618N/A
4618N/A <call function="'checktestString'">
4618N/A {
4618N/A 'returnString' : returnString ,
4618N/A 'expectedString' : msg4
4618N/A }
4618N/A </call>
4618N/A
4618N/A <message>
4618N/A 'manage-tasks: get information for task 126'
4618N/A </message>
4618N/A
4618N/A <call function="'manage-tasks'">
4618N/A {
4618N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
4618N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
4618N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
4618N/A 'dsInfo' : 126 ,
4618N/A 'dsQuiet' : 'True'
4618N/A }
4618N/A </call>
4618N/A
4618N/A <script>
4618N/A returnString = STAXResult[0][1]
4618N/A msg1 = 'ID 126'
4618N/A msg2 = 'Type Disconnect Client'
4618N/A msg3 = 'Status Waiting on start time'
4618N/A msg4 = 'Scheduled Start Time Dec 12, 2048 12:00:00 AM'
4618N/A </script>
4618N/A
4618N/A <call function="'checktestString'">
4618N/A {
4618N/A 'returnString' : returnString ,
4618N/A 'expectedString' : msg1
4618N/A }
4618N/A </call>
4618N/A
4618N/A <call function="'checktestString'">
4618N/A {
4618N/A 'returnString' : returnString ,
4618N/A 'expectedString' : msg2
4618N/A }
4618N/A </call>
4618N/A
4618N/A <call function="'checktestString'">
4618N/A {
4618N/A 'returnString' : returnString ,
4618N/A 'expectedString' : msg3
4618N/A }
4618N/A </call>
4618N/A
4618N/A <call function="'checktestString'">
4618N/A {
4618N/A 'returnString' : returnString ,
4618N/A 'expectedString' : msg4
4618N/A }
4618N/A </call>
4618N/A
4618N/A <call function="'testCase_Postamble'"/>
4618N/A
4618N/A </sequence>
3338N/A
4618N/A </testcase>
3338N/A
4618N/A <!--- Test Case information
4618N/A #@TestMarker manage-tasks check behavior tests
4618N/A #@TestName manage-tasks: cancel option
4618N/A #@TestIssue none
4618N/A #@TestPurpose Test manage-tasks with cancel option
4618N/A with seed 0
4618N/A #@TestPreamble none
4618N/A #@TestStep Do an manage-tasks with -c option on task 125.
4618N/A #@TestStep Check the output of the previous command.
4618N/A #@TestStep Do an manage-tasks with -c option on task 126.
4618N/A #@TestStep Check the output of the previous command.
4618N/A #@TestPostamble none
4618N/A #@TestResult Success if manage-tasks return 1 for task 125,
4618N/A 0 for task 126 and if the outputs are correct.
4618N/A -->
4618N/A <testcase name="getTestCaseName('manage-tasks: cancel task')">
3338N/A
4618N/A <sequence>
4618N/A
4618N/A <call function="'testCase_Preamble'"/>
4618N/A
4618N/A <message>
4618N/A 'manage-tasks: cancel the task 125'
4618N/A </message>
4618N/A
4618N/A <call function="'manage-tasks'">
4618N/A {
4618N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
4618N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
4618N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
4618N/A 'dsCancel' : 125 ,
4618N/A 'dsQuiet' : 'True' ,
4618N/A 'expectedRC' : 1
4618N/A }
4618N/A </call>
4618N/A
4618N/A <script>
4618N/A returnString = STAXResult[0][1]
4618N/A </script>
4618N/A
4618N/A <call function="'checktestString'">
4618N/A {
4618N/A 'returnString' : returnString ,
4618N/A 'expectedString' : 'task 125 is not in a cancelable state'
4618N/A }
4618N/A </call>
4618N/A
4618N/A <message>
4618N/A 'manage-tasks: cancel the task 126'
4618N/A </message>
4618N/A
4618N/A <call function="'manage-tasks'">
4618N/A {
4618N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
4618N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
4618N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
4618N/A 'dsCancel' : 126 ,
4618N/A 'dsQuiet' : 'True'
4618N/A }
4618N/A </call>
4618N/A
4618N/A <script>
4618N/A returnString = STAXResult[0][1]
4618N/A </script>
4618N/A
4618N/A <call function="'checktestString'">
4618N/A {
4618N/A 'returnString' : returnString ,
4618N/A 'expectedString' : 'Task 126 canceled'
4618N/A }
4618N/A </call>
4618N/A
4618N/A <call function="'testCase_Postamble'"/>
4618N/A
4618N/A </sequence>
3338N/A
4618N/A </testcase>
4618N/A
4618N/A <!--- Test Case information
4618N/A #@TestMarker manage-tasks check behavior tests
4618N/A #@TestName manage-tasks: invalid task
4618N/A #@TestIssue none
4618N/A #@TestPurpose Test manage-tasks with an invalid task
4618N/A #@TestPreamble none
4618N/A #@TestStep Do an manage-tasks with -c option and an
4618N/A invalid task.
4618N/A #@TestStep Check the output of the previous command.
4618N/A #@TestStep Do an manage-tasks with -i option and an
4618N/A invalid task.
4618N/A #@TestStep Check the output of the previous command.
4618N/A #@TestPostamble none
4618N/A #@TestResult Success if manage-tasks return 1 and if
4618N/A the outputs are correct.
4618N/A -->
4618N/A <testcase name="getTestCaseName('manage-tasks: invalid task')">
3338N/A
4618N/A <sequence>
4618N/A
4618N/A <call function="'testCase_Preamble'"/>
4618N/A
4618N/A <message>
4618N/A 'manage-tasks: information for an invalid task'
4618N/A </message>
4618N/A
4618N/A <call function="'manage-tasks'">
4618N/A {
4618N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
4618N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
4618N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
4618N/A 'dsCancel' : 124 ,
4618N/A 'dsQuiet' : 'True' ,
4618N/A 'expectedRC' : 1
4618N/A }
4618N/A </call>
4618N/A
4618N/A <script>
4618N/A returnString = STAXResult[0][1]
4618N/A msg1 = 'Error canceling task \'124\': There are no tasks'
4618N/A msg2 = 'defined with ID \'124\''
4618N/A </script>
4618N/A
4618N/A <call function="'checktestString'">
4618N/A {
4618N/A 'returnString' : returnString ,
4618N/A 'expectedString' : '%s %s' % (msg1, msg2)
4618N/A }
4618N/A </call>
4618N/A
4618N/A <message>
4618N/A 'manage-tasks: information on an invalid task'
4618N/A </message>
4618N/A
4618N/A <call function="'manage-tasks'">
4618N/A {
4618N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
4618N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
4618N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
4618N/A 'dsCancel' : 124 ,
4618N/A 'dsQuiet' : 'True' ,
4618N/A 'expectedRC' : 1
4618N/A }
4618N/A </call>
4618N/A
4618N/A <script>
4618N/A returnString = STAXResult[0][1]
4618N/A </script>
4618N/A
4618N/A <call function="'checktestString'">
4618N/A {
4618N/A 'returnString' : returnString ,
4618N/A 'expectedString' : '%s %s' % (msg1, msg2)
4618N/A }
4618N/A </call>
4618N/A
4618N/A <call function="'testCase_Postamble'"/>
4618N/A
4618N/A </sequence>
3338N/A
4618N/A </testcase>
4618N/A
4618N/A </sequence>
4618N/A
4618N/A <finally>
4618N/A <sequence>
4618N/A <!-- Test Suite Cleanup -->
4618N/A <message>'Finally: Global CLU 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>
3338N/A </sequence>
4618N/A </finally>
4618N/A
4618N/A </try>
3338N/A
3338N/A </block>
3338N/A
3338N/A </sequence>
3338N/A
3338N/A </function>
3338N/A
3338N/A</stax>