3600N/A<?
xml version="1.0" encoding="UTF-8" standalone="no"?>
3600N/A ! The contents of this file are subject to the terms of the 3600N/A ! Common Development and Distribution License, Version 1.0 only 3600N/A ! (the "License"). You may not use this file except in compliance 3600N/A ! You can obtain a copy of the license at 3600N/A ! See the License for the specific language governing permissions 3600N/A ! and limitations under the License. 3600N/A ! When distributing Covered Code, include this CDDL HEADER in each 3600N/A ! file and include the License file at 3600N/A ! add the following below this CDDL HEADER, with the fields enclosed 3600N/A ! by brackets "[]" replaced with your own identifying information: 3600N/A ! Portions Copyright [yyyy] [name of copyright owner] 4458N/A ! Copyright 2008-2009 Sun Microsystems, Inc. 3600N/A <
function name="SNMPGet" scope="local">
3600N/A This function performs a SNMP get request
3600N/A <
function-
arg-
def name="location" 3600N/A default="STAF_REMOTE_HOSTNAME">
3600N/A </
function-
arg-
description>
3600N/A <
function-
arg-
property name="type" value="hostname"/>
3600N/A <
function-
arg-
def name="snmpVersion" type="required">
3600N/A </
function-
arg-
description>
3600N/A <
function-
arg-
property name="type" value="version" />
3600N/A <
function-
arg-
def name="snmpHost" 3600N/A default="STAF_REMOTE_HOSTNAME">
3600N/A Directory server SNMP hostname or IP address
3600N/A </
function-
arg-
description>
3600N/A <
function-
arg-
property name="type" value="hostname" />
3600N/A <
function-
arg-
def name="snmpPort" type="required">
3600N/A Directory server SNMP port number
3667N/A </
function-
arg-
description>
3600N/A <
function-
arg-
property name="type" value="Port number"/>
3600N/A <
function-
arg-
def name="snmpOIDs" type="optional">
3600N/A </
function-
arg-
description>
3600N/A <
function-
arg-
property name="type" value="string"/>
3600N/A <
function-
arg-
def name="snmpCommunity" type="required">
3600N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="string"/>
3600N/A <
function-
arg-
def name="snmpUser" type="optional">
3667N/A SNMP user used for v3 requests
3600N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="string"/>
3600N/A <
function-
arg-
def name="snmpSecurityLevel" type="optional">
3667N/A SNMP security level used for v3 requests
3600N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="string"/>
3600N/A <
function-
arg-
def name="snmpSecurityFile" type="optional">
3667N/A Path to the SNMP security file
3600N/A </
function-
arg-
description>
3600N/A <
function-
arg-
property name="type" value="string"/>
3600N/A <
function-
arg-
def name="snmpStatus" type="required">
3667N/A Expected status of the SNMP request
3600N/A </
function-
arg-
description>
3600N/A <
function-
arg-
property name="type" value="string"/>
3600N/A <
function-
arg-
def name="snmpValidOIDs" type="optional">
3667N/A Check if the values returned for the OIDs are correct
3667N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="string"/>
3667N/A <
function-
arg-
def name="snmpWalk" type="optional">
3600N/A </
function-
arg-
description>
3600N/A <
function-
arg-
property name="type" value="string"/>
3600N/A <
function-
arg-
def name="expectedRC" type="optional" default="0">
3600N/A Expected return code value. Default value is 0
3600N/A Wildcard 'noCheck' to not check the RC
3600N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="integer"/>
3600N/A STAFCmdParams=' '.join(STAFCmdParamsList)
3643N/A if is_windows_platform(location):
4153N/A opends_jarfile='%s/%s' % (DIRECTORY_INSTANCE_BIN,SNMP_OPENDS_JARFILE)
3667N/A cp = 'CLASSPATH=%s%s%s%s%s%s.' \
3667N/A % (opends_jarfile,separator,jdmk_jarfile,separator,emma_jarfile,separator)
3667N/A cp = 'CLASSPATH=%s%s%s%s.' \
3667N/A % (opends_jarfile,separator,jdmk_jarfile,separator)
3600N/A '%s %s' % (STAFCmd, STAFCmdParams)
3600N/A <
call function="'runCommand'" >
3600N/A 'arguments' : '%s %s' % (STAFCmd, STAFCmdParams) ,
3600N/A <
function name="SNMPSet" scope="local">
3600N/A This function performs a SNMP Set request
3600N/A <
function-
arg-
def name="location" 3600N/A default="STAF_REMOTE_HOSTNAME">
3600N/A </
function-
arg-
description>
3600N/A <
function-
arg-
property name="type" value="hostname"/>
3600N/A <
function-
arg-
def name="snmpVersion" type="required">
3600N/A </
function-
arg-
description>
3600N/A <
function-
arg-
property name="type" value="version" />
3600N/A <
function-
arg-
def name="snmpHost" 3600N/A default="STAF_REMOTE_HOSTNAME">
3600N/A Directory server SNMP hostname or IP address
3600N/A </
function-
arg-
description>
3600N/A <
function-
arg-
property name="type" value="hostname" />
3600N/A <
function-
arg-
def name="snmpPort" type="required">
3600N/A Directory server SNMP port number
3667N/A </
function-
arg-
description>
3600N/A <
function-
arg-
property name="type" value="Port number"/>
3600N/A <
function-
arg-
def name="snmpOIDs" type="optional">
3600N/A </
function-
arg-
description>
3600N/A <
function-
arg-
property name="type" value="string"/>
3600N/A <
function-
arg-
def name="snmpCommunity" type="required">
3600N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="string"/>
3600N/A <
function-
arg-
def name="snmpUser" type="optional">
3667N/A SNMP user used for v3 requests
3600N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="string"/>
3600N/A <
function-
arg-
def name="snmpSecurityLevel" type="optional">
3667N/A SNMP security level used for v3 requests
3600N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="string"/>
3600N/A <
function-
arg-
def name="snmpSecurityFile" type="optional">
3667N/A Path to the SNMP security file
3600N/A </
function-
arg-
description>
3600N/A <
function-
arg-
property name="type" value="string"/>
3600N/A <
function-
arg-
def name="snmpStatus" type="required">
3667N/A Expected status of the SNMP request
3600N/A </
function-
arg-
description>
3600N/A <
function-
arg-
property name="type" value="string"/>
3600N/A <
function-
arg-
def name="snmpValidOIDs" type="optional">
3667N/A Check if the values returned for the OIDs are correct
3600N/A </
function-
arg-
description>
3600N/A <
function-
arg-
property name="type" value="string"/>
3600N/A <
function-
arg-
def name="expectedRC" type="optional" default="0">
3600N/A Expected return code value. Default value is 0
3600N/A Wildcard 'noCheck' to not check the RC
3600N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="integer"/>
3600N/A STAFCmdParams=' '.join(STAFCmdParamsList)
3643N/A if is_windows_platform(location):
4153N/A opends_jarfile='%s/%s' % (DIRECTORY_INSTANCE_BIN,SNMP_OPENDS_JARFILE)
3667N/A cp = 'CLASSPATH=%s%s%s%s%s%s.' \
3667N/A % (opends_jarfile,separator,jdmk_jarfile,separator,emma_jarfile,separator)
3667N/A cp = 'CLASSPATH=%s%s%s%s.' \
3667N/A % (opends_jarfile,separator,jdmk_jarfile,separator)
3600N/A '%s %s' % (STAFCmd, STAFCmdParams)
3600N/A <
call function="'runCommand'" >
3600N/A 'arguments' : '%s %s' % (STAFCmd, STAFCmdParams) ,
3600N/A <!-- SNMP Trap listener --> 3600N/A <
function name="SNMPTrapListener" scope="local">
3600N/A This function performs a SNMP Set request
3600N/A <
function-
arg-
def name="location" 3600N/A default="STAF_REMOTE_HOSTNAME">
3600N/A </
function-
arg-
description>
3600N/A <
function-
arg-
property name="type" value="hostname"/>
3600N/A <
function-
arg-
def name="snmpHost" type="required">
3600N/A Directory server SNMP port number
3667N/A </
function-
arg-
description>
3600N/A <
function-
arg-
property name="type" value="hostname"/>
3600N/A <
function-
arg-
def name="snmpTrapPort" type="required">
3600N/A Directory server SNMP port number
3667N/A </
function-
arg-
description>
3600N/A <
function-
arg-
property name="type" value="Port number"/>
3600N/A <
function-
arg-
def name="snmpTrapCommunity" type="required">
3600N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="string"/>
3600N/A <
function-
arg-
def name="snmpTrapNumber" type="required">
3600N/A </
function-
arg-
description>
3600N/A <
function-
arg-
property name="type" value="string"/>
3670N/A <
function-
arg-
def name="outputFile" type="required">
3670N/A File to which the output should be written
3670N/A </
function-
arg-
description>
3670N/A <
function-
arg-
property name="type" value="filename"/>
3600N/A <
function-
arg-
def name="expectedRC" type="optional" default="0">
3600N/A Expected return code value. Default value is 0
3600N/A Wildcard 'noCheck' to not check the RC
3600N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="integer"/>
4458N/A <
function-
arg-
def name="knownIssue" type="optional" default="None">
4458N/A Known issue. Corresponds to an issue number.
4458N/A </
function-
arg-
description>
4458N/A <
function-
arg-
property name="type" value="string" />
3685N/A if is_windows_platform(location):
3600N/A STAFCmdParams=' '.join(STAFCmdParamsList)
3643N/A if is_windows_platform(location):
4458N/A cp = 'CLASSPATH=%s%s%s%s.' \
4458N/A % (jdmk_jarfile,separator,jstaf_jarfile,separator)
3600N/A '%s %s' % (STAFCmd, STAFCmdParams)
3600N/A <
call function="'runCommand'" >
3600N/A 'name' : 'SNMP Trap Listener' ,
3600N/A 'arguments' : '%s %s' % (STAFCmd, STAFCmdParams) ,
3670N/A 'outputFile' : outputFile ,
4458N/A 'expectedRC' : expectedRC ,
3667N/A <!-- Restart SNMP Connection Handler --> 3667N/A <
function name="restartSNMPConnectionHandler" scope="local">
3667N/A This function restart the SNMP Connection Handler using dsconfig
3667N/A <
function-
arg-
def name="location" 3667N/A default="STAF_REMOTE_HOSTNAME">
3667N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="hostname" />
3667N/A <
function-
arg-
def name="dsPath" 4153N/A default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
3667N/A Pathname to installation root
3667N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="filepath" />
3667N/A <
function-
arg-
def name="dsInstanceHost" 3667N/A default="STAF_REMOTE_HOSTNAME">
3667N/A Directory server hostname or IP address
3667N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="hostname" />
3853N/A <
function-
arg-
def name="dsInstanceAdminPort" 3853N/A default="DIRECTORY_INSTANCE_ADMIN_PORT">
3853N/A Directory server admin port number
3667N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="Port number" />
3667N/A <
function-
arg-
def name="dsInstanceDn" type="required">
3667N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="DN" />
3667N/A <
function-
arg-
def name="dsInstancePswd" type="required">
3667N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="string" />
3667N/A <
function-
arg-
def name="expectedRC" type="optional" default="0">
3667N/A Expected return code value. Default value is 0.
3667N/A Wildcard 'noCheck' to not check the RC
3667N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="string" />
3951N/A <
function-
arg-
def name="knownIssue" type="optional" default="None">
3951N/A Known issue. Corresponds to an issue number.
3951N/A </
function-
arg-
description>
3951N/A <
function-
arg-
property name="type" value="string" />
3667N/A dsBinPath='%s/%s' % (dsPath,fileFolder)
3667N/A STAFCmdParams=' '.join(STAFCmdParamsList)
3667N/A STAFCmd='%s/%s%s' % (dsBinPath,DSCONFIG,fileExt)
3667N/A <
call function="'runCommand'">
3667N/A 'name' : 'Disable the SNMP Connection Handler' ,
3667N/A 'arguments' : '%s --set enabled:false' % STAFCmdParams ,
3667N/A <
call function="'runCommand'">
3667N/A 'name' : 'Enable the SNMP Connection Handler' ,
3667N/A 'arguments' : '%s --set enabled:true' % STAFCmdParams ,
3667N/A <!-- Compare SNMP values --> 3667N/A <
function name="compareSNMPValues" scope="local">
3667N/A This function compare SNMP Values
3667N/A <
function-
arg-
def name="location" 3667N/A default="STAF_REMOTE_HOSTNAME">
3667N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="hostname" />
3667N/A <
function-
arg-
def name="snmpHost" 3667N/A default="STAF_REMOTE_HOSTNAME">
3667N/A Directory server hostname or IP address
3667N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="hostname" />
3667N/A <
function-
arg-
def name="snmpPort" type="required">
3667N/A Directory server SNMP port number
3667N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="Port number"/>
3667N/A <
function-
arg-
def name="snmpCommunity" type="required">
3667N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="string"/>
3671N/A <
function-
arg-
def name="index" type="required">
3671N/A </
function-
arg-
description>
3671N/A <
function-
arg-
property name="type" value="string"/>
4238N/A <
function-
arg-
def name="knownIssue" type="optional" default="None">
4238N/A Known issue. Corresponds to an issue number.
4238N/A </
function-
arg-
description>
4238N/A <
function-
arg-
property name="type" value="string" />
3667N/A <
function-
arg-
def name="expectedRC" type="optional" default="0">
3667N/A Expected return code value. Default value is 0
3667N/A Wildcard 'noCheck' to not check the RC
3667N/A </
function-
arg-
description>
3667N/A <
function-
arg-
property name="type" value="integer"/>
3667N/A 'get the current mib values'
3667N/A <
call function="'SNMPGet'">
3667N/A 'snmpCommunity' : snmpCommunity ,
3667N/A CURRENT_VALUES = create_table_fromoutput(STAXResult[0][1])
3671N/A result = compare_snmp_values(DEFAULT_VALUES, CURRENT_VALUES, index)
4238N/A <
call function="'searchString'">
4238N/A 'expectedString' : 'ERROR' ,
4238N/A 'knownIssue' : knownIssue ,
3670N/A <!-- Check timer result --> 3670N/A <
function name="checkTimerResult" scope="local">
3670N/A This function compare SNMP Values
3670N/A <
function-
arg-
def name="location" 3670N/A default="STAF_REMOTE_HOSTNAME">
3670N/A </
function-
arg-
description>
3670N/A <
function-
arg-
property name="type" value="hostname" />
3670N/A <
function-
arg-
def name="outputFile" type="required">
3670N/A </
function-
arg-
description>
3670N/A <
function-
arg-
property name="type" value="string"/>
3670N/A <
function-
arg-
def name="timerDuration" type="required">
3670N/A </
function-
arg-
description>
3670N/A <
function-
arg-
property name="type" value="string"/>
3670N/A <
function-
arg-
def name="timerRC" type="required">
3670N/A Return code value of the timer
3670N/A </
function-
arg-
description>
3670N/A <
function-
arg-
property name="type" value="integer"/>
3951N/A <
function-
arg-
def name="issue" type="optional" default="None">
3951N/A Issue id. Corresponds to an issue number.
3951N/A </
function-
arg-
description>
3951N/A <
function-
arg-
property name="type" value="string"/>
3670N/A <
if expr="timerRC == 1 or timerRC == 0">
3670N/A <
tcstatus result="'pass'"></
tcstatus>
3670N/A 'Process TrapListener ended before timer duration: %s' \
3670N/A <
stafcmd name="'Delete file %s' % outputFile">
3670N/A <
location>location</
location>
3670N/A <
request>'DELETE ENTRY %s CONFIRM' % outputFile</
request>
3959N/A <
tcstatus result="'fail'"/>
3959N/A <
call function="'setKnownIssue'">
3670N/A 'Process TrapListener still running after timer duration: %s' \
3670N/A <
stafcmd name="'Get output from TrapListener'">
3670N/A <
location>location</
location>
3670N/A <
request>'GET FILE %s' % outputFile</
request>
3670N/A <
log message="1">'Output:%s' % STAFResult</
log>
3670N/A <
stafcmd name="'Delete file %s' % outputFile">
3670N/A <
location>location</
location>
3670N/A <
request>'DELETE ENTRY %s CONFIRM' % outputFile</
request>
3670N/A 'STAF %s FS GET FILE %s failed with RC=%s Result=%s' % \
3670N/A (location, outputFile, RC, STAFResult)
3670N/A 'Delete event from the trap listener'
3670N/A <
call function="'DeleteEvent'">
3670N/A 'Delete event from the trap listener'
3670N/A <
call function="'DeleteEvent'">
3959N/A <
tcstatus result="'fail'"></
tcstatus>