2N/A<?
xml version="1.0" encoding="UTF-8" standalone="no"?>
2N/A ! The contents of this file are subject to the terms of the 2N/A ! Common Development and Distribution License, Version 1.0 only 2N/A ! (the "License"). You may not use this file except in compliance 2N/A ! You can obtain a copy of the license at 2N/A ! See the License for the specific language governing permissions 2N/A ! and limitations under the License. 2N/A ! When distributing Covered Code, include this CDDL HEADER in each 2N/A ! file and include the License file at 2N/A ! add the following below this CDDL HEADER, with the fields enclosed 2N/A ! by brackets "[]" replaced with your own identifying information: 2N/A ! Portions Copyright [yyyy] [name of copyright owner] 2N/A ! Copyright 2007-2008 Sun Microsystems, Inc. 2N/A <
function name="createTopology">
2N/A This function creates the topology required by the Test
Group/
Suite.
2N/A <
function-
arg-
def name="topologyDescFile" <
function-
arg-
description>
Topology Description file
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filePath"/>
<
function-
arg-
def name="initialiseInstance" <
function-
arg-
description>
Specifies whether the instance should be initialised with
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
function-
arg-
def name="sharedDataFolder" <
function-
arg-
description>
Specifies a relative folder that holds the shared data for the tests
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
sharedDataFolder=CurrentTestPath['group']
<
call function="'prepareInstanceCreation'">
{ 'groupDataDir' : sharedDataFolder }
<
if expr="topologyDescFile == None">
<!-- SINGLE instance deployment: read parameters from config.py (done 'SINGLE instance deployment: read parameters from
config.py'
<
call function="'createInstance'" />
<
if expr="RC == 0 and initialiseInstance == True">
<!-- Load the server with default data --> <
import machine="STAF_LOCAL_HOSTNAME" <
call function="'main_quickstart'"/>
<!-- MULTIPLE instance deployment: read parameters from 'MULTIPLE instance deployment: read parameters from %s' \
<!-- Parse the topology description file and set <
call function="'readTopology'">
{ 'file' : topologyDescFile }
'Number of server instances required by the deployment: %s' \
% len(_topologyServerList)
<
iterate var="server" in="_topologyServerList">
<!-- Create the instance--> <
call function="'createInstance'">
<
function name="prepareInstanceCreation">
This function prepares locally the necessary
files to create an instance: data zip file and OpenDS zip file.
<
function-
arg-
def name="groupDataDir" <
function-
arg-
description>
Specifies a relative folder that holds the shared data for the test
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="fileExtensions" <
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="list"/>
<!-- ON LOCAL HOST: get data ready to copy to remote host --> sourceTestsGroupDir='%s/%s' % (
source.data,groupDataDir)
localTestsGroupDir ='%s/%s' % (
local.data, groupDataDir)
remoteTestsGroupDir='%s/%s' % (
remote.data,groupDataDir)
<
call function="'GetEntry'">
{ 'location' : STAXServiceMachine,
'entry' : localTestsGroupDir,
<!-- If the test data is already created then don't redo it --> <!-- Locally copy static data files to temporary staging area --> <!-- LDIF (.ldif) test data files --> 'Copy ldif data files locally from %s to %s.' % \
(sourceTestsGroupDir,localTestsGroupDir)
<
call function="'CopyFolderByExtension'">
{ 'location' : STAXServiceMachine,
'srcfolder' : sourceTestsGroupDir,
'destfolder' : localTestsGroupDir,
<
if expr="len(fileExtensions) > 0">
<
iterate var="ft" in="fileExtensions">
<!-- add file extension test data files --> 'Copy %s data files locally from %s to %s.' % \
(ft,sourceTestsGroupDir,localTestsGroupDir)
<
call function="'CopyFolderByExtension'">
{ 'location' : STAXServiceMachine,
'srcfolder' : sourceTestsGroupDir,
'destfolder' : localTestsGroupDir,
<!-- LDIF (.ldif) files for quickinstall --> 'Copy quickstart ldif data files locally from %s to %s.' % \
(quickStartGroupDir,quickStartLocalTestsGroupDir)
<
call function="'CopyFolderByExtension'">
{ 'location' : STAXServiceMachine,
'srcfolder' : quickStartGroupDir,
'destfolder' : quickStartLocalTestsGroupDir,
<!-- PWD (.pwd) files --> 'Copy pwd data files locally from %s to %s.' % \
(sourceTestsGroupDir,localTestsGroupDir)
<
call function="'CopyFolderByExtension'">
{ 'location' : STAXServiceMachine,
'srcfolder' : sourceTestsGroupDir,
'destfolder' : localTestsGroupDir,
<!-- Archive (.gz) files --> 'Copy gz data files locally from %s to %s.' % \
(sourceTestsGroupDir,localTestsGroupDir)
<
call function="'CopyFolderByExtension'">
{ 'location' : STAXServiceMachine,
'srcfolder' : sourceTestsGroupDir,
'destfolder' : localTestsGroupDir,
<!-- Archive (.ref) files --> 'Copy ref data files locally from %s to %s.' % \
(sourceTestsGroupDir,localTestsGroupDir)
<
call function="'CopyFolderByExtension'">
{ 'location' : STAXServiceMachine,
'srcfolder' : sourceTestsGroupDir,
'destfolder' : localTestsGroupDir,
'Copy java files locally from %s to %s.' % \
(javaSharedDir,javaLocalDir)
<
call function="'CopyFolderByExtension'">
'location' : STAXServiceMachine,
'srcfolder' : javaSharedDir,
'destfolder' : javaLocalDir,
<!--- Check if ldap java files are already compiled --> <
call function="'listFolderByExtension'" >
'location' : STAXServiceMachine,
'foldername' : javaLocalDir,
<
if expr="len(STAXResult) == 0">
<!--- Compile ldap java files on controler host --> 'Compile Java files under %s on %s' \
% (javaLocalDir, STAXServiceMachine)
<
call function="'compileJava'" >
'location' : STAXServiceMachine,
'foldername' : '%s' % javaLocalDir
<!-- Archive (.security) files --> 'Copy security data files locally from %s to %s.' % \
(sourceTestsGroupDir,localTestsGroupDir)
<
call function="'CopyFolderByExtension'">
{ 'location' : STAXServiceMachine,
'srcfolder' : sourceTestsGroupDir,
'destfolder' : localTestsGroupDir,
'Copy java files locally from %s to %s.' % \
(javaSharedDir,javaLocalDir)
<
call function="'CopyFolderByExtension'">
'location' : STAXServiceMachine,
'srcfolder' : javaSharedDir,
'destfolder' : javaLocalDir,
<!-- Check if 'SNMP_OPENDMK_LIBDIR' exists --> <
call function="'GetEntry'">
'location' : STAXServiceMachine,
'entry' : SNMP_OPENDMK_LIBDIR,
<!-- 'SNMP_OPENDMK_LIBDIR' exists so we can continue with SNMP --> <!--- Check if snmp java files are already compiled --> <
call function="'listFolderByExtension'" >
'location' : STAXServiceMachine,
'foldername' : javaLocalDir,
<
if expr="len(STAXResult) == 0">
<!--- Install DS Copy zip file --> 'Copy DS zip archive locally from %s to %s.' % \
<
call function="'copyFile'">
'srcfile' : '%s/%s' % (ZIPPATH, ZIPNAME),
'destfile' : '%s/%s' % (TMPDIR, ZIPNAME),
'remotehost' : STAXServiceMachine
<!--- Install DS Extract zip file --> 'Extract locally DS zip archive to %s' % TMPDIR
<
call function="'unZipFile'">
'location' : STAXServiceMachine,
'zipfile' : '%s/%s' % (TMPDIR, ZIPNAME),
<
call function="'ResolveVar'" >
'location' : STAXServiceMachine,
if is_windows_platform(STAXServiceMachine):
jstaf_jarfile='%s\\bin\\
JSTAF.jar' % STAFResult
<!--- Compile snmp java files on controler host --> 'Compile Java files under %s on %s' \
% (javaLocalDir, STAXServiceMachine)
opends_jarfile='%s/%s' % (TMPDIR,SNMP_OPENDS_JARFILE)
if is_windows_platform(STAXServiceMachine):
<
call function="'compileJava'" >
'location' : STAXServiceMachine,
'foldername' : javaLocalDir,
'classpath' : '%s%s%s%s%s' \
% (opends_jarfile,separator,SNMP_OPENDMK_JARFILE,separator,jstaf_jarfile)
<!-- Delete the DS zip archive --> 'Delete %s/%s' % (TMPDIR, ZIPNAME)
<
call function="'deleteFile'">
'location' : STAXServiceMachine,
'filename' : '%s/%s' % (TMPDIR, ZIPNAME)
<!-- Delete the DS install dir --> 'Delete %s/%s' % (TMPDIR, OPENDSNAME)
<
call function="'deleteFolder'">
'location' : STAXServiceMachine,
'foldername' : '%s/%s' % (TMPDIR, OPENDSNAME)
<!-- Archive SNMP_OPENDMK_JARFILE file --> 'Copy OpenDMK jar file %s locally to %s.' \
% (SNMP_OPENDMK_JARFILE,javaLocalDir)
<
call function="'copyFile'">
'remotehost' : STAXServiceMachine,
'srcfile' : SNMP_OPENDMK_JARFILE,
'remotehost' : STAXServiceMachine
<!-- Delete the any existing testdata archive --> <
call function="'deleteFile'">
{ 'location' : STAXServiceMachine,
<
call function="'zipUpFile'">
{ 'location' : STAXServiceMachine,
'Test data for %s group is already created.' % groupDataDir
<
function name="createInstance">
This function creates an instance on a given host.
It copies both data and OpenDS zip files onto the host,
unzips them, and configures OpenDS.
<
function-
arg-
def name="dsHost" 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 name="dsDir" 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 name="dsPort" default="DIRECTORY_INSTANCE_PORT">
<
function-
arg-
description>
Directory Server port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="Port number"/>
<
function-
arg-
def name="dsSslPort" default="DIRECTORY_INSTANCE_SSL_PORT">
<
function-
arg-
description>
Directory Server SSL port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="Port number"/>
<
function-
arg-
def name="dsJmxPort" <
function-
arg-
description>
Directory Server JMX port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="Port number"/>
<
function-
arg-
def name="dsBindDN" default="DIRECTORY_INSTANCE_DN">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="DN"/>
<
function-
arg-
def name="dsBindPwd" default="DIRECTORY_INSTANCE_PSWD">
<
function-
arg-
description>
Directory Server SSL port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsBaseDN" default="DIRECTORY_INSTANCE_SFX">
<
function-
arg-
description>
Directory Server base suffix dn
</
function-
arg-
description>
<
function-
arg-
property name="type" value="DN"/>
'Create instance in host %s at directory %s' % (dsHost,dsDir)
<!-- ON REMOTE HOST: copy files, unzip, configure instance --> <!--- Delete folder if it exists on remote host--> 'Delete folder %s/%s on host %s' % (dsDir,OPENDSNAME,dsHost)
<
call function="'deleteFolder'">
'foldername' : '%s/%s' % (dsDir,OPENDSNAME)
<!--- Create folder on remote host --> 'Create folder %s on host %s' % (dsDir,dsHost)
<
call function="'createFolder'">
'foldername' : '%s' % dsDir
<!--- Copy staging data to remote host --> <
call function="'copyFile'">
<!--- Unzip contents of staging data on remote host --> 'Extract contents of test data %s on %s' % (dsDir,dsHost)
<
call function="'unZipFile'">
<!--- Install DS Copy zip file --> 'Copy DS zip archive %s/%s to %s' % (
local.temp,ZIPNAME,dsHost)
<
call function="'copyFile'">
{ 'srcfile' : '%s/%s' % (ZIPPATH,ZIPNAME),
'destfile' : '%s/%s' % (dsDir,ZIPNAME),
<!--- Install DS Extract zip file --> 'Extract DS zip archive to %s on %s' % (dsDir,dsHost)
<
call function="'unZipFile'">
'zipfile' : '%s/%s' % (dsDir,ZIPNAME),
<!-- fixMe: Windows Services are not enabled --> <
if expr="is_windows_platform(dsHost)">
<!-- configure the coverage dump file --> mylog="::coverage - checking for %s/%
s/
lib/
emma.jar\n" % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)
mylog+=" ::coverage on\n"
% (TMPDIR,CurrentTestPath['group'])):
% (TMPDIR,CurrentTestPath['group'])
% (DIRECTORY_INSTANCE_DIR,OPENDSNAME)
% (TMPDIR,CurrentTestPath['group']) )
'Set up DS on %s : %s/%s' % (dsHost,dsDir,OPENDSNAME)
<
call function="'SetUpDsWithScript'">
'dsPath' : '%s/%s' % (dsDir, OPENDSNAME),
'dsEnableWindowsService' : enableWindowsService,
<
call function="'checkRC'">
<
if expr="returncode == 0">
'Failed to create instance.'
<
function name="DEPRECATEDconfigureReplication">
This function configures replication in a given server.
<
function-
arg-
def name="syncserverMap" type="required">
<
function-
arg-
description>
Map containing a Server class instance representing the server to
</
function-
arg-
description>
<
function-
arg-
property name="type" value="map"/>
syncserver = syncserverMap['instance']
write_replication_conf_ldif_file(filePath, syncserver)
'Configure replication on server on host %s at directory %s' \
<!-- Copy the replication_conf ldif to remote host --> <
call function="'copyFile'">
'destfile' : '%s/%s' % (dataDir,filename),
<!--- Add replication configuration entries to config.ldif in server --> remoteFilePath = '%s/%s' % (dataDir, filename)
<
call function="'StartDsWithScript'">
'dsPath' : syncserverPath
<
call function="'checkRC'">
'Add replication configuration entries in %s' % remoteFilePath
<
call function="'addEntry'">
'dsPath' : syncserverPath,
'entryToBeAdded' : remoteFilePath
<
call function="'checkRC'">
<
call function="'StopDsWithScript'">
'dsPath' : syncserverPath,
<
call function="'checkRC'">
<
function name="configureReplication">
This function configures replication in a given server.
<
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"/>
<!--- Configure replication using dsconfig --> 'Configure replication on server on host %s at directory %s' \
<
call function="'StartDsWithScript'">
'dsPath' : syncserverPath
<!-- WORK-AROUND for issue #2201 --> <
call function="'addEntry'">
'dsPath' : syncserverPath,
'List synchronization providers'
<
call function="'listSyncProviders'">
'dsPath' : syncserverPath,
<
if expr="replicationServer">
'Create replication server listening on port: %s' \
<
call function="'createReplicationServer'">
'dsPath' : syncserverPath,
<
iterate var="suffix" in="replicatedSuffixList" indexvar="i">
<
call function="'createMultimasterDomain'">
'dsPath' : syncserverPath,
'domainName' : 'SUFFIX-%s' % i,
<
call function="'StopDsWithScript'">
'dsPath' : syncserverPath,
<!-- Enable replication between servers using dsreplication --> <
function name="enableReplication">
This function enables replication between servers using dsreplication.
<
function-
arg-
def name="location" default="STAF_REMOTE_HOSTNAME">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname" />
<
function-
arg-
def name="dsPath" 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 name="dsInstanceHost" 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 name="dsInstancePort" type="required">
<
function-
arg-
description>
Directory server port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="Port number" />
<
function-
arg-
def name="dsInstanceDn" type="required">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="DN" />
<
function-
arg-
def name="dsInstancePswd" type="required">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string" />
<
function-
arg-
def name="dsReplicationPort" <
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="Port number" />
<
function-
arg-
def name="dsSecureReplication" <
function-
arg-
description>
Encrypt communications over dsReplicationPort (secure replication)
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean" />
<
function-
arg-
def name="refInstanceHost" 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 name="refInstancePort" type="required">
<
function-
arg-
description>
Reference Directory server port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="Port number" />
<
function-
arg-
def name="refInstanceDn" type="required">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="DN" />
<
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 name="refReplicationPort" <
function-
arg-
description>
Reference server Replication port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="Port number" />
<
function-
arg-
def name="refSecureReplication" <
function-
arg-
description>
Encrypt communications over refReplicationPort (secure replication)
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean" />
<
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 name="adminUID" <
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="UID" />
<
function-
arg-
def name="adminPswd" <
function-
arg-
description>
Global Administrator password
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string" />
<
function-
arg-
def name="noSchemaReplication" <
function-
arg-
description>
Do not enable schema replication
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean" />
<
function-
arg-
def name="useSecondServerAsSchemaSource" <
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 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" />
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%s/%s%s' % (dsBinPath,DSREPLICATION,fileExt)
for dn in replicationDnList:
if useSecondServerAsSchemaSource:
STAFCmdParams=' '.join(STAFCmdParamsList)
<
call function="'runCommand'">
{ 'name' : 'Enable Replication',
'arguments' : STAFCmdParams,
<!-- Initialize replicated suffix with the contents of a source server using <
function name="initializeReplication">
This function initializes replicated suffixes with the contents
of a source server using dsreplication.
<
function-
arg-
def name="location" default="STAF_REMOTE_HOSTNAME">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname" />
<
function-
arg-
def name="dsPath" 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 name="dsInstanceHost" <
function-
arg-
description>
Directory server hostname or IP address
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname" />
<
function-
arg-
def name="dsInstancePort" <
function-
arg-
description>
Directory server port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="Port number" />
<
function-
arg-
def name="sourceInstanceHost" 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 name="sourceInstancePort" type="required">
<
function-
arg-
description>
Source Directory server port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="Port number" />
<
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 name="adminUID" <
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="UID" />
<
function-
arg-
def name="adminPswd" <
function-
arg-
description>
Global Administrator password
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string" />
<
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" />
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%s/%s%s' % (dsBinPath,DSREPLICATION,fileExt)
for dn in replicationDnList:
STAFCmdParams=' '.join(STAFCmdParamsList)
<
call function="'runCommand'">
{ 'name' : 'Initialize Replication',
'arguments' : STAFCmdParams,
<!-- Disable replication for given baseDN on server using dsreplication --> <
function name="disableReplication">
This function disables replication for a given baseDN on a server using
<
function-
arg-
def name="location" default="STAF_REMOTE_HOSTNAME">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname" />
<
function-
arg-
def name="dsPath" 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 name="dsInstanceHost" 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 name="dsInstancePort" type="required">
<
function-
arg-
description>
Directory server port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="Port number" />
<
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 name="adminUID" <
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="UID" />
<
function-
arg-
def name="adminPswd" <
function-
arg-
description>
Global Administrator password
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string" />
<
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" />
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%s/%s%s' % (dsBinPath,DSREPLICATION,fileExt)
for dn in replicationDnList:
STAFCmdParams=' '.join(STAFCmdParamsList)
<
call function="'runCommand'">
{ 'name' : 'Disable Replication',
'arguments' : STAFCmdParams,
<
function name="readTopology">
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-
arg-
def name="file" type="required">
<
function-
arg-
description>
File containing the topology description.
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filePath"/>
'Parse file %s for topology parameters' % file
hostname = line[
line.find('Hostname') + 9:].strip()
dir = line[
line.find('Directory') + 10:].strip()
sslport = line[
line.find('Sslport') + 8:].strip()
jmxport = line[
line.find('Jmxport') + 8:].strip()
rootDn = line[
line.find('RootDn') + 7:].strip()
rootPwd = line[
line.find('RootPwd') + 8:].strip()
baseDn = line[
line.find('BaseDn') + 7:].strip()
changelogport = line[
line.find('Changelogport') + 14:].strip()
server = Server(hostname, dir, port, sslport, jmxport, rootDn,
if changelogport != None:
changelogServer = ChangelogServer(changelogport, serverId)
for item in changelogList:
for suffix in suffixList:
synchroSuffix = SynchronizedSuffix(suffix, serverId)
for item in changelogList:
server = Server(hostname, dir, port, sslport, jmxport, rootDn,
if changelogport != None:
changelogServer = ChangelogServer(changelogport, serverId)
for item in changelogList:
for suffix in suffixList:
synchroSuffix = SynchronizedSuffix(suffix, serverId)
for item in changelogList:
<
function name="removeInstance">
This function removes an instance on a given host.
<
function-
arg-
def name="dsHost" 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 name="dsDir" default="DIRECTORY_INSTANCE_DIR">
<
function-
arg-
description>
Directory where OpenDS will be installed
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filepath"/>
'Removing instance %s/%s on host %s' % (dsDir,OPENDSNAME,dsHost)
<!-- ON REMOTE HOST: remove files and folders --> <!--- Delete staging data file on remote host--> <
call function="'deleteFile'">
<!--- Delete staging data folder on remote host --> 'Delete staging data folder %
s/
shared' % dsDir
<
call function="'deleteFolder'">
<!--- Delete OPENDS zip file on remote host--> 'Delete OPENDS zip file %s/%s' % (dsDir,ZIPNAME)
<
call function="'deleteFile'">
'filename' : '%s/%s' % (dsDir,ZIPNAME) }
<
call function="'checkRC'">
<
if expr="returncode == 0">
'Failed to remove instance.'
<
function name="removeTopology">
This function removes the topology created for the Test
Group/
Suite.
<
function-
arg-
def name="multipleInstanceTopology" <
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
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
if expr="multipleInstanceTopology == False">
<!-- SINGLE instance deployment: parameters read from config.py (done by <
call function="'removeInstance'" />
<!-- MULTIPLE instance deployment: parameters read from <
iterate var="server" in="_topologyServerList">
<
call function="'removeInstance'">
<!-- Prepare instance(s) for external re-initialisation of replicated suffix <
function name="preInitializeReplication">
This function prepares one or all instances in a topology for the external
re-initialisation of replicated suffixes using dsreplication.
<
function-
arg-
def name="location" default="STAF_REMOTE_HOSTNAME">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname" />
<
function-
arg-
def name="dsPath" 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 name="dsInstanceHost" <
function-
arg-
description>
Directory server hostname or IP address
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname" />
<
function-
arg-
def name="dsInstancePort" <
function-
arg-
description>
Directory server port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="Port number" />
<
function-
arg-
def name="localOnly" <
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 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 name="adminUID" <
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="UID" />
<
function-
arg-
def name="adminPswd" <
function-
arg-
description>
Global Administrator password
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string" />
<
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" />
'Preparing instance %s:%s for external initialization' \
% (dsInstanceHost,dsInstancePort)
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%s/%s%s' % (dsBinPath,DSREPLICATION,fileExt)
for dn in replicationDnList:
STAFCmdParams=' '.join(STAFCmdParamsList)
<
call function="'runCommand'">
{ 'name' : 'Pre-Initialize Replication',
'arguments' : STAFCmdParams
<
call function="'checktestRC'">
{ 'returncode' : STAXCode,
<!-- End process of instance(s) external re-initialisation of replicated suffix using dsreplication --> <
function name="postInitializeReplication">
This function ends the process of the external re-initialisation of
replicated suffixes in one or all instances in a topology using
<
function-
arg-
def name="location" default="STAF_REMOTE_HOSTNAME">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname" />
<
function-
arg-
def name="dsPath" 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 name="dsInstanceHost" <
function-
arg-
description>
Directory server hostname or IP address
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname" />
<
function-
arg-
def name="dsInstancePort" <
function-
arg-
description>
Directory server port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="Port number" />
<
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 name="adminUID" <
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="UID" />
<
function-
arg-
def name="adminPswd" <
function-
arg-
description>
Global Administrator password
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string" />
<
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" />
'Post-processing external initialization of instance %s:%s' \
% (dsInstanceHost,dsInstancePort)
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%s/%s%s' % (dsBinPath,DSREPLICATION,fileExt)
for dn in replicationDnList:
STAFCmdParams=' '.join(STAFCmdParamsList)
<
call function="'runCommand'">
{ 'name' : 'Post-Initialize Replication',
'arguments' : STAFCmdParams
<
call function="'checktestRC'">
{ 'returncode' : STAXCode,
<!-- Reset replicated suffix with the backup of a source server using <
function name="resetReplicationData">
This function resets the data in a replicated suffix with the backup
of a source server and re-initialises the topology using dsreplication.
<
function-
arg-
def name="location" default="STAF_REMOTE_HOSTNAME">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname" />
<
function-
arg-
def name="dsPath" 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 name="sourceInstanceHost" <
function-
arg-
description>
Directory server hostname or IP address
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname" />
<
function-
arg-
def name="sourceInstancePort" <
function-
arg-
description>
Directory server port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="Port number" />
<
function-
arg-
def name="sourceInstanceDn" type="required">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="DN" />
<
function-
arg-
def name="sourceInstancePswd" type="required">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string" />
<
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 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 name="adminUID" <
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="UID" />
<
function-
arg-
def name="adminPswd" <
function-
arg-
description>
Global Administrator password
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string" />
<
function-
arg-
def name="expectedRC" <
function-
arg-
description>
Expected return code value. Default value is 0
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string" />
'Resetting %s data in replication topology using backup %s on instance \
%s:%s' % (suffixDn,backupDir,sourceInstanceHost,sourceInstancePort)
<!-- Pre-initialise the servers in the topology --> <
call function="'preInitializeReplication'">
'dsInstanceHost' : sourceInstanceHost,
'dsInstancePort' : sourceInstancePort,
'replicationDnList' : [suffixDn],
<!-- Restore the data in the server --> <
call function="'restoreTask'">
'dsInstanceHost' : sourceInstanceHost,
'dsInstancePort' : sourceInstancePort,
'dsInstanceDn' : sourceInstanceDn,
'dsInstancePswd' : sourceInstancePswd,
'taskID' : 'restore task - %s' % resetCounter,
<!-- Post-initialise the servers in the topology --> <
call function="'postInitializeReplication'">
'dsInstanceHost' : sourceInstanceHost,
'dsInstancePort' : sourceInstancePort,
'replicationDnList' : [suffixDn],
<!-- Initialise the servers in the topology --> <
call function="'initializeReplication'">
'sourceInstanceHost' : sourceInstanceHost,
'sourceInstancePort' : sourceInstancePort,
'replicationDnList' : [suffixDn],
<
call function="'checktestRC'">
{ 'returncode' : STAXCode,