1476N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2887N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
1476N/A<!--
1476N/A ! CDDL HEADER START
1476N/A !
1476N/A ! The contents of this file are subject to the terms of the
1476N/A ! Common Development and Distribution License, Version 1.0 only
1476N/A ! (the "License"). You may not use this file except in compliance
1476N/A ! with the License.
1476N/A !
1476N/A ! You can obtain a copy of the license at
1476N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
1476N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
1476N/A ! See the License for the specific language governing permissions
1476N/A ! and limitations under the License.
1476N/A !
1476N/A ! When distributing Covered Code, include this CDDL HEADER in each
1476N/A ! file and include the License file at
1476N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
1476N/A ! add the following below this CDDL HEADER, with the fields enclosed
1476N/A ! by brackets "[]" replaced with your own identifying information:
1476N/A ! Portions Copyright [yyyy] [name of copyright owner]
1476N/A !
1476N/A ! CDDL HEADER END
1476N/A !
3215N/A ! Copyright 2007-2008 Sun Microsystems, Inc.
5822N/A ! Portions Copyright 2012 ForgeRock AS.
1476N/A ! -->
1476N/A<stax>
1476N/A
1476N/A <defaultcall function="replication_cleanup"/>
1476N/A
1476N/A <function name="replication_cleanup">
4616N/A <function-map-args>
4616N/A <function-arg-def name="suiteSuffix"
4616N/A type="optional"
4616N/A default="None">
4616N/A <function-arg-description>
4616N/A Test suite suffix used to copy the server logs back to the controller.
4616N/A </function-arg-description>
4616N/A <function-arg-property name="type" value="string"/>
4616N/A </function-arg-def>
5822N/A <function-arg-def name="label"
5822N/A type="optional"
5822N/A default="'Replication'">
5822N/A <function-arg-description>
5822N/A Friendly label name
5822N/A </function-arg-description>
5822N/A <function-arg-property name="type" value="string"/>
5822N/A </function-arg-def>
4616N/A </function-map-args>
1476N/A <sequence>
1476N/A
1476N/A <block name="'replication-cleanup'">
1476N/A
5822N/A <testcase name="getTestCaseName('%s Cleanup' % label)">
5822N/A
5822N/A <try>
4616N/A
5822N/A <sequence>
5822N/A <call function="'testCase_Preamble'"/>
5822N/A
5822N/A <!-- Stop the servers in the topology -->
5822N/A <call function="'stopServers'">
5822N/A [_splitServerList]
5822N/A </call>
4616N/A
5822N/A <!-- Copy the server logs to the controller machine -->
5822N/A <if expr="suiteSuffix != None">
5822N/A <paralleliterate var="server" in="_splitServerList" indexvar="i">
5822N/A <sequence>
5822N/A <script>
5822N/A suffix = suiteSuffix + '_%s' % (i + 1)
5822N/A serverHost = server.getHostname()
5822N/A serverName = '%s:%s' % (serverHost, server.getPort())
5822N/A serverPath = '%s/%s' % (server.getDir(), OPENDSNAME)
5822N/A </script>
5822N/A
5822N/A <message>
5822N/A 'Copy %s/logs/errors from %s to %s/errors_%s on %s' % \
5822N/A (serverPath, serverName, logs.sut, suffix, STAXServiceMachine)
5822N/A </message>
5822N/A <call function="'copyFile'">
5822N/A {
5822N/A 'location' : serverHost,
5822N/A 'srcfile' : '%s/logs/errors' % serverPath,
5822N/A 'destfile' : '%s/errors_%s' % (logs.sut, suffix),
5822N/A 'remotehost' : STAXServiceMachine
5822N/A }
5822N/A </call>
5822N/A <message>
5822N/A 'Copy %s/logs/access from %s to %s/access_%s on %s' % \
5822N/A (serverPath, serverName,logs.sut, suffix, STAXServiceMachine)
5822N/A </message>
5822N/A <call function="'copyFile'">
5822N/A {
5822N/A 'location' : serverHost,
5822N/A 'srcfile' : '%s/logs/access' % serverPath,
5822N/A 'destfile' : '%s/access_%s' % (logs.sut, suffix),
5822N/A 'remotehost' : STAXServiceMachine
5822N/A }
5822N/A </call>
5822N/A <message>
5822N/A 'Copy %s/logs/replication from %s to %s/replication_%s on %s' % \
5822N/A (serverPath, serverName, logs.sut, suffix, STAXServiceMachine)
5822N/A </message>
5822N/A <call function="'copyFile'">
5822N/A {
5822N/A 'location' : serverHost,
5822N/A 'srcfile' : '%s/logs/replication' % serverPath,
5822N/A 'destfile' : '%s/replication_%s' % (logs.sut, suffix),
5822N/A 'remotehost' : STAXServiceMachine
5822N/A }
5822N/A </call>
5822N/A </sequence>
5822N/A </paralleliterate>
5822N/A </if>
5822N/A
5822N/A <!-- Remove the topology created for the test suite -->
5822N/A <message>
5822N/A 'Remove DS topology created for the Synchronization Basic Test Suite'
5822N/A </message>
5822N/A
5822N/A <call function="'removeTopology'">
5822N/A { 'multipleInstanceTopology' : True }
5822N/A </call>
5822N/A
5822N/A <call function="'checkRC'">
5822N/A { 'returncode' : RC ,
5822N/A 'result' : STAXResult }
5822N/A </call>
5822N/A
5822N/A <tcstatus result="'pass'"></tcstatus>
5822N/A
5822N/A </sequence>
5822N/A
5822N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5822N/A <sequence>
5822N/A <message log="1" level="'fatal'">
5822N/A '%s: Failed to cleanup. eInfo(%s)' % (eType,eInfo)
5822N/A </message>
5822N/A <throw exception="'STAFException.TestSuite.CleanupException'" />
4616N/A </sequence>
5822N/A </catch>
5822N/A <finally>
5822N/A <!-- Test Case postamble -->
5822N/A <call function="'testCase_Postamble'"/>
5822N/A </finally>
1476N/A
5822N/A </try>
1476N/A
5822N/A </testcase>
1476N/A
1476N/A </block>
1476N/A
1476N/A </sequence>
1476N/A
1476N/A </function>
1476N/A
1476N/A</stax>