import-ldif.xml revision 4347
f1828234a850dd28465425248a83a993f262918fPavel Březina<?xml version="1.0" encoding="UTF-8" standalone="no"?>
f1828234a850dd28465425248a83a993f262918fPavel Březina<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
f1828234a850dd28465425248a83a993f262918fPavel Březina<!--
f1828234a850dd28465425248a83a993f262918fPavel Březina ! CDDL HEADER START
f1828234a850dd28465425248a83a993f262918fPavel Březina !
f1828234a850dd28465425248a83a993f262918fPavel Březina ! The contents of this file are subject to the terms of the
f1828234a850dd28465425248a83a993f262918fPavel Březina ! Common Development and Distribution License, Version 1.0 only
f1828234a850dd28465425248a83a993f262918fPavel Březina ! (the "License"). You may not use this file except in compliance
f1828234a850dd28465425248a83a993f262918fPavel Březina ! with the License.
f1828234a850dd28465425248a83a993f262918fPavel Březina !
f1828234a850dd28465425248a83a993f262918fPavel Březina ! You can obtain a copy of the license at
f1828234a850dd28465425248a83a993f262918fPavel Březina ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
f1828234a850dd28465425248a83a993f262918fPavel Březina ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
f1828234a850dd28465425248a83a993f262918fPavel Březina ! See the License for the specific language governing permissions
f1828234a850dd28465425248a83a993f262918fPavel Březina ! and limitations under the License.
f1828234a850dd28465425248a83a993f262918fPavel Březina !
f1828234a850dd28465425248a83a993f262918fPavel Březina ! When distributing Covered Code, include this CDDL HEADER in each
f1828234a850dd28465425248a83a993f262918fPavel Březina ! file and include the License file at
f1828234a850dd28465425248a83a993f262918fPavel Březina ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
f1828234a850dd28465425248a83a993f262918fPavel Březina ! add the following below this CDDL HEADER, with the fields enclosed
f1828234a850dd28465425248a83a993f262918fPavel Březina ! by brackets "[]" replaced with your own identifying information:
f1828234a850dd28465425248a83a993f262918fPavel Březina ! Portions Copyright [yyyy] [name of copyright owner]
f1828234a850dd28465425248a83a993f262918fPavel Březina !
f1828234a850dd28465425248a83a993f262918fPavel Březina ! CDDL HEADER END
f1828234a850dd28465425248a83a993f262918fPavel Březina !
f1828234a850dd28465425248a83a993f262918fPavel Březina ! Copyright 2007-2009 Sun Microsystems, Inc.
f1828234a850dd28465425248a83a993f262918fPavel Březina! -->
f1828234a850dd28465425248a83a993f262918fPavel Březina<stax>
f1828234a850dd28465425248a83a993f262918fPavel Březina <defaultcall function="import-ldif"/>
f1828234a850dd28465425248a83a993f262918fPavel Březina <function name="import-ldif" scope="local">
f1828234a850dd28465425248a83a993f262918fPavel Březina <block name="STAXCurrentFunction">
f1828234a850dd28465425248a83a993f262918fPavel Březina <sequence>
f1828234a850dd28465425248a83a993f262918fPavel Březina <script>
f1828234a850dd28465425248a83a993f262918fPavel Březina CurrentTestPath['suite']=STAXCurrentFunction
f1828234a850dd28465425248a83a993f262918fPavel Březina </script>
f1828234a850dd28465425248a83a993f262918fPavel Březina <call function="'testSuite_Preamble'" />
f1828234a850dd28465425248a83a993f262918fPavel Březina
f1828234a850dd28465425248a83a993f262918fPavel Březina
f1828234a850dd28465425248a83a993f262918fPavel Březina <!--- Test Suite information
f1828234a850dd28465425248a83a993f262918fPavel Březina #@TestSuiteName Import Tasks
f1828234a850dd28465425248a83a993f262918fPavel Březina #@TestSuitePurpose Validate the Import functionality in mode task
f1828234a850dd28465425248a83a993f262918fPavel Březina #@TestSuiteID Import Tests
f1828234a850dd28465425248a83a993f262918fPavel Březina #@TestSuiteGroup Import
f1828234a850dd28465425248a83a993f262918fPavel Březina #@TestGroup tasks
f1828234a850dd28465425248a83a993f262918fPavel Březina #@TestScript import_ldif.xml
f1828234a850dd28465425248a83a993f262918fPavel Březina #@TestHTMLLink http://opends.dev.java.net/
f1828234a850dd28465425248a83a993f262918fPavel Březina -->
f1828234a850dd28465425248a83a993f262918fPavel Březina
f1828234a850dd28465425248a83a993f262918fPavel Březina
f1828234a850dd28465425248a83a993f262918fPavel Březina <!--- Test Case information
f1828234a850dd28465425248a83a993f262918fPavel Březina #@TestMarker Import Tasks
f1828234a850dd28465425248a83a993f262918fPavel Březina #@TestName Import task in synchronous mode
f1828234a850dd28465425248a83a993f262918fPavel Březina #@TestPurpose Schedule a import in task mode to be executed immedialy in synchronous mode
f1828234a850dd28465425248a83a993f262918fPavel Březina #@TestPreamble
f1828234a850dd28465425248a83a993f262918fPavel Březina #@TestStep Execute a import-ldif in a task
f1828234a850dd28465425248a83a993f262918fPavel Březina #@TestStep Execute manage-tasks output and check the Import task is returned
f1828234a850dd28465425248a83a993f262918fPavel Březina #@TestStep Don't specify the -t option
f1828234a850dd28465425248a83a993f262918fPavel Březina #@TestStep The task is scheduled for immediate execution and the script must wait the end of the import
f1828234a850dd28465425248a83a993f262918fPavel Březina #@TestPostamble
f1828234a850dd28465425248a83a993f262918fPavel Březina #@TestResult
f1828234a850dd28465425248a83a993f262918fPavel Březina -->
f1828234a850dd28465425248a83a993f262918fPavel Březina
f1828234a850dd28465425248a83a993f262918fPavel Březina <testcase name="getTestCaseName('schedule import-ldif task for immediate execution in synchronous mode')">
f1828234a850dd28465425248a83a993f262918fPavel Březina <sequence>
544525ee1fc54d744c08465066e2b4a521f78224Stephen Gallagher <call function="'testCase_Preamble'"/>
544525ee1fc54d744c08465066e2b4a521f78224Stephen Gallagher
544525ee1fc54d744c08465066e2b4a521f78224Stephen Gallagher <call function="'ImportLdifWithScript'">
f1828234a850dd28465425248a83a993f262918fPavel Březina { 'location' : STAF_REMOTE_HOSTNAME ,
f1828234a850dd28465425248a83a993f262918fPavel Březina 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'dsLdifFile' : '%s/tasks/import.ldif' % remote.data,
'dsAppend' : ' ',
'dsBackEnd' : DIRECTORY_INSTANCE_BE}
</call>
<!-- manage-tasks -->
<call function="'manage-tasks'">
{ 'location' : STAF_REMOTE_HOSTNAME ,
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'dsQuiet' : ' '
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString,
'testString' : 'Import',
'expectedResult' : '1' }
</call>
<!-- Check data are imported -->
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,dc=example,dc=com',
'uid=tmorris, dc=example,dc=com'],
'startDS' : 'False'
}
</call>
<!-- Delete entries -->
<call function="'DeleteEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsBaseDN' : 'uid=scarter,dc=example,dc=com' }
</call>
<call function="'DeleteEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsBaseDN' : 'uid=tmorris,dc=example,dc=com' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Import Tasks
#@TestName Import task in asynchronous mode
#@TestPurpose Schedule a import in task mode to be executed immedialy in asynchronous mode
#@TestPreamble
#@TestStep Execute a import-ldif in a task
#@TestStep specify the -t option with the value 0
#@TestStep The task is scheduled for immediate execution
@TestStep The script returns immedialy after scheduling the task
#@TestPostamble
-->
<testcase name="getTestCaseName('schedule import-ldif task for immediate execution in asynchronous mode')">
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME ,
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'dsLdifFile' : '%s/tasks/import.ldif' % remote.data,
'dsAppend' : ' ',
'startTask' : '0',
'dsBackEnd' : DIRECTORY_INSTANCE_BE}
</call>
<call function="'Sleep'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'sleepForMilliSeconds' : 40000 }
</call>
<!-- Check data are imported -->
<call function="'checkImport'">
{ 'expectedEntries' : ['uid=scarter,dc=example,dc=com',
'uid=tmorris, dc=example,dc=com'],
'startDS' : 'False'
}
</call>
<!-- Delete entries -->
<call function="'DeleteEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsBaseDN' : 'uid=scarter,dc=example,dc=com' }
</call>
<call function="'DeleteEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsBaseDN' : 'uid=tmorris,dc=example,dc=com' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Import Tasks
#@TestName Schedule a Import task
#@TestPurpose Schedule a import in task mode
#@TestPreamble
#@TestStep Execute a import-ldif in a task
@TestStep specify the -t option with the value non null to schedule an execution
#@TestPostamble
-->
<testcase name="getTestCaseName('schedule import-ldif task for scheduled execution in asynchronous mode')">
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME ,
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'dsLdifFile' : '%s/tasks/import.ldif' % remote.data,
'dsAppend' : ' ',
'startTask' : '20061212000000',
'dsBackEnd' : DIRECTORY_INSTANCE_BE}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchString'">
{ 'expectedString' : 'The specified start time \'20061212000000\' has already passed' ,
'returnString' : returnString ,
'knownIssue' : '3909' ,
'expectedRC' : '1' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Import Tasks
#@TestName Schedule a recurring Import task
#@TestPurpose Schedule a recurring Import in task mode
#@TestPreamble
#@TestStep Create a recurring Import in task mode
#@TestStep specify the recurringTask option with the value
#@TestStep non null to schedule a recurring execution
#@TestPostamble
#@TestResult
-->
<testcase name="getTestCaseName('schedule recurring import task')">
<sequence>
<call function="'testCase_Preamble'"/>
<!--- ReStart DS to clear the output of manage-tasks-->
<call function="'StopDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'dsHost' : DIRECTORY_INSTANCE_HOST,
'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsBindDN' : DIRECTORY_INSTANCE_DN,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
</call>
<call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<!--- Check that DS started -->
<call function="'isAlive'">
{ 'noOfLoops' : 10 ,
'noOfMilliSeconds' : 2000
}
</call>
<call function="'ImportLdifWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME ,
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'dsLdifFile' : '%s/tasks/import.ldif' % remote.data,
'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 * * * *"',
'dsBackEnd' : DIRECTORY_INSTANCE_BE}
</call>
<!-- manage-tasks -->
<call function="'manage-tasks'">
{ 'location' : STAF_REMOTE_HOSTNAME ,
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'dsQuiet' : ' '
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString,
'testString' : 'ImportTask-',
'expectedResult' : '1' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString,
'testString' : 'Waiting on start time',
'expectedResult' : '1' }
</call>
<call function="'Sleep'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'sleepForMilliSeconds' : 120000 }
</call>
<!-- manage-tasks -->
<call function="'manage-tasks'">
{ 'location' : STAF_REMOTE_HOSTNAME ,
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'dsQuiet' : ' '
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString,
'testString' : 'ImportTask-*',
'expectedResult' : '1' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString,
'testString' : 'Completed successfully',
'expectedResult' : '1' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString,
'testString' : 'Waiting on start time',
'expectedResult' : '1' }
</call>
<!-- cancel the recurring task ExportTask-* with manage-tasks -->
<call function="'manage-tasks'">
{ 'location' : STAF_REMOTE_HOSTNAME ,
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'dsCancel' : 'ImportTask-*',
'dsQuiet' : ' '
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString,
'testString' : 'Task ImportTask-',
'expectedResult' : '1' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString,
'testString' : 'canceled',
'expectedResult' : '1' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<call function="'testSuite_Postamble'" />
</sequence>
</block>
</function>
</stax>