1372N/A<?
xml version="1.0" encoding="UTF-8" standalone="no"?>
1372N/A ! The contents of this file are subject to the terms of the 1372N/A ! Common Development and Distribution License, Version 1.0 only 1372N/A ! (the "License"). You may not use this file except in compliance 1372N/A ! You can obtain a copy of the license at 1372N/A ! See the License for the specific language governing permissions 1372N/A ! and limitations under the License. 1372N/A ! When distributing Covered Code, include this CDDL HEADER in each 1372N/A ! file and include the License file at 1372N/A ! add the following below this CDDL HEADER, with the fields enclosed 1372N/A ! by brackets "[]" replaced with your own identifying information: 1372N/A ! Portions Copyright [yyyy] [name of copyright owner] 3215N/A ! Copyright 2007-2010 Sun Microsystems, Inc. 1372N/A <
function name="_adminCommonArgs">
1372N/A This function resolves common admin arguments
1372N/A <!-- This function sets up DS using the setup script --> 1372N/A <
function name="SetUpDsWithScript" scope="local">
1372N/A This function sets up a Directory Server using a script
1372N/A <
function-
arg-
def name="location" 1372N/A default="STAF_REMOTE_HOSTNAME">
2175N/A </
function-
arg-
description>
1372N/A <
function-
arg-
property name="type" value="hostname"/>
2175N/A <
function-
arg-
def name="dsPath" 2175N/A default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
1372N/A Pathname to installation root
2175N/A </
function-
arg-
description>
1372N/A <
function-
arg-
property name="type" value="filepath"/>
2175N/A <
function-
arg-
def name="dsPort" type="optional">
1372N/A Directory server port number
1372N/A </
function-
arg-
description>
1372N/A <
function-
arg-
property name="type" value="Port number"/>
2175N/A <
function-
arg-
def name="dsAdminPort" 2175N/A default="DIRECTORY_INSTANCE_ADMIN_PORT">
2175N/A Directory server admin port number
1372N/A </
function-
arg-
description>
1372N/A <
function-
arg-
property name="type" value="Port number"/>
1372N/A <
function-
arg-
def name="dsJmxPort" type="optional">
1372N/A Directory server JMX port number
1372N/A </
function-
arg-
description>
1372N/A <
function-
arg-
property name="type" value="Port number"/>
<
function-
arg-
def name="dsBaseDN" type="optional">
<
function-
arg-
description>
Base DN (only single base DN supported).
</
function-
arg-
description>
<
function-
arg-
property name="type" value="DN"/>
<
function-
arg-
def name="dsBindDN" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="DN"/>
<
function-
arg-
def name="dsBindPwd" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsBindPwdFile" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filename"/>
<
function-
arg-
def name="dsEnableWindowsService" type="optional">
<
function-
arg-
description>
Enable as a Windows Service
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
function-
arg-
def name="dsDoNotStart" type="optional">
<
function-
arg-
description>
Do not start server after setup
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
function-
arg-
def name="dsHelp" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="help" value="option"/>
<
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-
def name="knownIssue" type="optional" default="None">
<
function-
arg-
description>
Known issue. Corresponds to an issue number.
</
function-
arg-
description>
<!-- Build the Command --> STAFCmd='%
s/
setup%s' % (dsPath,fileExt)
if dsEnableWindowsService:
STAFCmdParams=' '.join(STAFCmdParamsList)
'%s %s' % (STAFCmd, STAFCmdParams)
<
call function="'runCommand'">
'name' : 'Setup DS Script',
'arguments' : STAFCmdParams,
'expectedRC': expectedRC,
<!-- This function starts DS using the start-ds script --> <
function name="StartDsWithScript">
This function starts a Directory Server
<
function-
arg-
def name="location" type="optional" default="STAF_REMOTE_HOSTNAME">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname"/>
<
function-
arg-
def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname"/>
<
function-
arg-
def name="dsVersion" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsSystemInfo" type="optional">
<
function-
arg-
description>
Directory server system info
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsNoDetach" type="optional">
<
function-
arg-
description>
Do not detach directory server from process
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsHelp" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsBuildInfo" type="optional">
<
function-
arg-
description>
Directory server build information
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
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-
def name="knownIssue" type="optional" default="None">
<
function-
arg-
description>
Known issue. Corresponds to an issue number.
</
function-
arg-
description>
<!-- Build the Command --> dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%
s/
start-ds%s' % (dsBinPath,fileExt)
STAFCmdParams=' '.join(STAFCmdParamsList)
'%s %s' % (STAFCmd, STAFCmdParams)
<
call function="'GetEntry'">
'location' : STAF_REMOTE_HOSTNAME ,
<!-- 'emma.jar' exists so we can configure the coverage dump file --> resultsPath =
os.path.join(resultsCoveragePath,CurrentTestPath['group'])
ecPath =
os.path.join(remoteCoveragePath,CurrentTestPath['group'])
<
call function="'createFolder'">
{ 'location' : STAXServiceMachine,
'foldername' : resultsCoveragePath
<
call function="'createFolder'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'foldername' : remoteCoveragePath
<
call function="'createFolder'">
{ 'location' : STAF_REMOTE_HOSTNAME,
<
call function="'listFolderByExtension'" >
'location' : STAF_REMOTE_HOSTNAME,
<
call function="'copyFile'">
'remotehost' : STAF_REMOTE_HOSTNAME }
<
call function="'copyFile'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'remotehost' : STAF_REMOTE_HOSTNAME }
<
call function="'copyFile'">
{ 'location' : STAF_REMOTE_HOSTNAME,
'remotehost' : STAF_REMOTE_HOSTNAME }
<
call function="'runCommand'">
'arguments' : STAFCmdParams,
'expectedRC': expectedRC,
<
return>STAXResult</
return>
<!-- This function stops DS using the stop-ds script --> <
function name="StopDsWithScript">
This function starts a Directory Server using the script
<
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_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname"/>
<
function-
arg-
def name="dsHost" type="optional">
<
function-
arg-
description>
Directory server hostname or IP address
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname"/>
<
function-
arg-
def name="dsAdminPort" type="optional">
<
function-
arg-
description>
Directory server admin port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsUseSSL" type="optional">
<
function-
arg-
description>
Use SSL for secure communication with the server
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsUseStartTLS" type="optional">
<
function-
arg-
description>
Use StartTLS for secure communication with the server
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsBindDN" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="DN"/>
<
function-
arg-
def name="dsBindPwd" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsBindPwdFile" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filepath"/>
<
function-
arg-
def name="dsSaslOption" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsProxyAuthZID" type="optional">
<
function-
arg-
description>
Use the proxied authorization control with the given authorization ID
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsStopReason" type="optional">
<
function-
arg-
description>
Reason the server is being stopped or restarted
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsRestart" type="optional">
<
function-
arg-
description>
Attempt to automatically restart the server once it has stopped
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsStopTime" type="optional">
<
function-
arg-
description>
Time to begin the shutdown in YYYYMMDDhhmmss format (local time)
</
function-
arg-
description>
<
function-
arg-
property name="type" value="timestamp"/>
<
function-
arg-
def name="dsTrustAll" type="optional">
<
function-
arg-
description>
Trust all server SSL certificates
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsKeyStoreFile" type="optional">
<
function-
arg-
description>
Certificate keystore path
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filename"/>
<
function-
arg-
def name="dsKeyStorePwd" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsKeyStorePwdFile" type="optional">
<
function-
arg-
description>
Certificate keystore PIN file
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filename"/>
<
function-
arg-
def name="dsTrustStoreFile" type="optional">
<
function-
arg-
description>
Certificate trust store path
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filename"/>
<
function-
arg-
def name="dsTrustStorePwd" type="optional">
<
function-
arg-
description>
Certificate trust store PIN
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsTrustStorePwdFile" type="optional">
<
function-
arg-
description>
Certificate trust store PIN file
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filename"/>
<
function-
arg-
def name="dsHelp" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="noOfLoops" <
function-
arg-
description>
Number of iterations (for isStopped())
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="noOfMilliSeconds" <
function-
arg-
description>
Number of seconds to wait between iterations (for isStopped())
</
function-
arg-
description>
<
function-
arg-
property name="type" value="seconds"/>
<
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-
def name="knownIssue" type="optional" default="None">
<
function-
arg-
description>
Known issue. Corresponds to an issue number.
</
function-
arg-
description>
<!-- Build the Command --> dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%
s/
stop-ds%s' % (dsBinPath,fileExt)
STAFCmdParams=' '.join(STAFCmdParamsList)
'%s %s' % (STAFCmd, STAFCmdParams)
<
call function="'runCommand'">
'name' : 'Stop DS Script',
'arguments' : STAFCmdParams,
'expectedRC': expectedRC,
<
if expr="is_windows_platform(location) and RC == 1 and expectedRC == 0">
<
call function="'setKnownIssue'">
{ 'issueId' : '6931748' }
<
if expr="expectedRC == 0 or expectedRC == 'noCheck'">
<!--- Check that DS stopped --> <
if expr="IPS_PKG == True">
<
call function="'isStopped'">
'dsPath' : '%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME),
'noOfMilliSeconds' : 6000
<
call function="'isStopped'">
'noOfMilliSeconds' : noOfMilliSeconds
<!-- Import-ldif Function --> <
function name="ImportLdifWithScript">
This function performs an import of an ldif file
<
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_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
property name="type" value="pathname"/>
<
function-
arg-
def name="dsInstanceHost" type="optional">
<
function-
arg-
description>
Directory server host name
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsInstancePort" type="optional">
<
function-
arg-
description>
Directory server port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsInstanceAdminPort" type="optional">
<
function-
arg-
description>
Directory server admin port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsInstanceDn" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="dn"/>
<
function-
arg-
def name="dsInstancePswd" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="taskID" type="optional">
<
function-
arg-
description>
The identifier for the task
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="ldifFile" type="optional">
<
function-
arg-
description>
The name of the ldif file
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="backEnd" default="DIRECTORY_INSTANCE_BE">
<
function-
arg-
description>
Optional the name of the database backend
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="wrapColumn" type="optional">
<
function-
arg-
description>
Column at which to wrap long lines
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="startTask" type="optional" default="'0'">
<
function-
arg-
description>
Optional exclude attributes
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="isCompressed" type="optional">
<
function-
arg-
description>
Optional exported ldif data file compressed
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
function-
arg-
def name="isEncrypted" type="optional">
<
function-
arg-
description>
Optional exported ldif data file encrypted
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
function-
arg-
def name="append" type="optional">
<
function-
arg-
description>
Optional append exported ldif data
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
function-
arg-
def name="skipSchemaValidation" type="optional">
<
function-
arg-
description>
Optional do not perform any schema validation
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
function-
arg-
def name="templateFile" type="optional">
<
function-
arg-
description>
Optional path to a MakeLDIF template to generate the import data.
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
function-
arg-
def name="skipFile" type="optional">
<
function-
arg-
description>
Optional identify entries that were skipped during the import
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
function-
arg-
def name="overwriteFile" type="optional">
<
function-
arg-
description>
Optional overwrite the specified skip file or reject file
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
function-
arg-
def name="replaceExisting" type="optional">
<
function-
arg-
description>
Optional replace existing data with the content from the import
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
function-
arg-
def name="rejectFile" type="optional">
<
function-
arg-
description>
Optional file to hold any rejected entries during the import
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
function-
arg-
def name="excludeBranches" type="optional" default="''">
<
function-
arg-
description>
Optional exclude branches
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="includeBranches" type="optional" default="''">
<
function-
arg-
description>
Optional include branches
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="excludeAttributes" type="optional" default="''">
<
function-
arg-
description>
Optional exclude attributes
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="includeAttributes" type="optional" default="''">
<
function-
arg-
description>
Optional include attributes
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="excludeFilters" type="optional" default="''">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="includeFilters" type="optional" default="''">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="isSignedHash" type="optional" default="'False'">
<
function-
arg-
description>
Optional generate a signed hash of the export data
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
function-
arg-
def name="extraParams" type="optional" default="''">
<
function-
arg-
description>
Optional extra parameters for specific test cases
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="numLdapCheckTries" type="optional" default="10">
<
function-
arg-
description>
Number of ldap check tries when checking if task is complete
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="sleepBetweenLdapCheckTries" type="optional" default="2000">
<
function-
arg-
description>
Sleep time in milliseconds between ldap check tries
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
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="integer"/>
<
function-
arg-
def name="knownIssue" type="optional" default="None">
<
function-
arg-
description>
Known issue. Corresponds to an issue number.
</
function-
arg-
description>
<
function-
arg-
def name="schedulePattern" type="optional">
<
function-
arg-
description>
Indicates the task is recurring and will be scheduled
according to the value argument expressed in crontab(5)
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<!-- Set common ldap arguments --> <
call function="'_adminCommonArgs'" />
dsBinPath='%s/%s' % (dsPath,fileFolder)
for branch in excludeBranches:
for branch in includeBranches:
for attribute in excludeAttributes:
for attribute in includeAttributes:
for attribute in includeFilters:
for attribute in excludeFilters:
STAFCmdParams=' '.join(STAFCmdParamsList)
'%s %s' % (STAFCmd, STAFCmdParams)
<
call function="'runCommand'">
'name' : 'Import Script',
'arguments' : STAFCmdParams,
'expectedRC' : expectedRC,
'knownIssue' : knownIssue
savSTAXResult = STAXResult
resultString = STAXResult[0][1]
<
if expr="dsInstanceDn != None and expectedRC == 0 and schedulePattern == None">
'Check import-ldif task successfully completed'
<
call function="'checkTaskExecution'">
'dsInstanceAdminPort' : dsInstanceAdminPort,
'dsInstanceHost' : dsInstanceHost ,
'dsInstanceDn' : dsInstanceDn ,
'dsInstancePswd' : dsInstancePswd ,
'outputToCheck' : resultString
<!-- Check Import Function --> <
function name="checkImport">
This function verifies an import of an ldif file
<
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_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
property name="type" value="pathname"/>
<
function-
arg-
def name="dsHost" default="DIRECTORY_INSTANCE_HOST">
<
function-
arg-
description>
Directory server hostname or IP address
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname"/>
<
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="dsAdminPort" default="DIRECTORY_INSTANCE_ADMIN_PORT">
<
function-
arg-
description>
Directory server admin port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="Port number"/>
<
function-
arg-
def name="dsDn" default="DIRECTORY_INSTANCE_DN">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="DN"/>
<
function-
arg-
def name="dsPswd" default="DIRECTORY_INSTANCE_PSWD">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="expectedEntries" type="required">
<
function-
arg-
description>
Entries expected to be present after import
</
function-
arg-
description>
<
function-
arg-
property name="type" value="list"/>
<
function-
arg-
def name="missingEntries" <
function-
arg-
description>
Optional entries expected to be missing after import
</
function-
arg-
description>
<
function-
arg-
property name="type" value="list"/>
<
function-
arg-
def name="expectedAttributes" <
function-
arg-
description>
Optional attributes expected to be present after import
</
function-
arg-
description>
<
function-
arg-
property name="type" value="list"/>
<
function-
arg-
def name="missingAttributes" <
function-
arg-
description>
Optional attributes expected to be missing after import
</
function-
arg-
description>
<
function-
arg-
property name="type" value="list"/>
<
function-
arg-
def name="suffix" default="DIRECTORY_INSTANCE_SFX">
<
function-
arg-
description>
Optional main suffix for the import
</
function-
arg-
description>
<
function-
arg-
property name="type" value="list"/>
<
function-
arg-
def name="startDS" type="optional" default="'yes'">
<
function-
arg-
description>
Optional start the Directory Server after import
</
function-
arg-
description>
<
function-
arg-
property name="type" value="list"/>
<!-- Assume that if DS is not started then there is no need to stop it --> <!-- Do we need to start the DS --> <
if expr="startDS == 'yes'">
<
call function="'StartDsWithScript'">
{ 'location' : myLocation,
<!-- Wait for DS to start --> <
call function="'isAlive'">
{ 'location' : myLocation,
'dsInstanceHost' : myhost ,
'dsInstancePort' : myport ,
'dsInstancePswd' : mypswd ,
'noOfMilliSeconds' : 2000 }
<!-- Search for expected entries --> <
iterate var="expectedEntry" in="expectedEntries">
<
call function="'SearchObject'">
{ 'location' : myLocation ,
'dsInstanceHost' : myhost ,
'dsInstancePort' : myport ,
'dsInstancePswd' : mypswd ,
'dsBaseDN' : '%s' % expectedEntry ,
'dsFilter' : 'objectclass=*',
<
call function="'checktestRC'">
<!-- Search for missing entries --> <
iterate var="missingEntry" in="missingEntries">
<
if expr="missingEntry == 'NULL'">
<
call function="'SearchObject'">
{ 'location' : myLocation ,
'dsInstanceHost' : myhost ,
'dsInstancePort' : myport ,
'dsInstancePswd' : mypswd ,
'dsBaseDN' : '%s' % missingEntry ,
'dsFilter' : 'objectclass=*' ,
<!-- Do we need to stop the Directory Server --> <
if expr="stopDS == 'yes'">
<
call function="'StopDsWithScript'">
{ 'location' : myLocation ,
'dsAdminPort' : myadminport ,
<!-- Export-ldif Function --> <
function name="exportLdifWithScript">
This function performs an on line export task of an ldif file
<
function-
arg-
def name="location" type="optional" default="STAF_REMOTE_HOSTNAME">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname"/>
<
function-
arg-
def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
property name="type" value="pathname"/>
<
function-
arg-
def name="dsInstanceHost" type="optional">
<
function-
arg-
description>
Directory server host name
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsInstancePort" type="optional">
<
function-
arg-
description>
Directory server port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsInstanceAdminPort" type="optional">
<
function-
arg-
description>
Directory server admin port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsInstanceDn" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="dn"/>
<
function-
arg-
def name="dsInstancePswd" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="taskID" type="optional">
<
function-
arg-
description>
The identifier for the task
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="ldifFile" type="optional">
<
function-
arg-
description>
The name of the ldif file
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="backEnd" type="optional" default="DIRECTORY_INSTANCE_BE">
<
function-
arg-
description>
Optional the name of the database backend
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="wrapColumn" type="optional">
<
function-
arg-
description>
Column at which to wrap long lines
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="startTask" type="optional" default="'0'">
<
function-
arg-
description>
Optional exclude attributes
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="isCompressed" type="optional">
<
function-
arg-
description>
Optional exported ldif data file compressed
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
function-
arg-
def name="isEncrypted" type="optional">
<
function-
arg-
description>
Optional exported ldif data file encrypted
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
function-
arg-
def name="append" type="optional">
<
function-
arg-
description>
Optional append exported ldif data
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
function-
arg-
def name="excludeBranches" type="optional" default="''">
<
function-
arg-
description>
Optional exclude branches
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="includeBranches" type="optional" default="''">
<
function-
arg-
description>
Optional include branches
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="excludeAttributes" type="optional" default="''">
<
function-
arg-
description>
Optional exclude attributes
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="includeAttributes" type="optional" default="''">
<
function-
arg-
description>
Optional include attributes
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="excludeFilters" type="optional" default="''">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="includeFilters" type="optional" default="''">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="isSignedHash" type="optional" default="'False'">
<
function-
arg-
description>
Optional generate a signed hash of the export data
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
function-
arg-
def name="extraParams" type="optional" default="''">
<
function-
arg-
description>
Optional extra parameters for specific test cases
</
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="integer"/>
<
function-
arg-
def name="schedulePattern" type="optional">
<
function-
arg-
description>
Indicates the task is recurring and will be scheduled
according to the value argument expressed in crontab(5)
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<!-- Set common ldap arguments --> <
call function="'_adminCommonArgs'" />
dsBinPath='%s/%s' % (dsPath,fileFolder)
for branch in excludeBranches:
for branch in includeBranches:
for attribute in excludeAttributes:
for attribute in includeAttributes:
for filter in includeFilters:
for filter in excludeFilters:
STAFCmdParams=' '.join(STAFCmdParamsList)
'%s %s' % (STAFCmd, STAFCmdParams)
<
call function="'runCommand'">
'name' : 'Export Script',
'arguments' : STAFCmdParams,
'expectedRC' : expectedRC
resultString = STAXResult[0][1]
<
if expr="dsInstanceDn != None and expectedRC == 0 and schedulePattern == None">
'Check export-ldif task successfully completed'
<
call function="'checkTaskExecution'">
'dsInstanceAdminPort' : dsInstanceAdminPort,
'dsInstanceHost' : dsInstanceHost ,
'dsInstanceDn' : dsInstanceDn ,
'dsInstancePswd' : dsInstancePswd ,
'outputToCheck' : resultString
This function performs an off line backup
<
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_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
property name="type" value="pathname"/>
<
function-
arg-
def name="dsInstanceHost" type="optional">
<
function-
arg-
description>
Directory server hostname or IP address
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname"/>
<
function-
arg-
def name="dsInstanceAdminPort" type="optional">
<
function-
arg-
description>
Directory server admin port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="Port number"/>
<
function-
arg-
def name="dsInstanceDn" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="DN"/>
<
function-
arg-
def name="dsInstancePswd" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="backEnd" type="optional" default="DIRECTORY_INSTANCE_BE">
<
function-
arg-
description>
Optional the name of the database backend
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="backupDir" type="required">
<
function-
arg-
description>
The directory where the backup files will be placed
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="extraParams" type="optional" default="''">
<
function-
arg-
description>
Optional extra parameters for specific test cases
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="startTask" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
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="integer"/>
<
function-
arg-
def name="knownIssue" type="optional" default="None">
<
function-
arg-
description>
Known issue. Corresponds to an issue number.
</
function-
arg-
description>
<
function-
arg-
def name="schedulePattern" type="optional">
<
function-
arg-
description>
Indicates the task is recurring and will be scheduled
according to the value argument expressed in crontab(5)
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="backupID" type="optional">
<
function-
arg-
description>
Use the provided identifier for the backup
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<!-- Set common ldap arguments --> <
call function="'_adminCommonArgs'" />
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%
s/
backup%s' % (dsBinPath,fileExt)
STAFCmdParams=' '.join(STAFCmdParamsList)
'%s %s' % (STAFCmd, STAFCmdParams)
<
call function="'runCommand'">
'name' : 'Backup Script',
'arguments' : STAFCmdParams,
'expectedRC': expectedRC,
<!-- Backup Task Function --> <
function name="backupTask">
This function performs an on line backup task
<
function-
arg-
def name="location" type="optional" default="STAF_REMOTE_HOSTNAME">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname"/>
<
function-
arg-
def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
property name="type" value="pathname"/>
<
function-
arg-
def name="dsInstanceHost" type="optional">
<
function-
arg-
description>
Directory server host name
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsInstancePort" type="optional">
<
function-
arg-
description>
Directory server port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsInstanceDn" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="dn"/>
<
function-
arg-
def name="dsInstancePswd" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
def name="taskID" type="optional">
<
function-
arg-
description>
The identifier for the task
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="backupDir" type="required">
<
function-
arg-
description>
Path to the target directory for the backup file(s)
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filepath"/>
<
function-
arg-
def name="backEnd" type="optional" default="DIRECTORY_INSTANCE_BE">
<
function-
arg-
description>
Optional the name of the database backend
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="backupAll" type="optional" default="'False'">
<
function-
arg-
description>
Optional back up all backends in the server
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
function-
arg-
def name="backupIncremental" type="optional">
<
function-
arg-
description>
Optional perform an incremental backup rather than a full backup
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="backupIncrementalId" type="optional">
<
function-
arg-
description>
Optional use the provided identifier for the backup
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="Compress" type="optional" default="'FALSE'">
<
function-
arg-
description>
Optional backup contents compressed
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
function-
arg-
def name="Encrypt" type="optional" default="'FALSE'">
<
function-
arg-
description>
Optional backup contents encrypted
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
function-
arg-
def name="signHash" type="optional" default="'FALSE'">
<
function-
arg-
description>
Optional generate a signed hash of the backup data
</
function-
arg-
description>
<
function-
arg-
property name="type" value="boolean"/>
<
function-
arg-
def name="hash" type="optional" default="'FALSE'">
<
function-
arg-
description>
Optional generate a hash of the backup data
</
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="integer"/>
taskDN='ds-task-id=%s,cn=Scheduled Tasks,cn=Tasks' % taskID
<!-- Build the backup task configuration object --> ldifLines.append('ds-task-backup-incremental-base-id: %s' % backupIncrementalId )
<!-- Write out the backup-task ldif --> outfile = open(tmpTaskLdif,"w")
<!-- Copy the backup-task ldif to remote host --> <
message>'Copy backup task ldif file.'</
message>
<
call function="'copyFile'">
{ 'location' : STAXServiceMachine,
'remotehost' : myLocation }
<!-- Start the task using ldap task interface --> <
call function="'StartLdapTask'">
{ 'location' : myLocation,
'taskLabel' : 'Online Backup Task',
'dsHost' : dsInstanceHost,
'dsPort' : dsInstancePort,
'dsBindDn' : dsInstanceDn,
'dsBindPswd' : dsInstancePswd,
'expectedRC' : expectedRC }
<!-- Check that the ldap task is completed --> <
if expr="STAFCmdRC == 0">
<
call function="'CheckLdapTask'">
{ 'location' : myLocation,
'dsHost' : dsInstanceHost,
'dsPort' : dsInstancePort,
'dsBindDn' : dsInstanceDn,
'dsBindPswd' : dsInstancePswd }
<
message>'Check CheckLdapTask returns RC=0'</
message>
<
call function="'checktestRC'">
<!-- Restore Function --> <
function name="restore">
This function performs an off line restore
<
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_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
property name="type" value="pathname"/>
<
function-
arg-
def name="dsInstanceHost" type="optional">
<
function-
arg-
description>
Directory server hostname or IP address
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname"/>
<
function-
arg-
def name="dsInstanceAdminPort" type="optional">
<
function-
arg-
description>
Directory server admin port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="Port number"/>
<
function-
arg-
def name="dsInstanceDn" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="DN"/>
<
function-
arg-
def name="dsInstancePswd" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="backupDir" type="required">
<
function-
arg-
description>
The directory where the backup files will be placed
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="extraParams" type="optional" default="''">
<
function-
arg-
description>
Optional extra parameters for specific test cases
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="startTask" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
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="integer"/>
<
function-
arg-
def name="knownIssue" type="optional" default="None">
<
function-
arg-
description>
Known issue. Corresponds to an issue number.
</
function-
arg-
description>
<
function-
arg-
def name="schedulePattern" type="optional">
<
function-
arg-
description>
Indicates the task is recurring and will be scheduled
according to the value argument expressed in crontab(5)
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="backupID" type="optional">
<
function-
arg-
description>
Use the provided identifier for the backup
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<!-- Set common ldap arguments --> <
call function="'_adminCommonArgs'" />
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%
s/
restore%s' % (dsBinPath,fileExt)
STAFCmdParams=' '.join(STAFCmdParamsList)
'%s %s' % (STAFCmd, STAFCmdParams)
<
call function="'runCommand'">
'name' : 'Restore Script',
'arguments' : STAFCmdParams,
'expectedRC': expectedRC,
<!-- Restore Task Function --> <
function name="restoreTask">
This function performs an on line restore task of a backup file
<
function-
arg-
def name="location" type="optional" default="STAF_REMOTE_HOSTNAME">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname"/>
<
function-
arg-
def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
property name="type" value="pathname"/>
<
function-
arg-
def name="dsInstanceHost" type="optional">
<
function-
arg-
description>
Directory server host name
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsInstancePort" type="optional">
<
function-
arg-
description>
Directory server port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsInstanceDn" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="dn"/>
<
function-
arg-
def name="dsInstancePswd" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
def name="taskID" type="optional">
<
function-
arg-
description>
The identifier for the task
</
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="backupId" type="optional">
<
function-
arg-
description>
Optional the name of the backupId
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="verify" type="optional" default="'FALSE'">
<
function-
arg-
description>
Optional verify the contents of the backup but do not restore it
</
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="integer"/>
taskDN='ds-task-id=%s,cn=Scheduled Tasks,cn=Tasks' % taskID
<!-- Build the restore task configuration object --> <!-- Write out the restore-task ldif --> outfile = open(tmpTaskLdif,"w")
<!-- Copy the restore-task ldif to remote host --> <
message>'Copy restore task ldif file.'</
message>
<
call function="'copyFile'">
{ 'location' : STAXServiceMachine,
'remotehost' : myLocation }
<!-- Start the task using ldap task interface --> <
call function="'StartLdapTask'">
{ 'location' : myLocation,
'taskLabel' : 'Online Restore Task',
'dsHost' : dsInstanceHost,
'dsPort' : dsInstancePort,
'dsBindDn' : dsInstanceDn,
'dsBindPswd' : dsInstancePswd,
'expectedRC' : expectedRC }
<!-- Check that the ldap task is completed --> <
if expr="STAFCmdRC == 0">
<
call function="'CheckLdapTask'">
{ 'location' : myLocation,
'dsHost' : dsInstanceHost,
'dsPort' : dsInstancePort,
'dsBindDn' : dsInstanceDn,
'dsBindPswd' : dsInstancePswd }
<
message>'Check CheckLdapTask returns RC=0'</
message>
<
call function="'checktestRC'">
<!-- Shutdown Task Function --> <
function name="shutdownTask">
This function performs an on line export task for shutdown of the directory
<
function-
arg-
def name="location" type="optional" default="STAF_REMOTE_HOSTNAME">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname"/>
<
function-
arg-
def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
property name="type" value="pathname"/>
<
function-
arg-
def name="dsInstanceHost" type="optional">
<
function-
arg-
description>
Directory server host name
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsInstancePort" type="optional">
<
function-
arg-
description>
Directory server port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsInstanceDn" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="dn"/>
<
function-
arg-
def name="dsInstancePswd" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="taskID" type="optional">
<
function-
arg-
description>
The identifier for the task
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="noOfLoops" <
function-
arg-
description>
Number of iterations (for isStopped())
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="noOfMilliSeconds" <
function-
arg-
description>
Number of seconds to wait between iterations (for isStopped())
</
function-
arg-
description>
<
function-
arg-
property name="type" value="seconds"/>
<
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="integer"/>
taskDN='ds-task-id=%s,cn=Scheduled Tasks,cn=Tasks' % taskID
<!-- Build the shutdown task configuration object --> <!-- Write out the shutdown-task ldif --> outfile = open(tmpTaskLdif,"w")
<!-- Copy the shutdown-task ldif to remote host --> <
message>'Copy shutdown task ldif (%s) to %s' % (tmpTaskLdif,taskLdif)</
message>
<
call function="'copyFile'">
{ 'location' : STAXServiceMachine,
'remotehost' : myLocation }
<!-- Start the task using ldap task interface --> <
call function="'StartLdapTask'">
{ 'location' : myLocation,
'taskLabel' : 'Online Export Task',
'dsHost' : dsInstanceHost,
'dsPort' : dsInstancePort,
'dsBindDn' : dsInstanceDn,
'dsBindPswd' : dsInstancePswd,
'expectedRC' : expectedRC }
<
if expr="expectedRC == 0">
<!--- Check that DS stopped --> <
if expr="IPS_PKG == True">
<
call function="'isStopped'">
'dsPath' : '%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME),
'noOfMilliSeconds' : noOfMilliSeconds
<
call function="'isStopped'">
'noOfMilliSeconds' : noOfMilliSeconds
<
return>STAFCmdRC</
return>
<!-- Restart Task Function --> <
function name="restartTask">
This function performs an on line export task for restart of the directory
<
function-
arg-
def name="location" type="optional" default="STAF_REMOTE_HOSTNAME">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname"/>
<
function-
arg-
def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
property name="type" value="pathname"/>
<
function-
arg-
def name="dsInstanceHost" type="optional">
<
function-
arg-
description>
Directory server host name
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsInstancePort" type="optional">
<
function-
arg-
description>
Directory server port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsInstanceDn" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="dn"/>
<
function-
arg-
def name="dsInstancePswd" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="taskID" type="optional">
<
function-
arg-
description>
The identifier for the task
</
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="integer"/>
taskDN='ds-task-id=%s,cn=Scheduled Tasks,cn=Tasks' % taskID
<!-- Build the restart task configuration object --> <!-- Write out the restart-task ldif --> outfile = open(tmpTaskLdif,"w")
<!-- Copy the restart-task ldif to remote host --> <
message>'Copy restart task ldif (%s) to %s' % (tmpTaskLdif,taskLdif)</
message>
<
call function="'copyFile'">
{ 'location' : STAXServiceMachine,
'remotehost' : myLocation }
<!-- Start the task using ldap task interface --> <
call function="'StartLdapTask'">
{ 'location' : myLocation,
'taskLabel' : 'Online Export Task',
'dsHost' : dsInstanceHost,
'dsPort' : dsInstancePort,
'dsBindDn' : dsInstanceDn,
'dsBindPswd' : dsInstancePswd,
'expectedRC' : expectedRC }
<!--- Check that DS started --> <
if expr="STAFCmdRC == 0">
<
call function="'isAlive'">
'noOfMilliSeconds' : 2000 }
<
return>STAFCmdRC</
return>
<!-- Add Schema Task Function --> <
function name="addSchemaTask">
This function performs a dynamic schema add task
<
function-
arg-
def name="location" type="optional" default="STAF_REMOTE_HOSTNAME">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname"/>
<
function-
arg-
def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
property name="type" value="pathname"/>
<
function-
arg-
def name="dsInstanceHost" type="optional">
<
function-
arg-
description>
Directory server host name
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsInstancePort" type="optional">
<
function-
arg-
description>
Directory server port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsInstanceDn" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="dn"/>
<
function-
arg-
def name="dsInstancePswd" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
def name="taskID" type="optional">
<
function-
arg-
description>
The identifier for the task
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="ldifFile" type="required">
<
function-
arg-
description>
The name of the ldif file that contains the schema updates
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
taskDN='ds-task-id=%s,cn=Scheduled Tasks,cn=Tasks' % taskID
<!-- Build the schema task configuration object --> <!-- Write out the schema-task ldif --> outfile = open(tmpTaskLdif,"w")
<!-- Copy the schema-task ldif to remote host --> 'Copy schema task ldif file %s to %s.' % (tmpTaskLdif,taskLdif)
<
call function="'copyFile'">
{ 'location' : STAXServiceMachine,
'remotehost' : myLocation }
<!-- Copy the schema update ldif to remote host's config/schema directory --> <
message>'Copy schema update ldif file.'</
message>
<
call function="'copyFile'">
{ 'location' : myLocation,
'destfile' : '%s/%
s/
config/
schema/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME,ldifFile),
'remotehost' : myLocation }
<!-- Start the task using ldap task interface --> <
call function="'StartLdapTask'">
{ 'location' : myLocation,
'taskLabel' : 'Online Schema Task',
'dsHost' : dsInstanceHost,
'dsPort' : dsInstancePort,
'dsBindDn' : dsInstanceDn,
'dsBindPswd' : dsInstancePswd,
'dsTaskLdif' : taskLdif }
<!-- Check that the ldap task is completed --> <
call function="'CheckLdapTask'">
{ 'location' : myLocation,
'dsHost' : dsInstanceHost,
'dsPort' : dsInstancePort,
'dsBindDn' : dsInstanceDn,
'dsBindPswd' : dsInstancePswd }
<!-- Add Leave Lockdown Task Function --> <
function name="leaveLockdownTask">
This function performs a leave lockdown task
<
function-
arg-
def name="location" type="optional" default="STAF_REMOTE_HOSTNAME">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname"/>
<
function-
arg-
def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
property name="type" value="pathname"/>
<
function-
arg-
def name="dsInstanceHost" type="optional">
<
function-
arg-
description>
Directory server host name
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsInstancePort" type="optional">
<
function-
arg-
description>
Directory server port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsInstanceDn" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="dn"/>
<
function-
arg-
def name="dsInstancePswd" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
def name="taskID" type="optional">
<
function-
arg-
description>
The identifier for the task
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
taskDN='ds-task-id=%s,cn=Scheduled Tasks,cn=Tasks' % taskID
<!-- Build the schema task configuration object --> <!-- Write out the task ldif --> outfile = open(tmpTaskLdif,"w")
<!-- Copy the task ldif to remote host --> <
message>'Copy task ldif file.'</
message>
<
call function="'copyFile'">
{ 'location' : STAXServiceMachine,
'remotehost' : myLocation }
<!-- Copy the schema update ldif to remote host's config/schema directory --> <message>'Copy update ldif file.'</message> <call function="'copyFile'"> { 'location' : myLocation, 'destfile' : '%s/%s/config/schema/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME,ldifFile), 'remotehost' : myLocation } <!-- Start the task using ldap task interface --> <
call function="'StartLdapTask'">
{ 'location' : myLocation,
'taskLabel' : 'Online Schema Task',
'dsHost' : dsInstanceHost,
'dsPort' : dsInstancePort,
'dsBindDn' : dsInstanceDn,
'dsBindPswd' : dsInstancePswd,
'dsTaskLdif' : taskLdif }
<!-- Check that the ldap task is completed --> <
call function="'CheckLdapTask'">
{ 'location' : myLocation,
'dsHost' : dsInstanceHost,
'dsPort' : dsInstancePort,
'dsBindDn' : dsInstanceDn,
'dsBindPswd' : dsInstancePswd }
<
function name="StartLdapTask">
This function starts a task using the ldap task interface
<
function-
arg-
def name="location" type="optional" default="STAF_REMOTE_HOSTNAME">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname"/>
<
function-
arg-
def name="taskLabel" type="required">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname"/>
<
function-
arg-
def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
property name="type" value="pathname"/>
<
function-
arg-
def name="dsHost" type="optional">
<
function-
arg-
description>
Directory server host name
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsPort" type="optional">
<
function-
arg-
description>
Directory server port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsBindDn" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="dn"/>
<
function-
arg-
def name="dsBindPswd" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsTaskLdif" type="required">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filename"/>
<
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>
<!-- Build the Modify Command --> dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmdParams=' '.join(STAFCmdParamsList)
'%s %s' % (STAFCmd, STAFCmdParams)
<!-- Perform Task with ldapmodify --> <
process name="taskLabel">
<
location>'%s' % myLocation</
location>
<
command>'%s' % STAFCmd</
command>
<
parms>'%s' % STAFCmdParams</
parms>
<
workdir>'%s' % dsBinPath</
workdir>
['PATH=/bin:/
usr/
bin:%s' % dsBinPath, 'JAVA_HOME=%s' % JAVA_HOME]
<
stdin>'%s' % dsTaskLdif</
stdin>
<
stderr mode="'stdout'"/>
<
call function="'checktestRC'">
{ 'returncode' : STAFCmdRC,
'result' : STAFCmdResult,
<
return>[STAFCmdRC, STAFCmdResult[0][1]]</
return>
<
function name="CheckLdapTask">
This function checks a task using the ldap task interface
<
function-
arg-
def name="location" type="optional" default="STAF_REMOTE_HOSTNAME">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname"/>
<
function-
arg-
def name="dsTaskDn" type="required">
<
function-
arg-
description>
Dn of the task to be performed
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname"/>
<
function-
arg-
def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
property name="type" value="pathname"/>
<
function-
arg-
def name="dsHost" type="optional">
<
function-
arg-
description>
Directory server host name
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsPort" type="optional">
<
function-
arg-
description>
Directory server port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="dsBindDn" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="dn"/>
<
function-
arg-
def name="dsBindPswd" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="noOfLoops" type="optional" default="10">
<
function-
arg-
description>
Number of ldap check tries when checking if task is complete
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="sleepMilliSeconds" type="optional" default="2000">
<
function-
arg-
description>
Sleep time in milliseconds between ldap check tries
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
dsBinPath='%s/%s' % (dsPath,fileFolder)
dsFilter='"objectclass=*"'
dsAttribute='ds-task-state'
dsAttribute='ds-task-log-message'
STAFCmdParams=' '.join(STAFCmdParamsList)
successPattern =
re.compile('ds-task-state: COMPLETED_SUCCESSFULLY')
stopErrPattern =
re.compile('ds-task-state: STOPPED_BY_ERROR')
<!-- Wait for the task to be COMPLETED_SUCCESSFULLY --> <
script>taskRC=1</
script>
<
loop from="1" to="noOfLoops" while="taskRC != 0">
'LOOP number %s - %s %s' % (myCounter, STAFCmd, STAFCmdParams)
<!-- Search for task status --> <
call function="'runCommand'">
{ 'name' : 'Search On line Import Task',
'arguments' : STAFCmdParams,
<
if expr='re.search(successPattern, STAFCmdResult[0][1]) != None'>
<
script>taskRC=0</
script>
<
return>[taskRC, STAFCmdResult[0][1]]</
return>
<
elseif expr='re.search(stopErrPattern, STAFCmdResult[0][1]) != None'>
<
message level="'error'">
<
return>[taskRC, STAFCmdResult[0][1]]</
return>
<
message level="'Warning'">
'Sleeping for %s ms' % sleepMilliSeconds
<
call function="'Sleep'">
{ 'sleepForMilliSeconds' : sleepMilliSeconds }
<
return>[taskRC, STAFCmdResult[0][1]]</
return>
<!-- This function shows server status using the status script --> <
function name="StatusWithScript">
This function shows server status using the status script
<
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_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filepath"/>
<
function-
arg-
def name="dsBindDN" type="optional" default="''">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="DN"/>
<
function-
arg-
def name="dsBindPwd" type="optional" default="''">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsHelp" type="optional" default="''">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="help" value="option"/>
<
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-
def name="knownIssue" type="optional" default="None">
<
function-
arg-
description>
Known issue. Corresponds to an issue number.
</
function-
arg-
description>
<!-- Build the Command --> dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%
s/
status%s' % (dsBinPath,fileExt)
STAFCmdParams=' '.join(STAFCmdParamsList)
'%s %s' % (STAFCmd, STAFCmdParams)
<
call function="'runCommand'">
'name' : 'Status Script',
'arguments' : STAFCmdParams,
'expectedRC': expectedRC,
<
return>STAXResult</
return>
<!-- This function executes the base64 encode decode utility with script --> <
function name="Base64WithScript">
This function executes the base64 encode decode utility with script
<
function-
arg-
def name="location" type="optional" default="STAF_REMOTE_HOSTNAME">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname"/>
<
function-
arg-
def name="dsPath" type="optional" default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filepath"/>
<
function-
arg-
def name="subcommand" type="required">
<
function-
arg-
description>
The subcommand for base64 (encode or decode)
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="rawData" type="optional" default="''">
<
function-
arg-
description>
The raw data to be base64 encoded
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="rawDataFile" type="optional" default="''">
<
function-
arg-
description>
The path to a file containing the raw data to be base64 encoded
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filename"/>
<
function-
arg-
def name="toEncodedFile" type="optional" default="''">
<
function-
arg-
description>
The path to a file to which the base64-encoded data should be written
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filename"/>
<
function-
arg-
def name="encodedData" type="optional" default="''">
<
function-
arg-
description>
The base64-encoded data to be decoded
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="encodedDataFile" type="optional" default="''">
<
function-
arg-
description>
The path to a file containing the base64-encoded data to be decoded
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filename"/>
<
function-
arg-
def name="toRawFile" type="optional" default="''">
<
function-
arg-
description>
The path to a file to which the raw base64-decoded data should be written
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filename"/>
<
function-
arg-
def name="toolHelp" type="optional" default="''">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="help" value="option"/>
<
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-
def name="knownIssue" type="optional" default="None">
<
function-
arg-
description>
Known issue. Corresponds to an issue number.
</
function-
arg-
description>
<!-- Build the Command --> dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%
s/
base64%s' % (dsBinPath,fileExt)
STAFCmdParams=' '.join(STAFCmdParamsList)
'%s %s' % (STAFCmd, STAFCmdParams)
<
call function="'runCommand'">
'name' : 'Base 64 %s Script' % subcommand,
'arguments' : STAFCmdParams,
'expectedRC': expectedRC,
<
return>STAXResult</
return>
<!-- manage-tasks Function --> <
function name="manage-tasks" scope="local">
This function performs a manage-tasks command line
<
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_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
def name="dsInstanceHost" type="optional">
<
function-
arg-
description>
Directory server hostname or IP address
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname"/>
<
function-
arg-
def name="dsInstanceAdminPort" default="DIRECTORY_INSTANCE_ADMIN_PORT">
<
function-
arg-
description>
Directory server admin port number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="Port number"/>
<
function-
arg-
def name="dsInstanceDn" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="DN"/>
<
function-
arg-
def name="dsInstancePswd" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsBindPasswordFile" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filename"/>
<
function-
arg-
def name="dsKeyStorePath" type="optional">
<
function-
arg-
description>
Certificate keystore path
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filename"/>
<
function-
arg-
def name="dsCertNickname" type="optional">
<
function-
arg-
description>
Nickname of certificate for SSL client authentication
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsSaslOption" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsTrustStorePath" type="optional">
<
function-
arg-
description>
Certificate trust store path
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filename"/>
<
function-
arg-
def name="dsUseStartTLS" type="optional">
<
function-
arg-
description>
Use StartTLS to secure communication with the server
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsTrustStorePassword" type="optional">
<
function-
arg-
description>
Certificate trust store PIN
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsKeyStorePasswordFile" type="optional">
<
function-
arg-
description>
Certificate keystore PIN file
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filename"/>
<
function-
arg-
def name="dsTrustStorePasswordFile" type="optional">
<
function-
arg-
description>
Certificate trust store PIN file
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filename"/>
<
function-
arg-
def name="dsKeyStorePassword" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsTrustAll" type="optional">
<
function-
arg-
description>
Trust all server SSL certificates
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsUseSSL" type="optional">
<
function-
arg-
description>
Use SSL for secure communication with the server
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsCancel" type="optional">
<
function-
arg-
description>
Specify the task ID to cancel
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsInfo" type="optional">
<
function-
arg-
description>
Display information for a particular task
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsSummary" type="optional">
<
function-
arg-
description>
Display information for a particular task
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsQuiet" type="optional">
<
function-
arg-
description>
Use quiet mode (no output)
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsVersion" type="optional">
<
function-
arg-
description>
Display Directory Server version information
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsHelp" type="optional">
<
function-
arg-
description>
Display this usage information
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
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-
def name="knownIssue" type="optional" default="None">
<
function-
arg-
description>
Known issue. Corresponds to an issue number.
</
function-
arg-
description>
<!-- Build the Command --> <!-- Set common ldap arguments --> <
call function="'_adminCommonArgs'" />
dsBinPath='%s/%s' % (dsPath,fileFolder)
if dsKeyStorePasswordFile:
if dsTrustStorePasswordFile:
STAFCmdParams=' '.join(STAFCmdParamsList)
'%s %s' % (STAFCmd, STAFCmdParams)
<
call function="'runCommand'">
'envCmd' : [ 'LANG=C' , 'LC_ALL=C' ] ,
'name' : 'manage-tasks Script',
'arguments' : STAFCmdParams,
'expectedRC' : expectedRC,
'knownIssue' : knownIssue
<!-- This function execute the rebuild-index tool --> <
function name="rebuildIndexWithScript">
This function execute the rebuild-index tool
<
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_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filepath"/>
<
function-
arg-
def name="dsInstanceHost" type="optional">
<
function-
arg-
description>
Directory server hostname or IP address
</
function-
arg-
description>
<
function-
arg-
property name="type" value="hostname"/>
<
function-
arg-
def name="dsInstanceAdminPort" type="optional">
<
function-
arg-
description>
Directory server adminport number
</
function-
arg-
description>
<
function-
arg-
property name="type" value="Port number"/>
<
function-
arg-
def name="dsInstanceDn" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="DN"/>
<
function-
arg-
def name="dsInstancePswd" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsBaseDN" type="required">
<
function-
arg-
description>
Specify the base DN for which to perform the verification
</
function-
arg-
description>
<
function-
arg-
property name="type" value="dn"/>
<
function-
arg-
def name="dsIndexList" type="optional">
<
function-
arg-
description>
Specify the name of indexes for which to perform the verification
This should be passed as a python array like
[ 'uid','telephonenumber' ]
</
function-
arg-
description>
<
function-
arg-
property name="type" value="array"/>
<
function-
arg-
def name="dsRebuildAll" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="dn"/>
<
function-
arg-
def name="dsTmpDir" type="optional">
<
function-
arg-
description>
Path to temporary directory for index scratch files
Default value is import-tmp
</
function-
arg-
description>
<
function-
arg-
property name="type" value="dn"/>
<
function-
arg-
def name="dsHelp" type="optional">
<
function-
arg-
description>
Display this usage information
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsVersion" type="optional">
<
function-
arg-
description>
Display Directory Server version information
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="startTask" type="optional">
<
function-
arg-
description>
</
function-
arg-
description>
<
function-
arg-
property name="type" value="integer"/>
<
function-
arg-
def name="schedulePattern" type="optional">
<
function-
arg-
description>
Indicates the task is recurring and will be scheduled
according to the value argument expressed in crontab(5)
</
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="integer"/>
<
function-
arg-
def name="knownIssue" type="optional" default="None">
<
function-
arg-
description>
Known issue. Corresponds to an issue number.
</
function-
arg-
description>
<!-- Set common ldap arguments --> <
call function="'_adminCommonArgs'" />
<!-- Build the Command --> dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmdParams=' '.join(STAFCmdParamsList)
<
call function="'runCommand'">
'name' : 'Rebuild index script',
'arguments' : STAFCmdParams,
'expectedRC' : expectedRC,
'knownIssue' : knownIssue
resultString = STAXResult[0][1]
<
if expr="dsInstanceDn != None and expectedRC == 0 and schedulePattern == None">
'Check rebuild-index task successfully completed'
<
call function="'checkTaskExecution'">
'dsInstanceAdminPort' : dsInstanceAdminPort,
'dsInstanceHost' : dsInstanceHost ,
'dsInstanceDn' : dsInstanceDn ,
'dsInstancePswd' : dsInstancePswd ,
'outputToCheck' : resultString
<
return>savSTAXResult</
return>
<!-- This function execute the verify-index tool --> <
function name="verifyIndexWithScript" scope="local">
This function execute the verify-index tool
<
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_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filepath"/>
<
function-
arg-
def name="dsBaseDN" type="required">
<
function-
arg-
description>
Specify the base DN for which to perform the verification
</
function-
arg-
description>
<
function-
arg-
property name="type" value="dn"/>
<
function-
arg-
def name="dsIndexList" type="optional">
<
function-
arg-
description>
Specify the name of indexes for which to perform the verification
This should be passed as a python array like
[ 'uid','telephonenumber' ]
</
function-
arg-
description>
<
function-
arg-
property name="type" value="array"/>
<
function-
arg-
def name="dsClean" type="optional">
<
function-
arg-
description>
Verify that an index is clean
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsCountErrors" type="optional">
<
function-
arg-
description>
Count the number of errors found during the verification
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsHelp" type="optional">
<
function-
arg-
description>
Display this usage information
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsVersion" type="optional">
<
function-
arg-
description>
Display Directory Server version information
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
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="integer"/>
<
function-
arg-
def name="knownIssue" type="optional" default="None">
<
function-
arg-
description>
Known issue. Corresponds to an issue number.
</
function-
arg-
description>
<!-- Build the Command --> dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmdParams=' '.join(STAFCmdParamsList)
<
call function="'runCommand'">
'name' : 'Verify index script',
'arguments' : STAFCmdParams,
'expectedRC' : expectedRC,
'knownIssue' : knownIssue
<
return>STAXResult</
return>
<!-- This function execute the list-backends tool --> <
function name="listBackendsWithScript" scope="local">
This function execute the list-backends tool
<
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_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filepath"/>
<
function-
arg-
def name="dsBaseDN" type="optional">
<
function-
arg-
description>
Specify the baseDN from which the list-backends utility
should list the backend ID
</
function-
arg-
description>
<
function-
arg-
property name="type" value="dn"/>
<
function-
arg-
def name="dsBackendID" type="optional">
<
function-
arg-
description>
Specify the backend ID from which the tool should display
</
function-
arg-
description>
<
function-
arg-
property name="type" value="array"/>
<
function-
arg-
def name="dsHelp" type="optional">
<
function-
arg-
description>
Display this usage information
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsVersion" type="optional">
<
function-
arg-
description>
Display Directory Server version information
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
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="integer"/>
<
function-
arg-
def name="knownIssue" type="optional" default="None">
<
function-
arg-
description>
Known issue. Corresponds to an issue number.
</
function-
arg-
description>
<!-- Build the Command --> dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmdParams=' '.join(STAFCmdParamsList)
<
call function="'runCommand'">
'name' : 'List backends script',
'arguments' : STAFCmdParams,
'expectedRC' : expectedRC,
'knownIssue' : knownIssue
<
return>STAXResult</
return>
<!-- This function execute the dbtest tool --> <
function name="dbtestWithScript" scope="local">
This function execute the dbtest tool
<
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_BIN,OPENDSNAME)">
<
function-
arg-
description>
Pathname to installation root
</
function-
arg-
description>
<
function-
arg-
property name="type" value="filepath"/>
<
function-
arg-
def name="subcommand" type="required">
<
function-
arg-
description>
The subcommand for dbtest
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsBaseDN" type="optional">
<
function-
arg-
description>
Base DN of the entry container to debug
</
function-
arg-
description>
<
function-
arg-
property name="type" value="dn"/>
<
function-
arg-
def name="dsBackendID" type="optional">
<
function-
arg-
description>
Backend ID of the local DB backend to debug
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsDatabaseName" type="optional">
<
function-
arg-
description>
Name of the database container to debug
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsMinKeyValue" type="optional">
<
function-
arg-
description>
Only show records with keys that should be ordered after the
provided value using the comparator for the database container
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsMaxKeyValue" type="optional">
<
function-
arg-
description>
Only show records with keys that should be ordered before the
provided value using the comparator for the database container
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsSkipDecode" type="optional">
<
function-
arg-
description>
Skip decoding the local database to their appropriate types.
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsMinDataSize" type="optional">
<
function-
arg-
description>
Only show records whose data is no smaller than the provided value
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsMaxDataSize" type="optional">
<
function-
arg-
description>
Only show records whose data is no larger than the provided value
</
function-
arg-
description>
<
function-
arg-
property name="type" value="string"/>
<
function-
arg-
def name="dsHelp" type="optional">
<
function-
arg-
description>
Display this usage information
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
function-
arg-
def name="dsVersion" type="optional">
<
function-
arg-
description>
Display Directory Server version information
</
function-
arg-
description>
<
function-
arg-
property name="type" value="option"/>
<
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="integer"/>
<
function-
arg-
def name="knownIssue" type="optional" default="None">
<
function-
arg-
description>
Known issue. Corresponds to an issue number.
</
function-
arg-
description>
<!-- Build the Command --> dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%
s/
dbtest%s' % (dsBinPath,fileExt)
STAFCmdParams=' '.join(STAFCmdParamsList)
<
call function="'runCommand'">
'name' : 'Dbtest script',
'arguments' : STAFCmdParams,
'expectedRC' : expectedRC,
<
return>STAXResult</
return>