2852N/A<?
xml version="1.0" encoding="UTF-8" standalone="no"?>
2852N/A ! The contents of this file are subject to the terms of the 2852N/A ! Common Development and Distribution License, Version 1.0 only 2852N/A ! (the "License"). You may not use this file except in compliance 2852N/A ! You can obtain a copy of the license at 2852N/A ! See the License for the specific language governing permissions 2852N/A ! and limitations under the License. 2852N/A ! When distributing Covered Code, include this CDDL HEADER in each 2852N/A ! file and include the License file at 2852N/A ! add the following below this CDDL HEADER, with the fields enclosed 2852N/A ! by brackets "[]" replaced with your own identifying information: 2852N/A ! Portions Copyright [yyyy] [name of copyright owner] 3215N/A ! Copyright 2007-2010 Sun Microsystems, Inc. 2852N/A <
defaultcall function="import-ldif"/>
2852N/A <
function name="import-ldif" scope="local">
2852N/A <
block name="STAXCurrentFunction">
2938N/A CurrentTestPath['suite']=STAXCurrentFunction
2938N/A <
call function="'testSuite_Preamble'" />
3175N/A <!--- Test Suite information 3175N/A #@TestSuiteName Import Tasks 3175N/A #@TestSuitePurpose Validate the Import functionality in mode task 2938N/A <
call function="'common_setup'">
3175N/A <!--- Test Case information 2852N/A #@TestName Import task in synchronous mode 2852N/A #@TestPurpose Schedule a import in task mode to be executed immedialy in synchronous mode 2938N/A #@TestStep Execute a import-ldif in a task 2938N/A #@TestStep Execute manage-tasks output and check the Import task is returned 2938N/A #@TestStep Don't specify the -t option 2938N/A #@TestStep The task is scheduled for immediate execution and the script must wait the end of the import 3853N/A <
testcase name="getTestCaseName('schedule import-ldif task for immediate execution in synchronous mode')">
3853N/A <
call function="'testCase_Preamble'"/>
3853N/A <
call function="'ImportLdifWithScript'">
2938N/A { 'location' : STAF_REMOTE_HOSTNAME ,
3328N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
3328N/A 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
3328N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
3328N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
3328N/A 'backEnd' : DIRECTORY_INSTANCE_BE}
3328N/A <!-- Check data are imported --> 3328N/A <
call function="'checkImport'">
3328N/A { 'expectedEntries' : ['uid=scarter,dc=example,dc=com',
3328N/A 'uid=tmorris, dc=example,dc=com'],
3328N/A <
call function="'setKnownIssue'">
2938N/A <
call function="'DeleteEntry'">
2938N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
2938N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
2938N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
2938N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
2938N/A 'dsBaseDN' : 'uid=scarter,dc=example,dc=com' }
3175N/A <
call function="'DeleteEntry'">
3175N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
3175N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
2938N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
2938N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
3175N/A 'dsBaseDN' : 'uid=tmorris,dc=example,dc=com' }
3175N/A <
call function="'testCase_Postamble'"/>
2938N/A <!--- Test Case information 2938N/A #@TestName Import task in asynchronous mode 2938N/A #@TestPurpose Schedule a import in task mode to be executed immedialy in asynchronous mode 3175N/A #@TestStep Execute a import-ldif in a task 3175N/A #@TestStep specify the -t option with the value 0 3175N/A #@TestStep The task is scheduled for immediate execution 2852N/A @TestStep The script returns immedialy after scheduling the task 3175N/A <
testcase name="getTestCaseName('schedule import-ldif task for immediate execution in asynchronous mode')">
3175N/A <
call function="'testCase_Preamble'"/>
2938N/A <
call function="'ImportLdifWithScript'">
2938N/A { 'location' : STAF_REMOTE_HOSTNAME ,
2938N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
2938N/A 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
2938N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
3853N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
3853N/A 'backEnd' : DIRECTORY_INSTANCE_BE}
3853N/A { 'sleepForMilliSeconds' : 40000 }
2938N/A <!-- Check data are imported --> 2938N/A <
call function="'checkImport'">
2938N/A { 'expectedEntries' : ['uid=scarter,dc=example,dc=com',
3328N/A 'uid=tmorris, dc=example,dc=com'],
2938N/A <
call function="'setKnownIssue'">
2938N/A <
call function="'DeleteEntry'">
3175N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
2938N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
3175N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
2938N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
2938N/A 'dsBaseDN' : 'uid=scarter,dc=example,dc=com' }
2938N/A <
call function="'DeleteEntry'">
3175N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
2938N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
3175N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
2938N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
2938N/A 'dsBaseDN' : 'uid=tmorris,dc=example,dc=com' }
2938N/A <
call function="'testCase_Postamble'"/>
3175N/A <!--- Test Case information 2937N/A #@TestName Schedule a Import task 3175N/A #@TestPurpose Schedule a import in task mode 3175N/A #@TestStep Execute a import-ldif in a task 3175N/A @TestStep specify the -t option with the value non null to schedule an execution 2938N/A <
testcase name="getTestCaseName('schedule import-ldif task for scheduled execution in asynchronous mode')">
2938N/A <
call function="'testCase_Preamble'"/>
3853N/A <
call function="'ImportLdifWithScript'">
3853N/A { 'location' : STAF_REMOTE_HOSTNAME ,
3853N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
3853N/A 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
3853N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
3853N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
2938N/A 'startTask' : '20061212000000',
2938N/A 'backEnd' : DIRECTORY_INSTANCE_BE}
2938N/A returnString = STAXResult[0][1]
2938N/A <
call function="'checktestString'">
2938N/A {'returnString' : returnString ,
2938N/A 'expectedString' : 'The specified start time \'20061212000000\' has already passed'
2938N/A <
call function="'testCase_Postamble'"/>
2938N/A <!--- Test Case information 2938N/A #@TestName Schedule a recurring Import task 2938N/A #@TestPurpose Schedule a recurring Import in task mode 3175N/A #@TestStep Create a recurring Import in task mode 2938N/A #@TestStep specify the recurringTask option with the value 3175N/A #@TestStep non null to schedule a recurring execution 2938N/A <
testcase name="getTestCaseName('schedule recurring import task')">
4161N/A <
call function="'testCase_Preamble'"/>
4161N/A <!--- ReStart DS to clear the output of manage-tasks--> 4161N/A <
call function="'StopDsWithScript'">
4161N/A { 'location' : STAF_REMOTE_HOSTNAME,
4161N/A 'dsHost' : DIRECTORY_INSTANCE_HOST,
4161N/A 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
4161N/A 'dsBindDN' : DIRECTORY_INSTANCE_DN,
4161N/A 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
4161N/A <
call function="'StartDsWithScript'">
4161N/A { 'location' : STAF_REMOTE_HOSTNAME }
4161N/A <!--- Check that DS started --> 4161N/A <
call function="'isAlive'">
4161N/A <
call function="'ImportLdifWithScript'">
4161N/A { 'location' : STAF_REMOTE_HOSTNAME ,
4161N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
4161N/A 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
4161N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
4161N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
4161N/A 'schedulePattern' : '"0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * *"',
4161N/A 'backEnd' : DIRECTORY_INSTANCE_BE}
4161N/A <
call function="'manage-tasks'">
4161N/A { 'location' : STAF_REMOTE_HOSTNAME ,
4161N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
4161N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
4161N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
4161N/A returnString = STAXResult[0][1]
4161N/A <
call function="'searchStringForSubstring'">
4161N/A { 'returnString' : returnString,
4161N/A 'testString' : 'ImportTask-',
4161N/A <
call function="'searchStringForSubstring'">
4161N/A { 'returnString' : returnString,
4161N/A 'testString' : 'Waiting on start time',
4161N/A { 'sleepForMilliSeconds' : 120000 }
4161N/A <
call function="'manage-tasks'">
4161N/A { 'location' : STAF_REMOTE_HOSTNAME ,
4161N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
4161N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
4161N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
4161N/A returnString = STAXResult[0][1]
4161N/A <
call function="'searchStringForSubstring'">
4161N/A { 'returnString' : returnString,
4161N/A 'testString' : 'ImportTask-*',
4161N/A <
call function="'searchStringForSubstring'">
4161N/A { 'returnString' : returnString,
4161N/A 'testString' : 'Completed successfully',
4161N/A <
call function="'searchStringForSubstring'">
4161N/A { 'returnString' : returnString,
4161N/A 'testString' : 'Waiting on start time',
4161N/A <!-- cancel the recurring task ExportTask-* with manage-tasks --> 4161N/A <
call function="'manage-tasks'">
4161N/A { 'location' : STAF_REMOTE_HOSTNAME ,
4161N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
4161N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
4161N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
4161N/A 'dsCancel' : 'ImportTask-*',
4161N/A returnString = STAXResult[0][1]
4161N/A <
call function="'searchStringForSubstring'">
4161N/A { 'returnString' : returnString,
4161N/A 'testString' : 'Task ImportTask-',
4161N/A <
call function="'searchStringForSubstring'">
4161N/A { 'returnString' : returnString,
4161N/A <
call function="'testCase_Postamble'"/>
4161N/A <!-- Test Suite Cleanup --> 4161N/A <
message>'Finally: Tasks Cleanup.'</
message>
4161N/A <
call function="'common_cleanup'" />
4161N/A <
catch exception="'STAFException'">
4161N/A <
message log="1" level="'fatal'">'Cleanup of test suite failed.'</
message>
4161N/A <
call function="'testSuite_Postamble'"/>