<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<!DOCTYPE stax SYSTEM "stax.dtd">
|
<!--
|
! CDDL HEADER START
|
!
|
! The contents of this file are subject to the terms of the
|
! Common Development and Distribution License, Version 1.0 only
|
! (the "License"). You may not use this file except in compliance
|
! with the License.
|
!
|
! You can obtain a copy of the license at
|
! trunk/opends/resource/legal-notices/OpenDS.LICENSE
|
! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
|
! See the License for the specific language governing permissions
|
! and limitations under the License.
|
!
|
! When distributing Covered Code, exclude this CDDL HEADER in each
|
! file and exclude the License file at
|
! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
|
! add the following below this CDDL HEADER, with the fields enclosed
|
! by brackets "[]" replaced with your own identifying information:
|
! Portions Copyright [yyyy] [name of copyright owner]
|
!
|
! CDDL HEADER END
|
!
|
! Portions Copyright 2007 Sun Microsystems, Inc.
|
! -->
|
|
<stax>
|
|
<defaultcall function="main_restore"/>
|
|
<function name="main_restore">
|
|
<sequence>
|
|
<block name="'restore'">
|
|
<sequence>
|
|
<script>
|
if not CurrentTestPath.has_key('group'):
|
CurrentTestPath['group']='backends'
|
CurrentTestPath['suite']=STAXCurrentBlock
|
</script>
|
|
<call function="'testSuite_Preamble'"/>
|
|
<!--- Test Suite information
|
#@TestSuiteName Backend Restore Tests
|
#@TestSuitePurpose Test the restore functionality for OpenDS.
|
#@TestSuiteID Restore Tests
|
#@TestSuiteGroup Restore
|
#@TestGroup Backend
|
#@TestScript restore.xml
|
#@TestHTMLLink http://opends.dev.java.net/
|
-->
|
|
|
<import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
|
file="'%s/testcases/backends/backend_setup.xml' % (TESTS_DIR)"/>
|
<call function="'backend_setup'">
|
{ 'startDS' : True,
|
'loadBackend' : True }
|
</call>
|
|
<sequence>
|
<message>
|
'Create a backup of the data in OpenDS to be used in the restore testcase'
|
</message>
|
<call function="'backup'">
|
{
|
'backupDir' : '%s/backends/backup1' % STAGED_DATA_DIR
|
}
|
</call>
|
|
<call function="'checktestRC'">
|
{ 'returncode' : RC ,
|
'result' : STAXResult }
|
</call>
|
</sequence>
|
|
<!--- Test Case information
|
#@TestMarker Backend Restore Tests
|
#@TestName Export: Restore 1
|
#@TestID Restore1
|
#@TestPurpose Restore data to OpenDS.
|
#@TestPreamble
|
#@TestSteps Client calls restore with the parameters
|
default backendID, and backupDirectory
|
#@TestPostamble
|
#@TestResult Success if restore returns 0
|
-->
|
|
<testcase name="'Backend: Restore 1'">
|
|
<sequence>
|
|
<call function="'testCase_Preamble'"/>
|
<message>
|
'Backend Restore1: Restore data to OpenDS'
|
</message>
|
|
<!-- Stop DS -->
|
<call function="'StopDsWithScript'">
|
{ 'location' : STAF_REMOTE_HOSTNAME,
|
'dsHost' : DIRECTORY_INSTANCE_HOST,
|
'dsPort' : DIRECTORY_INSTANCE_PORT,
|
'dsBindDN' : DIRECTORY_INSTANCE_DN,
|
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
|
</call>
|
|
<call function="'checkRC'">
|
{ 'returncode' : RC ,
|
'result' : STAXResult }
|
</call>
|
|
<call function="'restore'">
|
{
|
'backupDir' : '%s/backends/backup1' % STAGED_DATA_DIR
|
}
|
</call>
|
|
<call function="'checktestRC'">
|
{ 'returncode' : RC ,
|
'result' : STAXResult }
|
</call>
|
|
<!-- Start DS -->
|
<message>
|
'Start DS to run on port %s' % DIRECTORY_INSTANCE_PORT
|
</message>
|
|
<call function="'StartDsWithScript'">
|
{ 'location' : STAF_REMOTE_HOSTNAME }
|
</call>
|
|
<call function="'checkRC'">
|
{ 'returncode' : RC ,
|
'result' : STAXResult }
|
</call>
|
|
<!--- Check that DS started -->
|
<call function="'isAlive'">
|
{ 'noOfLoops' : 5 ,
|
'noOfMilliSeconds' : 2000 }
|
</call>
|
|
<call function="'testCase_Postamble'"/>
|
|
</sequence>
|
|
</testcase>
|
|
<!--- Test Case information
|
#@TestMarker Backend Restore Tests
|
#@TestName Export: Restore 2
|
#@TestID Restore2
|
#@TestPurpose Restore compressed data to OpenDS.
|
#@TestPreamble
|
#@TestSteps Client calls restore with the parameters
|
default backendID, backupDirectory, and uncompress
|
is automatically done
|
#@TestPostamble
|
#@TestResult Success if restore returns 0
|
-->
|
|
<testcase name="'Backend: Restore 2'">
|
|
<sequence>
|
|
<call function="'testCase_Preamble'"/>
|
<message>
|
'Backend Restore2: Restore compressed data to OpenDS'
|
</message>
|
|
<!-- Stop DS -->
|
<call function="'StopDsWithScript'">
|
{ 'location' : STAF_REMOTE_HOSTNAME,
|
'dsHost' : DIRECTORY_INSTANCE_HOST,
|
'dsPort' : DIRECTORY_INSTANCE_PORT,
|
'dsBindDN' : DIRECTORY_INSTANCE_DN,
|
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD }
|
</call>
|
|
<call function="'checkRC'">
|
{ 'returncode' : RC ,
|
'result' : STAXResult }
|
</call>
|
|
<call function="'backup'">
|
{
|
'backupDir' : '%s/restore.compressed' % STAGED_DATA_DIR
|
}
|
</call>
|
|
<call function="'checktestRC'">
|
{ 'returncode' : RC ,
|
'result' : STAXResult }
|
</call>
|
|
<!-- Start DS -->
|
<message>
|
'Start DS to run on port %s' % DIRECTORY_INSTANCE_PORT
|
</message>
|
|
<call function="'StartDsWithScript'">
|
{ 'location' : STAF_REMOTE_HOSTNAME }
|
</call>
|
|
<call function="'checkRC'">
|
{ 'returncode' : RC ,
|
'result' : STAXResult }
|
</call>
|
|
<!--- Check that DS started -->
|
<call function="'isAlive'">
|
{ 'noOfLoops' : 5 ,
|
'noOfMilliSeconds' : 2000 }
|
</call>
|
|
<call function="'testCase_Postamble'"/>
|
|
</sequence>
|
|
</testcase>
|
|
|
<import machine="'%s' % (STAF_LOCAL_HOSTNAME)"
|
file="'%s/testcases/backends/backend_cleanup.xml' % (TESTS_DIR)"/>
|
<call function="'backend_cleanup'"> { 'stopDS' : True } </call>
|
|
|
<call function="'testSuite_Postamble'"/>
|
|
</sequence>
|
|
</block>
|
|
</sequence>
|
|
</function>
|
|
</stax>
|