fractional-replication_cleanup.xml revision da97433d5cd26e422a370d186f98659383c06721
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "/shared/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, include this CDDL HEADER in each
! file and include 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
!
! Copyright 2009 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="fractional-replication_cleanup"/>
<function name="fractional-replication_cleanup">
<function-map-args>
<function-arg-def name="suiteSuffix"
type="optional"
default="None">
<function-arg-description>
Test suite suffix used to copy the server logs back to the controller.
</function-arg-description>
<function-arg-property name="type" value="string"/>
</function-arg-def>
</function-map-args>
<sequence>
<block name="'fractional-replication-cleanup'">
<sequence>
<!-- Stop the servers in the topology -->
<call function="'stopServers'">
[_splitServerList]
</call>
<!-- Copy the server logs to the controller machine -->
<if expr="suiteSuffix != None">
<paralleliterate var="server" in="_splitServerList" indexvar="i">
<sequence>
<script>
suffix = suiteSuffix + '_%s' % (i + 1)
serverHost = server.getHostname()
serverName = '%s:%s' % (serverHost, server.getPort())
serverPath = '%s/%s' % (server.getDir(), OPENDSNAME)
</script>
<message>
'Copy %s/logs/errors from %s to %s/errors_%s on %s' % \
(serverPath, serverName, logs.sut, suffix, STAXServiceMachine)
</message>
<call function="'copyFile'">
{
'location' : serverHost,
'srcfile' : '%s/logs/errors' % serverPath,
'destfile' : '%s/errors_%s' % (logs.sut, suffix),
'remotehost' : STAXServiceMachine
}
</call>
<message>
'Copy %s/logs/access from %s to %s/access_%s on %s' % \
(serverPath, serverName,logs.sut, suffix, STAXServiceMachine)
</message>
<call function="'copyFile'">
{
'location' : serverHost,
'srcfile' : '%s/logs/access' % serverPath,
'destfile' : '%s/access_%s' % (logs.sut, suffix),
'remotehost' : STAXServiceMachine
}
</call>
<message>
'Copy %s/logs/fractional-replication from %s to %s/fractional-replication_%s on %s' % \
(serverPath, serverName, logs.sut, suffix, STAXServiceMachine)
</message>
<call function="'copyFile'">
{
'location' : serverHost,
'srcfile' : '%s/logs/fractional-replication' % serverPath,
'destfile' : '%s/fractional-replication_%s' % (logs.sut, suffix),
'remotehost' : STAXServiceMachine
}
</call>
</sequence>
</paralleliterate>
</if>
<!-- Remove the topology created for the test suite -->
<message>
'Remove DS topology created for the Synchronization Basic Test Suite'
</message>
<call function="'removeTopology'">
{ 'multipleInstanceTopology' : True }
</call>
<call function="'checkRC'">
{ 'returncode' : RC ,
'result' : STAXResult }
</call>
</sequence>
</block>
</sequence>
</function>
</stax>