<?
xml version="1.0" encoding="UTF-8" standalone="no"?>
! The contents of this file are subject to the terms of the ! Common Development and Distribution License, Version 1.0 only ! (the "License"). You may not use this file except in compliance ! You can obtain a copy of the license at ! See the License for the specific language governing permissions ! and limitations under the License. ! When distributing Covered Code, include this CDDL HEADER in each ! file and include the License file at ! add the following below this CDDL HEADER, with the fields enclosed ! by brackets "[]" replaced with your own identifying information: ! Portions Copyright [yyyy] [name of copyright owner] ! Copyright 2007-2008 Sun Microsystems, Inc. <
function name="importSharedLibraries">
This function imports the shared function xml libraries.
<!--- Import all the shared xml libraries --> <
import machine="STAF_LOCAL_HOSTNAME" <
import machine="STAF_LOCAL_HOSTNAME" <
import machine="STAF_LOCAL_HOSTNAME" <
import machine="STAF_LOCAL_HOSTNAME" <
import machine="STAF_LOCAL_HOSTNAME" <
import machine="STAF_LOCAL_HOSTNAME" <
import machine="STAF_LOCAL_HOSTNAME" file="'%s/ldap.xml' % (TESTS_FUNCTIONS_DIR)" />
<
import machine="STAF_LOCAL_HOSTNAME" <
import machine="STAF_LOCAL_HOSTNAME" <
import machine="STAF_LOCAL_HOSTNAME" <
import machine="STAF_LOCAL_HOSTNAME" <
function name="importPythonLibraries">
This function imports the Python libraries and objects,
both starndard and local shared ones.
<!-- Load in any standard python libraries --> <!-- Load in any standard python functions --> from time import localtime,strftime
<!-- Load in the local shared python objects from libraries --> from replication import *
<
function name="initialiseGlobalVariables">
This function initialises a set of global variables.
<!-- Resolve any OS related variables --> <
call function="'getOSvariables'">
{ 'hostname' : STAF_REMOTE_HOSTNAME }
<!-- fixMe: this needs some cleanup --> OPENDS_BINPATH ='%s/%
s/
bin' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)
<!-- Set the signal handlers --> <
call function="'signals'"/>
<!-- Initialize any global variables --> DSREPLICATION = 'dsreplication'
# Replication configuration default names
MultimasterSync = 'Multimaster Synchronization'
MultimasterType = 'multimaster'
<
function name="GetDirectoryServerInformation">
This function gets information about the Directory Server
InstanceInstallDir= '%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)
<!-- Copy DS zip archive to remote host--> 'Copy DS zip archive to %s %
s.zip.' % (STAF_REMOTE_HOSTNAME,InstanceInstallDir)
<
call function="'copyFile'">
{ 'srcfile' : '%s/%s' % (ZIPPATH,ZIPNAME),
'destfile' : '%
s.zip' % InstanceInstallDir,
'remotehost' : STAF_REMOTE_HOSTNAME }
<!-- Install DS into temporary folder --> 'Extract temporary DS zip archive to %s %s.' % (STAF_REMOTE_HOSTNAME,DIRECTORY_INSTANCE_DIR)
<
call function="'unZipFile'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'zipfile' : '%
s.zip' % InstanceInstallDir,
'unzipdir' : '%s' % DIRECTORY_INSTANCE_DIR }
<!-- Get Directory Server Variables --> <
call function="'GetDirectoryServerVars'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'dsPath' : '%s' % InstanceInstallDir }
<
throw exception="'TestExceptionResultFailed'">
<!-- Set Directory Server Variables --> <
call function="'SetVar'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'variable' : 'Job%s_ServerInfo=%s' % (STAXJobID,DSInfoServersDict) }
<
throw exception="'TestExceptionResultFailed'">
<!-- Uninstall DS from temporary folder --> 'Remove temporary DS zip archive from %s %s' % (STAF_REMOTE_HOSTNAME,InstanceInstallDir)
<
call function="'deleteFolder'">
{ 'location' : STAF_REMOTE_HOSTNAME ,
'foldername' : '%s' % InstanceInstallDir }
<
call function="'deleteFile'">
{ 'location' : STAF_REMOTE_HOSTNAME ,
'filename' : '%
s.zip' % InstanceInstallDir }
<
catch exception="'TestExceptionResultFailed'" typevar="eType" var="eInfo">
<
message>'caught %s with %s' % (eType,eInfo)</
message>
'Remove temporary DS zip archive from %s %s' % (STAF_REMOTE_HOSTNAME,InstanceInstallDir)
<
call function="'deleteFolder'">
{ 'location' : STAF_REMOTE_HOSTNAME ,
'foldername' : '%s' % InstanceInstallDir }
<
call function="'deleteFile'">
{ 'location' : STAF_REMOTE_HOSTNAME ,
'filename' : '%
s.zip' % InstanceInstallDir }
<
function name="SetLogsDir">
This function sets the directory to which logs are written
logsDate=strftime("%Y%m%d-%H%M%S",localtime())
logsOS='%s-%s' % (logsOSName,logsArch)
logsDir='%s/%s/%s-jvm%s' % (LOGS_ROOT,logsDate,logsOS,logsJvm)
logsTempDir='%
s/
temp' % logsDir
relativeSharedDir='shared'
relativeJavaDir='%
s/
java' % relativeSharedDir
relativeDataDir='%
s/
data' % relativeSharedDir
logsLocalDataDir='%s/%s' % (logsTestDataDir,relativeDataDir)
logsRemoteDataDir='%s/%s' % (DIRECTORY_INSTANCE_DIR,relativeDataDir)
'Tests logs output set to %s' % logsDir
<
call function="'SetVar'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'variable' : 'Job%s_LogsDir=%s' % (STAXJobID,logsDir) }
<
message>'Create folder %s' % logsReportDir</
message>
<
call function="'createFolder'">
{ 'location' : STAF_LOCAL_HOSTNAME,
'foldername' : '%s' % logsReportDir }
<
message>'Create folder %s' % logsTempDir</
message>
<
call function="'createFolder'">
{ 'location' : STAF_LOCAL_HOSTNAME,
'foldername' : '%s' % logsTempDir }
<
message>'Create folder %s' % logsSUTDir</
message>
<
call function="'createFolder'">
{ 'location' : STAF_LOCAL_HOSTNAME,
'foldername' : '%s' % logsSUTDir }
<
message>'Create folder %s' % logsTestsDir</
message>
<
call function="'createFolder'">
{ 'location' : STAF_LOCAL_HOSTNAME,
'foldername' : '%s' % logsTestsDir }
<
message>'Create folder %s' % logsTestDataDir</
message>
<
call function="'createFolder'">
{ 'location' : STAF_LOCAL_HOSTNAME,
'foldername' : '%s' % logsTestDataDir }
<
function name="loadEnvironment">
This function loads the environment (libraries, functions, variables)
'Load environment for test suite execution.'
<
call function="'importSharedLibraries'"/>
<
call function="'importPythonLibraries'"/>
<
call function="'initialiseGlobalVariables'"/>
<
call function="'GetDirectoryServerInformation'"/>
<
call function="'SetLogsDir'"/>
<
call function="'checkRC'">