backup_db.xml revision fa2a901d9354052da05380e152546102bd411edf
0N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
3669N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
0N/A<!--
0N/A ! CDDL HEADER START
0N/A !
0N/A ! The contents of this file are subject to the terms of the
0N/A ! Common Development and Distribution License, Version 1.0 only
0N/A ! (the "License"). You may not use this file except in compliance
0N/A ! with the License.
0N/A !
0N/A ! You can obtain a copy of the license at
0N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
0N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
0N/A ! See the License for the specific language governing permissions
0N/A ! and limitations under the License.
0N/A !
0N/A ! When distributing Covered Code, include this CDDL HEADER in each
0N/A ! file and include the License file at
1472N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
1472N/A ! add the following below this CDDL HEADER, with the fields enclosed
1472N/A ! by brackets "[]" replaced with your own identifying information:
0N/A ! Portions Copyright [yyyy] [name of copyright owner]
0N/A !
0N/A ! CDDL HEADER END
1879N/A !
1879N/A ! Copyright 2007-2008 Sun Microsystems, Inc.
1879N/A! -->
4141N/A<stax>
1879N/A <defaultcall function="backup_db"/>
1879N/A <function name="backup_db" scope="local">
0N/A <block name="STAXCurrentFunction">
0N/A <sequence>
0N/A <script>
0N/A CurrentTestPath['suite']=STAXCurrentFunction
0N/A </script>
0N/A <call function="'testSuite_Preamble'" />
0N/A
0N/A
0N/A <!--- Test Suite information
0N/A #@TestSuiteName Backup tasks
0N/A #@TestSuitePurpose Validate the backup functionality in mode task
0N/A #@TestSuiteID backup Tests
0N/A #@TestSuiteGroup backup
0N/A #@TestGroup tasks
2223N/A #@TestScript backup_db.xml
2223N/A #@TestHTMLLink http://opends.dev.java.net/
0N/A -->
0N/A
939N/A <!--- Test Case information
3669N/A #@TestMarker Backup tasks
0N/A #@TestName Schedule a recurring Backup task
3707N/A #@TestPurpose Schedule a recurring Backup in task mode
0N/A #@TestPreamble
0N/A #@TestStep Create a recurring Backup in task mode
0N/A #@TestStep specify the recurringTask option with the value
0N/A #@TestStep non null to schedule a recurring execution
0N/A #@TestPostamble
0N/A #@TestResult
0N/A -->
0N/A
0N/A <testcase name="getTestCaseName('schedule recurring backup task for scheduled execution in asynchronous mode')">
0N/A <sequence>
0N/A <call function="'testCase_Preamble'"/>
0N/A
0N/A <!--- ReStart DS to clear the output of manage-tasks-->
0N/A <call function="'StopDsWithScript'">
0N/A { 'location' : STAF_REMOTE_HOSTNAME,
0N/A 'dsHost' : DIRECTORY_INSTANCE_HOST,
0N/A 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
0N/A 'dsBindDN' : DIRECTORY_INSTANCE_DN,
0N/A 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
0N/A </call>
0N/A
0N/A <call function="'StartDsWithScript'">
0N/A { 'location' : STAF_REMOTE_HOSTNAME }
0N/A </call>
0N/A
0N/A <call function="'backup'">
0N/A { 'location' : STAF_REMOTE_HOSTNAME ,
0N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
0N/A 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
0N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
1155N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
1155N/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 * * * *"',
0N/A 'backupDir' : '%s/tasks/backup_recurring_schedule_asynchronous' % remote.data,
0N/A 'backupID' : 'recurring-backup-1',
0N/A 'backEnd' : DIRECTORY_INSTANCE_BE}
0N/A </call>
0N/A
0N/A <!-- manage-tasks -->
0N/A <call function="'manage-tasks'">
0N/A { 'location' : STAF_REMOTE_HOSTNAME ,
0N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
0N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
1879N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
1879N/A 'dsQuiet' : ' '
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString,
'testString' : 'recurring-backup-1',
'expectedResult' : '1' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString,
'testString' : 'Completed successfully',
'expectedResult' : '0' }
</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' : 'recurring-backup-1',
'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 recurring-backup-1 with manage-tasks -->
<call function="'manage-tasks'">
{ 'location' : STAF_REMOTE_HOSTNAME ,
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'dsCancel' : 'recurring-backup-1',
'dsQuiet' : ' '
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString,
'testString' : 'Task recurring-backup-1 canceled',
'expectedResult' : '1' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Backup tasks
#@TestName Backup task in asynchronous mode
#@TestPurpose Schedule a backup in task mode to be executed immedialy in asynchronous mode
#@TestPreamble
#@TestStep Execute a backup in mode task
#@TestStep Execute manage-tasks tools and check a backup task is managed
#@TestStep Specify the -t 0
#@TestStep The task is scheduled for immediate execution
#@TestSteps The script returns immedialy after scheduling the task
#@TestPostamble
#@TestResult
-->
<testcase name="getTestCaseName('schedule backup task for immediate execution in asynchronous mode')">
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'backup'">
{ 'location' : STAF_REMOTE_HOSTNAME ,
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'backupDir' : '%s/tasks/backup_asynchronous' % remote.data,
'startTask' : '0',
'backEnd' : 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' : 'Backup',
'expectedResult' : '1' }
</call>
<message>'--- Check log files backup_asynchronous ---'</message>
<call function="'listFolder'">
{ 'location' : '%s' % (STAF_REMOTE_HOSTNAME),
'foldername' : '%s/tasks' % remote.data,
'filename' : 'backup_asynchronous'
}
</call>
<!-- check the export ldif file has been created-->
<if expr="len(cmdResult) == 0">
<call function="'testFailed'"/>
<else>
<call function="'testPassed'"/>
</else>
</if>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Backup tasks
#@TestName Backup task in synchronous mode
#@TestPurpose Schedule a Backup in task mode to be executed immedialy in synchronous mode
#@TestPreamble
#@TestStep Execute a backup in mode task
#@TestStep Don't specify the -t option
#@TestStep The task is scheduled for immediate execution and the script must wait the end of the task to return
#@TestPostamble
#@TestResult
-->
<testcase name="getTestCaseName('schedule backup task for immediate execution in synchronous mode')">
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'backup'">
{ 'location' : STAF_REMOTE_HOSTNAME ,
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'backupDir' : '%s/tasks/backup_synchronous' % remote.data,
'backEnd' : DIRECTORY_INSTANCE_BE}
</call>
<message>'--- Check log files ---'</message>
<call function="'listFolder'">
{ 'location' : '%s' % (STAF_REMOTE_HOSTNAME),
'foldername' : '%s/tasks' % remote.data,
'filename' : 'backup_synchronous'
}
</call>
<!-- check the export ldif file has been created-->
<if expr="len(cmdResult) == 0">
<call function="'testFailed'"/>
<else>
<call function="'testPassed'"/>
</else>
</if>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Backup tasks
#@TestName Schedule a Backup task
#@TestPurpose Schedule a Backup in task mode
#@TestPreamble
#@TestStep Execute a Backup in task mode
#@TestStep specify the -t option with the value non null to schedule an execution
#@TestPostamble
#@TestResult
-->
<testcase name="getTestCaseName('schedule backup task for scheduled execution in asynchronous mode')">
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'backup'">
{ 'location' : STAF_REMOTE_HOSTNAME ,
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'startTask' : '20061212000000',
'backupDir' : '%s/tasks/backup_schedule_asynchronous' % remote.data,
'backEnd' : DIRECTORY_INSTANCE_BE}
</call>
<message>'--- Check log files backup_schedule_asynchronous ---'</message>
<call function="'listFolder'">
{ 'location' : '%s' % (STAF_REMOTE_HOSTNAME),
'foldername' : '%s/tasks' % remote.data,
'filename' : 'backup_schedule_asynchronous'
}
</call>
<!-- check the export ldif file has been created-->
<if expr="len(cmdResult) == 0">
<call function="'testFailed'"/>
<else>
<call function="'testPassed'"/>
</else>
</if>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker Backup tasks
#@TestName Schedule a recurring Backup task with the same name as previously
#@TestPurpose Schedule a recurring Backup in task mode with the same name see issue 3373
#@TestPreamble
#@TestStep Create a recurring Backup in task mode with the same name as previously
#@TestStep specify the recurringTask option with the value
#@TestStep non null to schedule a recurring execution
#@TestPostamble
#@TestResult
-->
<testcase name="getTestCaseName('schedule recurring backup task with the same name as previously')">
<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>
<!-- 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' : 'recurring-backup-1',
'expectedResult' : '0' }
</call>
<call function="'backup'">
{ 'location' : STAF_REMOTE_HOSTNAME ,
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'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 * * * *"',
'backupDir' : '%s/tasks/backup_recurring_schedule_asynchronous' % remote.data,
'backupID' : 'recurring-backup-1',
'backEnd' : 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' : 'recurring-backup-1',
'expectedResult' : '1' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString,
'testString' : 'Completed successfully',
'expectedResult' : '0' }
</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' : 'recurring-backup-1',
'expectedResult' : '1' }
</call>
<call function="'searchStringForSubstring'">
{ 'returnString' : returnString,
'testString' : 'Completed successfully',
'expectedResult' : '1' }
</call>
<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>
<call function="'checktestStringNotPresent'">
{'testString' : 'because another task already exists with the same ID' ,
'returnString' : returnString,
'issue' : '3773'}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<call function="'testSuite_Postamble'" />
</sequence>
</block>
</function>
</stax>