2788N/A<?
xml version="1.0" encoding="UTF-8" standalone="no"?>
2788N/A ! The contents of this file are subject to the terms of the 2788N/A ! Common Development and Distribution License, Version 1.0 only 2788N/A ! (the "License"). You may not use this file except in compliance 2788N/A ! See the License for the specific language governing permissions 2788N/A ! and limitations under the License. 2788N/A ! When distributing Covered Code, include this CDDL HEADER in each 6982N/A ! If applicable, add the following below this CDDL HEADER, with the 6982N/A ! fields enclosed by brackets "[]" replaced with your own identifying 2788N/A ! Portions Copyright [yyyy] [name of copyright owner] 5061N/A ! Copyright 2007-2010 Sun Microsystems, Inc. 6273N/A ! Portions Copyright 2011-2013 ForgeRock AS. 2788N/A <
function name="importSharedLibraries">
2788N/A This function imports the shared function xml libraries.
2788N/A <!--- Import all the shared xml libraries --> 5362N/A <
iterate var="sharedLib" in="sharedLibs">
5362N/A <
import machine="STAF_LOCAL_HOSTNAME" 5654N/A file="'%s/%s' % (TESTS_FUNCTIONS_DIR,sharedLib)"/>
2788N/A <
function name="importPythonLibraries">
2788N/A This function imports the Python libraries and objects,
5654N/A both standard and local shared ones.
2788N/A <!-- Load in any standard python libraries --> 3862N/A <!-- Load in any additional Java classes --> 2788N/A <!-- Load in any standard python functions --> 2788N/A from time import localtime,strftime
2788N/A <!-- Load in the local shared python objects from libraries --> 2788N/A <
function name="initialiseGlobalVariables">
4458N/A This function initialises a set of global variables.
4495N/A <!-- Default LDAP Server Object --> 5616N/A TestSuiteStartTime = STAXGlobal([])
2788N/A <!-- Set the signal handlers --> 2788N/A <
call function="'signals'"/>
2788N/A <!-- Initialize any global variables --> 5061N/A if is_windows_platform(STAF_REMOTE_HOSTNAME):
5061N/A if DIRECTORY_INSTANCE_BIN != DIRECTORY_INSTANCE_DIR:
4616N/A # threshold set so that functions such as getFile may not cause staf
4616N/A # process to run out of memory (value in bytes)
3816N/A # this function return a well-formatted testcase name
3816N/A return '%s: %s: %s' % (CurrentTestPath['group'],CurrentTestPath['suite'],name)
2788N/A DSREPLICATION = 'dsreplication'
2788N/A # Replication configuration default names
2788N/A MultimasterSync = 'Multimaster Synchronization'
4458N/A MultimasterType = 'multimaster'
2788N/A <
function name="GetDirectoryServerInformation">
2788N/A This function gets information about the Directory Server
2788N/A InstanceInstallDir= '%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)
2788N/A <!-- Copy DS zip archive to remote host--> 2788N/A 'Copy DS zip archive to %s %
s.zip.' % (STAF_REMOTE_HOSTNAME,InstanceInstallDir)
2788N/A <
call function="'copyFile'">
2788N/A { 'srcfile' : '%s/%s' % (ZIPPATH,ZIPNAME),
2788N/A 'remotehost' : STAF_REMOTE_HOSTNAME }
2788N/A <!-- Install DS into temporary folder --> 2788N/A 'Extract temporary DS zip archive to %s %s.' % (STAF_REMOTE_HOSTNAME,DIRECTORY_INSTANCE_DIR)
2788N/A <
call function="'unZipFile'">
2788N/A { 'location' : STAF_REMOTE_HOSTNAME,
2788N/A 'unzipdir' : '%s' % DIRECTORY_INSTANCE_DIR }
2788N/A <!-- Get Directory Server Variables --> 2788N/A <
call function="'GetDirectoryServerVars'">
2788N/A { 'location' : STAF_REMOTE_HOSTNAME,
4153N/A 'dsPath' : '%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME) }
2788N/A <
throw exception="'TestExceptionResultFailed'">
2788N/A <!-- Set Directory Server Variables --> 2788N/A { 'location' : STAF_REMOTE_HOSTNAME,
2788N/A 'variable' : 'Job%s_ServerInfo=%s' % (STAXJobID,DSInfoServersDict) }
2788N/A <
throw exception="'TestExceptionResultFailed'">
2788N/A <!-- Uninstall DS from temporary folder --> 2788N/A 'Remove temporary DS zip archive from %s %s' % (STAF_REMOTE_HOSTNAME,InstanceInstallDir)
2788N/A <
call function="'deleteFolder'">
2788N/A { 'location' : STAF_REMOTE_HOSTNAME ,
2788N/A 'foldername' : '%s' % InstanceInstallDir }
2788N/A <
call function="'deleteFile'">
2788N/A { 'location' : STAF_REMOTE_HOSTNAME ,
2788N/A <
catch exception="'TestExceptionResultFailed'" typevar="eType" var="eInfo">
2788N/A <
message>'caught %s with %s' % (eType,eInfo)</
message>
2788N/A 'Remove temporary DS zip archive from %s %s' % (STAF_REMOTE_HOSTNAME,InstanceInstallDir)
2788N/A <
call function="'deleteFolder'">
2788N/A { 'location' : STAF_REMOTE_HOSTNAME ,
2788N/A 'foldername' : '%s' % InstanceInstallDir }
2788N/A <
call function="'deleteFile'">
2788N/A { 'location' : STAF_REMOTE_HOSTNAME ,
3816N/A <
function name="SetFolders">
3816N/A This function sets the folders to which test data are written.
3816N/A <
function-
arg-
def name="sourceDir" type="required">
3816N/A A locally accessable directory to the tests source
3816N/A </
function-
arg-
description>
3816N/A <
function-
arg-
property name="type" value="structure"/>
3816N/A <
function-
arg-
def name="localDir" type="required">
3816N/A A locally accessable directory to write test information
3816N/A </
function-
arg-
description>
3816N/A <
function-
arg-
property name="type" value="structure"/>
3816N/A <
function-
arg-
def name="remoteDir" type="required">
3816N/A A remotely accessable directory to write test information
3816N/A </
function-
arg-
description>
3816N/A <
function-
arg-
property name="type" value="structure"/>
5540N/A if host_is_localhost(STAF_REMOTE_HOSTNAME):
3816N/A <
function name="CreateFolders" scope="local">
3816N/A This function sets the folders to which logs are written
3816N/A <
call function="'createFolder'">
3816N/A { 'location' : STAF_LOCAL_HOSTNAME,
3816N/A <
call function="'createFolder'">
3816N/A { 'location' : STAF_LOCAL_HOSTNAME,
3816N/A <
call function="'createFolder'">
3816N/A { 'location' : STAF_LOCAL_HOSTNAME,
3816N/A <
call function="'createFolder'">
3816N/A { 'location' : STAF_LOCAL_HOSTNAME,
3816N/A <
call function="'createFolder'">
3816N/A { 'location' : STAF_LOCAL_HOSTNAME,
2788N/A <
call function="'createFolder'">
3816N/A { 'location' : STAF_REMOTE_HOSTNAME,
3816N/A <
function name="loadGlobalEnvironment">
2788N/A This function loads the environment (libraries, functions, variables)
3816N/A needed by the global test job farmer.
3816N/A 'Load environment for test suite execution.'
3816N/A <
call function="'importSharedLibraries'"/>
3816N/A <
call function="'importPythonLibraries'"/>
3816N/A <
call function="'initialiseGlobalVariables'"/>
3949N/A 'Remove files from previous runs under %s.' % DIRECTORY_INSTANCE_DIR
3949N/A <
call function="'deleteFolder'">
3949N/A { 'location' : STAF_REMOTE_HOSTNAME ,
4153N/A 'foldername' : '%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME) }
3949N/A <
call function="'createFolder'">
3949N/A { 'location' : STAF_REMOTE_HOSTNAME ,
4153N/A 'foldername' : '%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME) }
2788N/A <
call function="'GetDirectoryServerInformation'"/>
3816N/A <!-- Set variables to build unique path to store data --> 3816N/A logsOS='%s-%s' % (logsOSName,logsArch)
3816N/A <
call function="'SetFolders'">
3816N/A { 'sourceDir' : '%s' % TESTS_ROOT,
5061N/A 'localDir' : '%s' % LOGS_ROOT,
3816N/A 'remoteDir' : DIRECTORY_INSTANCE_DIR }
3816N/A { 'location' : STAF_REMOTE_HOSTNAME,
3816N/A <!-- Create the local folders to store data --> 3816N/A <
call function="'CreateFolders'"/>
4458N/A <
call function="'copyFile'">
4458N/A <
call function="'copyFile'">
5061N/A <
call function="'copyFile'">
3816N/A <
function name="loadJobEnvironment">
3816N/A This function loads the environment (libraries, functions, variables)
3816N/A <
function-
arg-
def name="parent" type="optional" default="''">
3816N/A </
function-
arg-
description>
3816N/A <
function-
arg-
property name="type" value="integer"/>
3816N/A 'Load environment for test suite execution.'
4116N/A <!-- All exceptions are logged to user log --> 3816N/A <
call function="'importSharedLibraries'"/>
3816N/A <
call function="'importPythonLibraries'"/>
3816N/A <
call function="'initialiseGlobalVariables'"/>
3816N/A { 'location' : STAF_REMOTE_HOSTNAME,
3816N/A 'variable' : 'Job%s_LogsDir' % parent }
3816N/A <!-- TODO: defend against mangled STAFResult --> 3816N/A <
message>'%s' % parentsLogDir</
message>
3816N/A <
call function="'SetFolders'">
3816N/A { 'sourceDir' : '%s' % TESTS_ROOT,
3816N/A 'localDir' : '%s' % parentsLogDir,
3816N/A 'remoteDir' : DIRECTORY_INSTANCE_DIR }