topology.xml revision d25372dc8e65a9ed019a88fdf659ca61313f1b31
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<?xml version="1.0" encoding="UTF-8" standalone="no"?>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<!DOCTYPE stax SYSTEM "/stax.dtd">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<!--
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! CDDL HEADER START
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster !
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! The contents of this file are subject to the terms of the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! Common Development and Distribution License, Version 1.0 only
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! (the "License"). You may not use this file except in compliance
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster !
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! You can obtain a copy of the license at
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! See the License for the specific language governing permissions
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster !
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! When distributing Covered Code, include this CDDL HEADER in each
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! file and include the License file at
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! add the following below this CDDL HEADER, with the fields enclosed
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! by brackets "[]" replaced with your own identifying information:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! Portions Copyright [yyyy] [name of copyright owner]
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster !
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! CDDL HEADER END
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster !
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! Copyright 2007-2008 Sun Microsystems, Inc.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ! -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster<stax>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function name="createTopology">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-prolog>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster This function creates the topology required by the Test Group/Suite.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-prolog>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-map-args>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-def name="topologyDescFile"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="None">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Topology Description file
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="filePath"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-def>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-def name="initialiseInstance"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="False">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Specifies whether the instance should be initialised with
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster some default data.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="boolean"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-def>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-def name="sharedDataFolder"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="''">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Specifies a relative folder that holds the shared data for the tests
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="string"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-def>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-map-args>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if not sharedDataFolder and CurrentTestPath.has_key('group'):
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster sharedDataFolder=CurrentTestPath['group']
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'prepareInstanceCreation'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'groupDataDir' : sharedDataFolder }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <if expr="topologyDescFile == None">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- SINGLE instance deployment: read parameters from config.py (done
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster by default) -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'SINGLE instance deployment: read parameters from config.py'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'createInstance'" />
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <if expr="RC == 0 and initialiseInstance == True">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Load the server with default data -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <import machine="STAF_LOCAL_HOSTNAME"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster file="'%s/testcases/quickstart/quickstart.xml' % (TESTS_DIR)" />
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'main_quickstart'"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </if>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <else>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- MULTIPLE instance deployment: read parameters from
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster topologyDescFile -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'MULTIPLE instance deployment: read parameters from %s' \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % topologyDescFile
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Parse the topology description file and set
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster _topologyServerList -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'readTopology'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'file' : topologyDescFile }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Number of server instances required by the deployment: %s' \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % len(_topologyServerList)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <iterate var="server" in="_topologyServerList">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Create the instance-->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'createInstance'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'dsHost' : server.getHostname(),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsDir' : server.getDir(),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsPort' : server.getPort(),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsAdminPort' : server.getAdminPort(),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsSslPort' : server.getSslPort(),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsJmxPort' : server.getJmxPort(),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsBindDN' : server.getRootDn(),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsBindPwd' : server.getRootPwd(),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsBaseDN' : server.getBaseDn()
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </iterate>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </else>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </if>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function name="prepareInstanceCreation">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-prolog>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster This function prepares locally the necessary
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster files to create an instance: data zip file and OpenDS zip file.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-prolog>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-map-args>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-def name="groupDataDir"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="''">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Specifies a relative folder that holds the shared data for the test
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster group
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="string"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-def>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-def name="fileExtensions"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="[]">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Specifies a list of file extension to add to testdata.zip
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="list"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-def>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-map-args>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- ON LOCAL HOST: get data ready to copy to remote host -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster sourceTestsGroupDir='%s/%s' % (source.data,groupDataDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster localTestsGroupDir ='%s/%s' % (local.data, groupDataDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster remoteTestsGroupDir='%s/%s' % (remote.data,groupDataDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'GetEntry'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'entry' : localTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'attribute' : 'TYPE'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- If the test data is already created then don't redo it -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <if expr="RC == 48">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Locally copy static data files to temporary staging area -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- LDIF (.ldif) test data files -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy ldif data files locally from %s to %s.' % \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (sourceTestsGroupDir,localTestsGroupDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'CopyFolderByExtension'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfolder' : sourceTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfolder' : localTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : 'ldif'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <if expr="len(fileExtensions) > 0">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <iterate var="ft" in="fileExtensions">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- add file extension test data files -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy %s data files locally from %s to %s.' % \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (ft,sourceTestsGroupDir,localTestsGroupDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'CopyFolderByExtension'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfolder' : sourceTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfolder' : localTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : '%s' % ft
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </iterate>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </if>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- LDIF (.ldif) files for quickinstall -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster quickStartGroupDir='%s/quickstart' % (source.data)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster quickStartLocalTestsGroupDir='%s/quickstart' % local.data
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy quickstart ldif data files locally from %s to %s.' % \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (quickStartGroupDir,quickStartLocalTestsGroupDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'CopyFolderByExtension'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfolder' : quickStartGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfolder' : quickStartLocalTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : 'ldif'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- PWD (.pwd) files -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy pwd data files locally from %s to %s.' % \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (sourceTestsGroupDir,localTestsGroupDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'CopyFolderByExtension'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfolder' : sourceTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfolder' : localTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : 'pwd'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Archive (.gz) files -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy gz data files locally from %s to %s.' % \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (sourceTestsGroupDir,localTestsGroupDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'CopyFolderByExtension'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfolder' : sourceTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfolder' : localTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : 'gz'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Archive (.ref) files -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy ref data files locally from %s to %s.' % \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (sourceTestsGroupDir,localTestsGroupDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'CopyFolderByExtension'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfolder' : sourceTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfolder' : localTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : 'ref'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Archive (ldap/.java) files -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster javaSharedDir='%s/ldap' % source.java
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster javaLocalDir ='%s/ldap' % local.java
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy java files locally from %s to %s.' % \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (javaSharedDir,javaLocalDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'CopyFolderByExtension'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfolder' : javaSharedDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfolder' : javaLocalDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : 'java'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Check if ldap java files are already compiled -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'listFolderByExtension'" >
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'foldername' : javaLocalDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : 'class'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <if expr="len(STAXResult) == 0">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Compile ldap java files on controler host -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Compile Java files under %s on %s' \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % (javaLocalDir, STAXServiceMachine)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'compileJava'" >
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'foldername' : '%s' % javaLocalDir
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </if>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Archive (.security) files -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy security data files locally from %s to %s.' % \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (sourceTestsGroupDir,localTestsGroupDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'CopyFolderByExtension'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfolder' : sourceTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfolder' : localTestsGroupDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : 'security'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Archive (snmp/.java) files -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster javaSharedDir = '%s/snmp' % source.java
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster javaLocalDir = '%s/snmp' % local.java
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy java files locally from %s to %s.' % \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (javaSharedDir,javaLocalDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'CopyFolderByExtension'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfolder' : javaSharedDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfolder' : javaLocalDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : 'java'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Check if 'SNMP_OPENDMK_LIBDIR' exists -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'GetEntry'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'entry' : SNMP_OPENDMK_LIBDIR,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'attribute' : 'TYPE'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- 'SNMP_OPENDMK_LIBDIR' exists so we can continue with SNMP -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <if expr="RC != 48">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Check if snmp java files are already compiled -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'listFolderByExtension'" >
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'foldername' : javaLocalDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'extension' : 'class'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <if expr="len(STAXResult) == 0">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Install DS Copy zip file -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy DS zip archive locally from %s to %s.' % \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (ZIPPATH,TMPDIR)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'copyFile'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfile' : '%s/%s' % (ZIPPATH, ZIPNAME),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfile' : '%s/%s' % (TMPDIR, ZIPNAME),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'remotehost' : STAXServiceMachine
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Install DS Extract zip file -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Extract locally DS zip archive to %s' % TMPDIR
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'unZipFile'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'zipfile' : '%s/%s' % (TMPDIR, ZIPNAME),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'unzipdir' : TMPDIR
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'ResolveVar'" >
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'type' : 'STRING',
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'name' : 'STAF/Config/STAFRoot'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if is_windows_platform(STAXServiceMachine):
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster jstaf_jarfile='%s\\bin\\JSTAF.jar' % STAFResult
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster else:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster jstaf_jarfile='%s/lib/JSTAF.jar' % STAFResult
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Compile snmp java files on controler host -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Compile Java files under %s on %s' \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % (javaLocalDir, STAXServiceMachine)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster opends_jarfile='%s/%s' % (TMPDIR,SNMP_OPENDS_JARFILE)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if is_windows_platform(STAXServiceMachine):
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster separator=';'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster else:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster separator=':'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'compileJava'" >
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'foldername' : javaLocalDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'classpath' : '%s%s%s%s%s' \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % (opends_jarfile,separator,SNMP_OPENDMK_JARFILE,separator,jstaf_jarfile)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Delete the DS zip archive -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Delete %s/%s' % (TMPDIR, ZIPNAME)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'deleteFile'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'filename' : '%s/%s' % (TMPDIR, ZIPNAME)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Delete the DS install dir -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Delete %s/%s' % (TMPDIR, OPENDSNAME)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'deleteFolder'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'foldername' : '%s/%s' % (TMPDIR, OPENDSNAME)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Archive SNMP_OPENDMK_JARFILE file -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy OpenDMK jar file %s locally to %s.' \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % (SNMP_OPENDMK_JARFILE,javaLocalDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'copyFile'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'remotehost' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'srcfile' : SNMP_OPENDMK_JARFILE,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfile' : '%s/jdmkrt.jar' % javaLocalDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'remotehost' : STAXServiceMachine
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </if>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </if>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- Delete the any existing testdata archive -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Delete %s/testdata.zip' % local.temp
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'deleteFile'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'filename' : '%s/testdata.zip' % local.temp
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Zip up local testdata files to %s/testdata.zip' % local.temp
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster javaLocalDir='%s' % local.java
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'zipUpFile'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : STAXServiceMachine,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'zipfile' : '%s/testdata.zip' % local.temp,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'folder' : local.testdata,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'relativeto' : local.directory
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <else>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Test data for %s group is already created.' % groupDataDir
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </else>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </if>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function name="createInstance">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-prolog>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster This function creates an instance on a given host.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster It copies both data and OpenDS zip files onto the host,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster unzips them, and configures OpenDS.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-prolog>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-map-args>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-def name="dsHost"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="DIRECTORY_INSTANCE_HOST">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Hostname where the instance is to be created
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="hostname"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-def>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-def name="dsDir"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="DIRECTORY_INSTANCE_DIR">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Directory where OpenDS will be installed
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="filepath"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-def>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-def name="dsPort"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="DIRECTORY_INSTANCE_PORT">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Directory Server port number
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="Port number"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-def>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-def name="dsAdminPort"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="DIRECTORY_INSTANCE_ADMIN_PORT">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Directory Server admin port number
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="Port number"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-def>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-def name="dsSslPort"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="DIRECTORY_INSTANCE_SSL_PORT">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Directory Server SSL port number
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="Port number"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-def>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-def name="dsJmxPort"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="None">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Directory Server JMX port number
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="Port number"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-def>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-def name="dsBindDN"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="DIRECTORY_INSTANCE_DN">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Directory Manager DN
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="DN"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-def>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-def name="dsBindPwd"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="DIRECTORY_INSTANCE_PSWD">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Directory Server SSL port number
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="string"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-def>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-def name="dsBaseDN"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type="optional"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster default="DIRECTORY_INSTANCE_SFX">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Directory Server base suffix dn
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="DN"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-def>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-map-args>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Create instance in host %s at directory %s' % (dsHost,dsDir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- ON REMOTE HOST: copy files, unzip, configure instance -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Delete folder if it exists on remote host-->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Delete folder %s/%s on host %s' % (dsDir,OPENDSNAME,dsHost)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'deleteFolder'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : dsHost,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'foldername' : '%s/%s' % (dsDir,OPENDSNAME)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Create folder on remote host -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Create folder %s on host %s' % (dsDir,dsHost)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'createFolder'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : dsHost,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'foldername' : '%s' % dsDir
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Copy staging data to remote host -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy %s/testdata.zip to %s on %s' % (local.testdata,dsDir,dsHost)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'copyFile'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'srcfile' : '%s/testdata.zip' % local.temp,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfile' : '%s/testdata.zip' % dsDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'remotehost' : dsHost
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Unzip contents of staging data on remote host -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Extract contents of test data %s on %s' % (dsDir,dsHost)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'unZipFile'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : dsHost,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'zipfile' : '%s/testdata.zip' % dsDir,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'unzipdir' : dsDir
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Install DS Copy zip file -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Copy DS zip archive %s/%s to %s' % (local.temp,ZIPNAME,dsHost)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'copyFile'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'srcfile' : '%s/%s' % (ZIPPATH,ZIPNAME),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'destfile' : '%s/%s' % (dsDir,ZIPNAME),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'remotehost' : dsHost
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Install DS Extract zip file -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Extract DS zip archive to %s on %s' % (dsDir,dsHost)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'unZipFile'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : dsHost,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'zipfile' : '%s/%s' % (dsDir,ZIPNAME),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'unzipdir' : dsDir
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- fixMe: Windows Services are not enabled -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <if expr="is_windows_platform(dsHost)">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster enableWindowsService=''
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <else>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster enableWindowsService=''
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </else>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </if>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!-- configure the coverage dump file -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster mylog="::coverage - checking for %s/%s/lib/emma.jar\n" % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if os.path.exists('%s/%s/lib/emma.jar' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)):
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster mylog+=" ::coverage on\n"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if not os.path.exists('%s/coverage' % TMPDIR):
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster os.mkdir('%s/coverage' % TMPDIR)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster mylog+=" ::mkdir %s/coverage on\n" % TMPDIR
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if not os.path.exists('%s/coverage/%s'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % (TMPDIR,CurrentTestPath['group'])):
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster os.mkdir('%s/coverage/%s' % (TMPDIR,CurrentTestPath['group']))
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster mylog+=" ::mkdir %s/coverage/%s on\n" \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % (TMPDIR,CurrentTestPath['group'])
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster mylog+=" ::writing to %s/%s/classes/emma.properties" \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster coveragefh = open( '%s/%s/classes/emma.properties' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME), 'w' )
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster coveragefh.write( 'coverage.out.file=%s/coverage/%s/coverage.ec\n' \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % (TMPDIR,CurrentTestPath['group']) )
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster coveragefh.close()
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>mylog</message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <!--- Set up DS -->
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Set up DS on %s : %s/%s' % (dsHost,dsDir,OPENDSNAME)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'SetUpDsWithScript'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'location' : dsHost,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsPath' : '%s/%s' % (dsDir, OPENDSNAME),
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsPort' : dsPort,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsAdminPort' : dsAdminPort,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsJmxPort' : dsJmxPort,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsBindDN' : dsBindDN,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsBindPwd' : dsBindPwd,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsBaseDN' : dsBaseDN,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsEnableWindowsService' : enableWindowsService,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'dsDoNotStart' : 'true'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <call function="'checkRC'">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster { 'returncode' : RC ,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'result' : STAXResult
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </call>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <if expr="returncode == 0">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Instance created.'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <else>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Failed to create instance.'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </else>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </if>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function name="DEPRECATEDconfigureReplication">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-prolog>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster This function configures replication in a given server.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-prolog>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-list-args>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-def name="syncserverMap" type="required">
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Map containing a Server class instance representing the server to
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster configure.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-description>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <function-arg-property name="type" value="map"/>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-arg-def>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </function-list-args>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <sequence>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster syncserver = syncserverMap['instance']
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster filename = 'replication_conf.ldif'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster filePath = '%s/%s' % (local.testdata,filename)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster dataDir = '%s/%s' % (syncserver.getDir(),remote.reldatadir)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster write_replication_conf_ldif_file(filePath, syncserver)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </script>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster <message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster 'Configure replication on server on host %s at directory %s' \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster % (syncserver.getHostname(),syncserver.getDir())
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster </message>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
<!-- Copy the replication_conf ldif to remote host -->
<message>
'Copy %s file from %s to %s' % (filename,local.testdata,dataDir)
</message>
<call function="'copyFile'">
{ 'srcfile' : filePath,
'destfile' : '%s/%s' % (dataDir,filename),
'remotehost' : syncserver.getHostname()
}
</call>
<!--- Add replication configuration entries to config.ldif in server -->
<script>
remoteFilePath = '%s/%s' % (dataDir, filename)
syncserverPath = '%s/%s' % (syncserver.getDir(),OPENDSNAME)
</script>
<!--- Start DS -->
<call function="'StartDsWithScript'">
{ 'location' : syncserver.getHostname(),
'dsPath' : syncserverPath
}
</call>
<call function="'checkRC'">
{ 'returncode' : RC ,
'result' : STAXResult
}
</call>
<message>
'Add replication configuration entries in %s' % remoteFilePath
</message>
<call function="'addEntry'">
{ 'location' : syncserver.getHostname(),
'dsPath' : syncserverPath,
'dsInstanceHost' : syncserver.getHostname(),
'dsInstancePort' : syncserver.getPort(),
'dsInstanceDn' : syncserver.getRootDn(),
'dsInstancePswd' : syncserver.getRootPwd(),
'entryToBeAdded' : remoteFilePath
}
</call>
<call function="'checkRC'">
{ 'returncode' : RC,
'result' : STAXResult
}
</call>
<!--- Stop DS -->
<call function="'StopDsWithScript'">
{ 'location' : syncserver.getHostname(),
'dsHost' : syncserver.getHostname(),
'dsPath' : syncserverPath,
'dsAdminPort' : syncserver.getAdminPort(),
'dsBindDN' : syncserver.getRootDn(),
'dsBindPwd' : syncserver.getRootPwd()
}
</call>
<call function="'checkRC'">
{ 'returncode' : RC ,
'result' : STAXResult
}
</call>
</sequence>
</function>
<function name="configureReplication">
<function-prolog>
This function configures replication in a given server.
</function-prolog>
<function-list-args>
<function-arg-def name="syncserver" type="required">
<function-arg-description>
Server class instance representing the server to configure.
</function-arg-description>
<function-arg-property name="type" value="Server"/>
</function-arg-def>
</function-list-args>
<sequence>
<!--- Configure replication using dsconfig -->
<message>
'Configure replication on server on host %s at directory %s' \
% (syncserver.getHostname(),syncserver.getDir())
</message>
<script>
syncserverPath = '%s/%s' % (syncserver.getDir(),OPENDSNAME)
</script>
<!--- Start DS -->
<call function="'StartDsWithScript'">
{ 'location' : syncserver.getHostname(),
'dsPath' : syncserverPath
}
</call>
<!-- WORK-AROUND for issue #2201 -->
<call function="'addEntry'">
{ 'location' : syncserver.getHostname(),
'dsPath' : syncserverPath,
'dsInstanceHost' : syncserver.getHostname(),
'dsInstancePort' : syncserver.getPort(),
'dsInstanceDn' : syncserver.getRootDn(),
'dsInstancePswd' : syncserver.getRootPwd(),
'entryToBeAdded' : '%s/%s/replication/workaround-2201.ldif' \
% (syncserver.getDir(),remote.reldatadir)
}
</call>
<message>
'List synchronization providers'
</message>
<call function="'listSyncProviders'">
{ 'location' : syncserver.getHostname(),
'dsPath' : syncserverPath,
'dsInstanceHost' : syncserver.getHostname(),
'dsInstanceAdminPort' : syncserver.getAdminPort(),
'dsInstanceDn' : syncserver.getRootDn(),
'dsInstancePswd' : syncserver.getRootPwd()
}
</call>
<script>
replicationServer = syncserver.getChangelogServer()
replicatedSuffixList = syncserver.getSynchronizedSuffixList()
</script>
<if expr="replicationServer">
<sequence>
<message>
'Create replication server listening on port: %s' \
% replicationServer.getPort()
</message>
<call function="'createReplicationServer'">
{ 'location' : syncserver.getHostname(),
'dsPath' : syncserverPath,
'dsInstanceHost' : syncserver.getHostname(),
'dsInstanceAdminPort' : syncserver.getAdminPort(),
'dsInstanceDn' : syncserver.getRootDn(),
'dsInstancePswd' : syncserver.getRootPwd(),
'replicationPort' : replicationServer.getPort(),
'replicationServerId' : replicationServer.getId(),
'replicationServerList' : replicationServer.getChangelogServerList()
}
</call>
</sequence>
</if>
<iterate var="suffix" in="replicatedSuffixList" indexvar="i">
<sequence>
<message>
'Create domain name for suffix: %s' % suffix.getSuffixDn()
</message>
<call function="'createMultimasterDomain'">
{ 'location' : syncserver.getHostname(),
'dsPath' : syncserverPath,
'dsInstanceHost' : syncserver.getHostname(),
'dsInstanceAdminPort' : syncserver.getAdminPort(),
'dsInstanceDn' : syncserver.getRootDn(),
'dsInstancePswd' : syncserver.getRootPwd(),
'domainName' : 'SUFFIX-%s' % i,
'replicationDn' : suffix.getSuffixDn(),
'serverId' : suffix.getId(),
'replicationServerList' : suffix.getChangelogServerList()
}
</call>
</sequence>
</iterate>
<!--- Stop DS -->
<call function="'StopDsWithScript'">
{ 'location' : syncserver.getHostname(),
'dsHost' : syncserver.getHostname(),
'dsPath' : syncserverPath,
'dsAdminPort' : syncserver.getAdminPort(),
'dsBindDN' : syncserver.getRootDn(),
'dsBindPwd' : syncserver.getRootPwd()
}
</call>
</sequence>
</function>
<!-- Enable replication between servers using dsreplication -->
<function name="enableReplication">
<function-prolog>
This function enables replication between servers using dsreplication.
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="dsInstanceHost"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsInstanceAdminPort" type="required">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="dsInstanceDn" type="required">
<function-arg-description>
Bind DN
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="dsInstancePswd" type="required">
<function-arg-description>
Bind password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="dsReplicationPort"
type="optional"
default="None">
<function-arg-description>
Replication port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="dsSecureReplication"
type="optional"
default="None">
<function-arg-description>
Encrypt communications over dsReplicationPort (secure replication)
</function-arg-description>
<function-arg-property name="type" value="boolean" />
</function-arg-def>
<function-arg-def name="refInstanceHost"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Reference Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="refInstanceAdminPort" type="required">
<function-arg-description>
Reference Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="refInstanceDn" type="required">
<function-arg-description>
Reference server Bind DN
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="refInstancePswd" type="required">
<function-arg-description>
Reference server Bind password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="refReplicationPort"
type="optional"
default="None">
<function-arg-description>
Reference server Replication port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="refSecureReplication"
type="optional"
default="None">
<function-arg-description>
Encrypt communications over refReplicationPort (secure replication)
</function-arg-description>
<function-arg-property name="type" value="boolean" />
</function-arg-def>
<function-arg-def name="replicationDnList" type="required">
<function-arg-description>
DN of the replicated suffix
</function-arg-description>
<function-arg-property name="type" value="DN list" />
</function-arg-def>
<function-arg-def name="adminUID"
type="optional"
default="AdminUID">
<function-arg-description>
Global Administrator UID
</function-arg-description>
<function-arg-property name="type" value="UID" />
</function-arg-def>
<function-arg-def name="adminPswd"
type="optional"
default="AdminPswd">
<function-arg-description>
Global Administrator password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="noSchemaReplication"
type="optional"
default="None">
<function-arg-description>
Do not enable schema replication
</function-arg-description>
<function-arg-property name="type" value="boolean" />
</function-arg-def>
<function-arg-def name="useSecondServerAsSchemaSource"
type="optional"
default="None">
<function-arg-description>
Take the refInstanceHost as the source for the schema initialisation
</function-arg-description>
<function-arg-property name="type" value="boolean" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0.
Wildcard 'noCheck' to not check the RC
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
</function-map-args>
<sequence>
<!-- Local variables -->
<script>
STAFCmdParams=''
STAFCmd=''
if dsPath:
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%s/%s%s' % (dsBinPath,DSREPLICATION,fileExt)
STAFCmdParamsList=[]
STAFCmdParamsList.append('enable')
STAFCmdParamsList.append('-n')
STAFCmdParamsList.append('-Q')
STAFCmdParamsList.append('-X')
if dsInstanceHost:
STAFCmdParamsList.append('--host1 %s' % dsInstanceHost)
if dsInstanceAdminPort:
STAFCmdParamsList.append('--port1 %s' % dsInstanceAdminPort)
if dsInstanceDn:
STAFCmdParamsList.append('--bindDN1 "%s"' % dsInstanceDn)
if dsInstancePswd:
STAFCmdParamsList.append('--bindPassword1 "%s"' % dsInstancePswd)
if dsReplicationPort:
STAFCmdParamsList.append('--replicationPort1 %s' % dsReplicationPort)
if dsSecureReplication:
STAFCmdParamsList.append('--secureReplication1')
if refInstanceHost:
STAFCmdParamsList.append('--host2 %s' % refInstanceHost)
if refInstanceAdminPort:
STAFCmdParamsList.append('--port2 %s' % refInstanceAdminPort)
if refInstanceDn:
STAFCmdParamsList.append('--bindDN2 "%s"' % refInstanceDn)
if refInstancePswd:
STAFCmdParamsList.append('--bindPassword2 "%s"' % refInstancePswd)
if refReplicationPort:
STAFCmdParamsList.append('--replicationPort2 %s' % refReplicationPort)
if refSecureReplication:
STAFCmdParamsList.append('--secureReplication2')
if replicationDnList:
for dn in replicationDnList:
STAFCmdParamsList.append('-b "%s"' % dn)
if adminUID:
STAFCmdParamsList.append('-I "%s"' % adminUID)
if adminPswd:
STAFCmdParamsList.append('-w "%s"' % adminPswd)
if noSchemaReplication:
STAFCmdParamsList.append('--noSchemaReplication')
if useSecondServerAsSchemaSource:
STAFCmdParamsList.append('--useSecondServerAsSchemaSource')
STAFCmdParams=' '.join(STAFCmdParamsList)
</script>
<call function="'runCommand'">
{ 'name' : 'Enable Replication',
'location' : location,
'command' : STAFCmd,
'arguments' : STAFCmdParams,
'expectedRC': expectedRC
}
</call>
<return>
STAXResult
</return>
</sequence>
</function>
<!-- Initialize replicated suffix with the contents of a source server using
dsreplication -->
<function name="initializeReplication">
<function-prolog>
This function initializes replicated suffixes with the contents
of a source server using dsreplication.
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="dsInstanceHost"
type="optional"
default="None">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsInstanceAdminPort"
type="optional"
default="None">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="sourceInstanceHost"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Source Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="sourceInstanceAdminPort" type="required">
<function-arg-description>
Source Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="replicationDnList" type="required">
<function-arg-description>
DN of the replicated suffix
</function-arg-description>
<function-arg-property name="type" value="DN list" />
</function-arg-def>
<function-arg-def name="adminUID"
type="optional"
default="AdminUID">
<function-arg-description>
Global Administrator UID
</function-arg-description>
<function-arg-property name="type" value="UID" />
</function-arg-def>
<function-arg-def name="adminPswd"
type="optional"
default="AdminPswd">
<function-arg-description>
Global Administrator password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0.
Wildcard 'noCheck' to not check the RC
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
</function-map-args>
<sequence>
<!-- Local variables -->
<script>
STAFCmdParams=''
STAFCmd=''
if dsPath:
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%s/%s%s' % (dsBinPath,DSREPLICATION,fileExt)
STAFCmdParamsList=[]
if dsInstanceHost:
STAFCmdParamsList.append('initialize')
else:
STAFCmdParamsList.append('initialize-all')
STAFCmdParamsList.append('-n')
STAFCmdParamsList.append('-Q')
STAFCmdParamsList.append('-X')
if dsInstanceHost:
STAFCmdParamsList.append('-O %s' % dsInstanceHost)
if dsInstanceAdminPort:
STAFCmdParamsList.append('--portDestination %s' % dsInstanceAdminPort)
if sourceInstanceHost:
STAFCmdParamsList.append('-h %s' % sourceInstanceHost)
if sourceInstanceAdminPort:
STAFCmdParamsList.append('-p %s' % sourceInstanceAdminPort)
if replicationDnList:
for dn in replicationDnList:
STAFCmdParamsList.append('-b "%s"' % dn)
if adminUID:
STAFCmdParamsList.append('-I "%s"' % adminUID)
if adminPswd:
STAFCmdParamsList.append('-w "%s"' % adminPswd)
STAFCmdParams=' '.join(STAFCmdParamsList)
</script>
<call function="'runCommand'">
{ 'name' : 'Initialize Replication',
'location' : location,
'command' : STAFCmd,
'arguments' : STAFCmdParams,
'expectedRC': expectedRC
}
</call>
<return>
STAXResult
</return>
</sequence>
</function>
<!-- Disable replication for given baseDN on server using dsreplication -->
<function name="disableReplication">
<function-prolog>
This function disables replication for a given baseDN on a server using
dsreplication.
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="dsInstanceHost"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsInstanceAdminPort" type="required">
<function-arg-description>
Directory server port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="replicationDnList" type="required">
<function-arg-description>
DN of the replicated suffix
</function-arg-description>
<function-arg-property name="type" value="DN list" />
</function-arg-def>
<function-arg-def name="adminUID"
type="optional"
default="AdminUID">
<function-arg-description>
Global Administrator UID
</function-arg-description>
<function-arg-property name="type" value="UID" />
</function-arg-def>
<function-arg-def name="adminPswd"
type="optional"
default="AdminPswd">
<function-arg-description>
Global Administrator password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0.
Wildcard 'noCheck' to not check the RC
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
</function-map-args>
<sequence>
<!-- Local variables -->
<script>
STAFCmdParams=''
STAFCmd=''
if dsPath:
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%s/%s%s' % (dsBinPath,DSREPLICATION,fileExt)
STAFCmdParamsList=[]
STAFCmdParamsList.append('disable')
STAFCmdParamsList.append('-n')
STAFCmdParamsList.append('-Q')
STAFCmdParamsList.append('-X')
if dsInstanceHost:
STAFCmdParamsList.append('-h %s' % dsInstanceHost)
if dsInstanceAdminPort:
STAFCmdParamsList.append('-p %s' % dsInstanceAdminPort)
if replicationDnList:
for dn in replicationDnList:
STAFCmdParamsList.append('-b "%s"' % dn)
if adminUID:
STAFCmdParamsList.append('-I "%s"' % adminUID)
if adminPswd:
STAFCmdParamsList.append('-w "%s"' % adminPswd)
STAFCmdParams=' '.join(STAFCmdParamsList)
</script>
<call function="'runCommand'">
{ 'name' : 'Disable Replication',
'location' : location,
'command' : STAFCmd,
'arguments' : STAFCmdParams,
'expectedRC': expectedRC
}
</call>
<return>
STAXResult
</return>
</sequence>
</function>
<function name="readTopology">
<function-prolog>
This function reads the topology from a given file.
It parses the topology description file and sets _topologyServerList, a
list of the servers that form the topology.
</function-prolog>
<function-map-args>
<function-arg-def name="file" type="required">
<function-arg-description>
File containing the topology description.
</function-arg-description>
<function-arg-property name="type" value="filePath"/>
</function-arg-def>
</function-map-args>
<sequence>
<message>
'Parse file %s for topology parameters' % file
</message>
<script>
_topologyServerList = []
f = open(file, 'r')
hostname = None
dir = None
port = None
adminport = None
sslport = None
jmxport = None
rootDn = None
rootPwd = None
baseDn = None
changelogport = None
suffixList = []
changelogList = []
serverId = 1
fileLines = f.readlines()
for line in fileLines:
if line.startswith('#'):
continue
elif line.find('Hostname') != -1:
hostname = line[line.find('Hostname') + 9:].strip()
elif line.find('Directory') !=-1:
dir = line[line.find('Directory') + 10:].strip()
elif line.find('Port') != -1:
port = line[line.find('Port') + 5:].strip()
elif line.find('Adminport') != -1:
adminport = line[line.find('Adminport') + 10:].strip()
elif line.find('Sslport') != -1:
sslport = line[line.find('Sslport') + 8:].strip()
elif line.find('Jmxport') != -1:
jmxport = line[line.find('Jmxport') + 8:].strip()
elif line.find('RootDn') != -1:
rootDn = line[line.find('RootDn') + 7:].strip()
elif line.find('RootPwd') != -1:
rootPwd = line[line.find('RootPwd') + 8:].strip()
elif line.find('BaseDn') != -1:
baseDn = line[line.find('BaseDn') + 7:].strip()
elif line.find('Changelogport') != -1:
changelogport = line[line.find('Changelogport') + 14:].strip()
elif line.find('SynchronizedSuffix') != -1:
suffixList.append( line[line.find('SynchronizedSuffix') + 19:].strip() )
elif line.find('ChangelogServer') != -1:
changelogList.append( line[line.find('ChangelogServer') + 16:].strip() )
elif (line.isspace()) or (len(line) == 0):
server = Server(hostname, dir, port, adminport, sslport, jmxport,
rootDn, rootPwd, baseDn)
if changelogport != None:
changelogServer = ChangelogServer(changelogport, serverId)
for item in changelogList:
srv = item[:item.find(':')]
prt = item[item.find(':') + 1:]
changelogServer.addChangelogServer(srv, prt)
server.addChangelogServer(changelogServer)
for suffix in suffixList:
synchroSuffix = SynchronizedSuffix(suffix, serverId)
for item in changelogList:
srv = item[:item.find(':')]
prt = item[item.find(':') + 1:]
synchroSuffix.addChangelogServer(srv, prt)
server.addSynchronizedSuffix(synchroSuffix)
_topologyServerList.append(server)
hostname = None
dir = None
port = None
adminport = None
sslport = None
jmxport = None
rootDn = None
rootPwd = None
baseDn = None
changelogport = None
suffixList = []
changelogList = []
serverId += 1
if hostname != None:
server = Server(hostname, dir, port, adminport, sslport, jmxport,
rootDn, rootPwd, baseDn)
if changelogport != None:
changelogServer = ChangelogServer(changelogport, serverId)
for item in changelogList:
srv = item[:item.find(':')]
prt = item[item.find(':') + 1:]
changelogServer.addChangelogServer(srv, prt)
server.addChangelogServer(changelogServer)
for suffix in suffixList:
synchroSuffix = SynchronizedSuffix(suffix, serverId)
for item in changelogList:
srv = item[:item.find(':')]
prt = item[item.find(':') + 1:]
synchroSuffix.addChangelogServer(srv, prt)
server.addSynchronizedSuffix(synchroSuffix)
_topologyServerList.append(server)
f.close()
</script>
</sequence>
</function>
<function name="removeInstance">
<function-prolog>
This function removes an instance on a given host.
</function-prolog>
<function-map-args>
<function-arg-def name="dsHost"
type="optional"
default="DIRECTORY_INSTANCE_HOST">
<function-arg-description>
Hostname where the instance is to be created
</function-arg-description>
<function-arg-property name="type" value="hostname"/>
</function-arg-def>
<function-arg-def name="dsDir"
type="optional"
default="DIRECTORY_INSTANCE_DIR">
<function-arg-description>
Directory where OpenDS will be installed
</function-arg-description>
<function-arg-property name="type" value="filepath"/>
</function-arg-def>
</function-map-args>
<sequence>
<message>
'Removing instance %s/%s on host %s' % (dsDir,OPENDSNAME,dsHost)
</message>
<!-- ON REMOTE HOST: remove files and folders -->
<!--- Delete staging data file on remote host-->
<message>
'Delete staging data file %s/testdata.zip' % dsDir
</message>
<call function="'deleteFile'">
{ 'location' : dsHost,
'filename' : '%s/testdata.zip' % dsDir
}
</call>
<!--- Delete staging data folder on remote host -->
<message>
'Delete staging data folder %s/shared' % dsDir
</message>
<call function="'deleteFolder'">
{ 'location' : dsHost,
'foldername' : '%s/shared' % dsDir
}
</call>
<!--- Delete OPENDS zip file on remote host-->
<message>
'Delete OPENDS zip file %s/%s' % (dsDir,ZIPNAME)
</message>
<call function="'deleteFile'">
{ 'location' : dsHost,
'filename' : '%s/%s' % (dsDir,ZIPNAME) }
</call>
<call function="'checkRC'">
{ 'returncode' : RC ,
'result' : STAXResult
}
</call>
<if expr="returncode == 0">
<message>
'Instance removed.'
</message>
<else>
<message>
'Failed to remove instance.'
</message>
</else>
</if>
</sequence>
</function>
<function name="removeTopology">
<function-prolog>
This function removes the topology created for the Test Group/Suite.
</function-prolog>
<function-map-args>
<function-arg-def name="multipleInstanceTopology"
type="optional"
default="False">
<function-arg-description>
Tells whether it is a single (i.e. parameters read from config.py) or
a multiple-instance topology (i.e. parameters read from topology desc
file).
</function-arg-description>
<function-arg-property name="type" value="boolean"/>
</function-arg-def>
</function-map-args>
<sequence>
<if expr="multipleInstanceTopology == False">
<!-- SINGLE instance deployment: parameters read from config.py (done by
default) -->
<call function="'removeInstance'" />
<else>
<!-- MULTIPLE instance deployment: parameters read from
topologyDescFile -->
<iterate var="server" in="_topologyServerList">
<call function="'removeInstance'">
{ 'dsHost' : server.getHostname(),
'dsDir' : server.getDir()
}
</call>
</iterate>
</else>
</if>
</sequence>
</function>
<!-- Prepare instance(s) for external re-initialisation of replicated suffix
using dsreplication -->
<function name="preInitializeReplication">
<function-prolog>
This function prepares one or all instances in a topology for the external
re-initialisation of replicated suffixes using dsreplication.
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="dsInstanceHost"
type="optional"
default="None">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsInstanceAdminPort"
type="optional"
default="None">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="localOnly"
type="optional"
default="None">
<function-arg-description>
Only the contents of the specified server will be initialised.
</function-arg-description>
<function-arg-property name="type" value="boolean" />
</function-arg-def>
<function-arg-def name="replicationDnList" type="required">
<function-arg-description>
DN of the replicated suffix
</function-arg-description>
<function-arg-property name="type" value="DN list" />
</function-arg-def>
<function-arg-def name="adminUID"
type="optional"
default="AdminUID">
<function-arg-description>
Global Administrator UID
</function-arg-description>
<function-arg-property name="type" value="UID" />
</function-arg-def>
<function-arg-def name="adminPswd"
type="optional"
default="AdminPswd">
<function-arg-description>
Global Administrator password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
</function-map-args>
<sequence>
<message>
'Preparing instance %s:%s for external initialization' \
% (dsInstanceHost,dsInstanceAdminPort)
</message>
<!-- Local variables -->
<script>
STAFCmdParams=''
STAFCmd=''
if dsPath:
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%s/%s%s' % (dsBinPath,DSREPLICATION,fileExt)
STAFCmdParamsList=[]
STAFCmdParamsList.append('pre-external-initialization')
STAFCmdParamsList.append('-n')
STAFCmdParamsList.append('-Q')
STAFCmdParamsList.append('-X')
if dsInstanceHost:
STAFCmdParamsList.append('-h %s' % dsInstanceHost)
if dsInstanceAdminPort:
STAFCmdParamsList.append('-p %s' % dsInstanceAdminPort)
if localOnly:
STAFCmdParamsList.append('-l')
if replicationDnList:
for dn in replicationDnList:
STAFCmdParamsList.append('-b "%s"' % dn)
if adminUID:
STAFCmdParamsList.append('-I "%s"' % adminUID)
if adminPswd:
STAFCmdParamsList.append('-w "%s"' % adminPswd)
STAFCmdParams=' '.join(STAFCmdParamsList)
</script>
<call function="'runCommand'">
{ 'name' : 'Pre-Initialize Replication',
'location' : location,
'command' : STAFCmd,
'arguments' : STAFCmdParams
}
</call>
<script>
STAXCode=RC
STAXReason=STAXResult
</script>
<call function="'checktestRC'">
{ 'returncode' : STAXCode,
'result' : STAXReason,
'expected' : expectedRC
}
</call>
<return>
STAXReason
</return>
</sequence>
</function>
<!-- End process of instance(s) external re-initialisation of replicated
suffix using dsreplication -->
<function name="postInitializeReplication">
<function-prolog>
This function ends the process of the external re-initialisation of
replicated suffixes in one or all instances in a topology using
dsreplication.
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="dsInstanceHost"
type="optional"
default="None">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsInstanceAdminPort"
type="optional"
default="None">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="replicationDnList" type="required">
<function-arg-description>
DN of the replicated suffix
</function-arg-description>
<function-arg-property name="type" value="DN list" />
</function-arg-def>
<function-arg-def name="adminUID"
type="optional"
default="AdminUID">
<function-arg-description>
Global Administrator UID
</function-arg-description>
<function-arg-property name="type" value="UID" />
</function-arg-def>
<function-arg-def name="adminPswd"
type="optional"
default="AdminPswd">
<function-arg-description>
Global Administrator password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
</function-map-args>
<sequence>
<message>
'Post-processing external initialization of instance %s:%s' \
% (dsInstanceHost,dsInstanceAdminPort)
</message>
<!-- Local variables -->
<script>
STAFCmdParams=''
STAFCmd=''
if dsPath:
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%s/%s%s' % (dsBinPath,DSREPLICATION,fileExt)
STAFCmdParamsList=[]
STAFCmdParamsList.append('post-external-initialization')
STAFCmdParamsList.append('-n')
STAFCmdParamsList.append('-Q')
STAFCmdParamsList.append('-X')
if dsInstanceHost:
STAFCmdParamsList.append('-h %s' % dsInstanceHost)
if dsInstanceAdminPort:
STAFCmdParamsList.append('-p %s' % dsInstanceAdminPort)
if replicationDnList:
for dn in replicationDnList:
STAFCmdParamsList.append('-b "%s"' % dn)
if adminUID:
STAFCmdParamsList.append('-I "%s"' % adminUID)
if adminPswd:
STAFCmdParamsList.append('-w "%s"' % adminPswd)
STAFCmdParams=' '.join(STAFCmdParamsList)
</script>
<call function="'runCommand'">
{ 'name' : 'Post-Initialize Replication',
'location' : location,
'command' : STAFCmd,
'arguments' : STAFCmdParams
}
</call>
<script>
STAXCode=RC
STAXReason=STAXResult
</script>
<call function="'checktestRC'">
{ 'returncode' : STAXCode,
'result' : STAXReason,
'expected' : expectedRC
}
</call>
<return>
STAXReason
</return>
</sequence>
</function>
<!-- Reset replicated suffix with the backup of a source server using
dsreplication -->
<function name="resetReplicationData">
<function-prolog>
This function resets the data in a replicated suffix with the backup
of a source server and re-initialises the topology using dsreplication.
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="sourceInstanceHost"
type="optional"
default="None">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="sourceInstancePort"
type="optional"
default="None">
<function-arg-description>
Directory server port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="sourceInstanceAdminPort"
type="optional"
default="None">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="sourceInstanceDn" type="required">
<function-arg-description>
Bind DN
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="sourceInstancePswd" type="required">
<function-arg-description>
Bind password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="backupDir" type="required">
<function-arg-description>
The name of the backup directory
</function-arg-description>
<function-arg-property name="type" value="pathname"/>
</function-arg-def>
<function-arg-def name="suffixDn" type="required">
<function-arg-description>
DN of the replicated suffix
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="adminUID"
type="optional"
default="AdminUID">
<function-arg-description>
Global Administrator UID
</function-arg-description>
<function-arg-property name="type" value="UID" />
</function-arg-def>
<function-arg-def name="adminPswd"
type="optional"
default="AdminPswd">
<function-arg-description>
Global Administrator password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="expectedRC"
type="optional"
default="0">
<function-arg-description>
Expected return code value. Default value is 0
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
</function-map-args>
<sequence>
<message>
'Resetting %s data in replication topology using backup %s on instance \
%s:%s' % (suffixDn,backupDir,sourceInstanceHost,sourceInstanceAdminPort)
</message>
<!-- Pre-initialise the servers in the topology -->
<call function="'preInitializeReplication'">
{ 'location' : location,
'dsPath' : dsPath,
'dsInstanceHost' : sourceInstanceHost,
'dsInstanceAdminPort' : sourceInstanceAdminPort,
'localOnly' : False,
'replicationDnList' : [suffixDn],
'adminUID' : adminUID,
'adminPswd' : adminPswd
}
</call>
<script>
import random
import java.util.Date
random.seed(java.util.Date().getTime())
resetCounter = '%s#%d' \
% (strftime('%Y-%m-%d %H:%M:%S',localtime()),random.randint(0,999))
</script>
<!-- Restore the data in the server -->
<call function="'restoreTask'">
{ 'location' : location,
'dsPath' : dsPath,
'dsInstanceHost' : sourceInstanceHost,
'dsInstancePort' : sourceInstancePort,
'dsInstanceDn' : sourceInstanceDn,
'dsInstancePswd' : sourceInstancePswd,
'taskID' : 'restore task - %s' % resetCounter,
'backupDir' : backupDir
}
</call>
<!-- Post-initialise the servers in the topology -->
<call function="'postInitializeReplication'">
{ 'location' : location,
'dsPath' : dsPath,
'dsInstanceHost' : sourceInstanceHost,
'dsInstanceAdminPort' : sourceInstanceAdminPort,
'replicationDnList' : [suffixDn],
'adminUID' : adminUID,
'adminPswd' : adminPswd
}
</call>
<!-- Initialise the servers in the topology -->
<call function="'initializeReplication'">
{ 'location' : location,
'dsPath' : dsPath,
'sourceInstanceHost' : sourceInstanceHost,
'sourceInstanceAdminPort' : sourceInstanceAdminPort,
'replicationDnList' : [suffixDn],
'adminUID' : adminUID,
'adminPswd' : adminPswd
}
</call>
<script>
STAXCode=RC
STAXReason=STAXResult
</script>
<call function="'checktestRC'">
{ 'returncode' : STAXCode,
'result' : STAXReason,
'expected' : expectedRC
}
</call>
<return>
STAXReason
</return>
</sequence>
</function>
</stax>