snmp_traps_customconf_tests.xml revision 8d476951ba505c2f221f2729d043a6c9bc5f4683
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
<!--
! CDDL HEADER START
!
! The contents of this file are subject to the terms of the
! Common Development and Distribution License, Version 1.0 only
! (the "License"). You may not use this file except in compliance
! with the License.
!
! You can obtain a copy of the license at
! trunk/opends/resource/legal-notices/OpenDS.LICENSE
! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
! See the License for the specific language governing permissions
! and limitations under the License.
!
! When distributing Covered Code, include this CDDL HEADER in each
! file and include the License file at
! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
! add the following below this CDDL HEADER, with the fields enclosed
! by brackets "[]" replaced with your own identifying information:
! Portions Copyright [yyyy] [name of copyright owner]
!
! CDDL HEADER END
!
! Copyright 2008-2010 Sun Microsystems, Inc.
! Portions Copyright 2012-2013 ForgeRock AS
! -->
<stax>
<!--- Test Case information
#@TestMarker SNMP traps with custom configuration
#@TestName traps_customconf: TODO
#@TestIssue OPENDJ-870
#@TestPurpose TODO.
#@TestPreamble none
#@TestStep TODO.
#@TestPostamble none
#@TestResult TODO.
-->
<function name="snmp_traps_custom_001" scope="local">
<testcase name="getTestCaseName('Change the community property')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'testStep'">
{ 'stepMessage' : 'Change the community property' }
</call>
<call function="'dsconfig'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set traps-community:%s' \
% newTrapsCommunityProp
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Restart the SNMP Connection Handler' }
</call>
<call function="'restartSNMPConnectionHandler'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<timer duration="timerDuration2">
<sequence>
<parallel>
<sequence>
<call function="'testStep'">
{ 'stepMessage' : 'Run the trap listener' }
</call>
<call function="'SNMPTrapListener'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpTrapPort' : SNMP_TRAP_PORT ,
'snmpTrapCommunity' : defTrapsCommunityProp ,
'snmpTrapNumber' : '0,2,0,0,0,0' ,
'outputFile' : outputFile2 ,
'knownIssue' : 'OPENDJ-870'
}
</call>
</sequence>
<sequence>
<call function="'testStep'">
{ 'stepMessage' : 'Wait event from the trap listener' }
</call>
<call function="'WaitEvent'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'name' : 'SNMPTrapListener/Ready'
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Delete event from the trap listener' }
</call>
<call function="'DeleteEvent'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'name' : 'SNMPTrapListener/Ready'
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Restart the server' }
</call>
<call function="'StopDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<!--- Check that DS started -->
<call function="'isAlive'">
{
'noOfLoops' : 10 ,
'noOfMilliSeconds' : 2000
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Send event to the trap listener' }
</call>
<call function="'SendEvent'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'name' : 'SendTrap/Complete'
}
</call>
</sequence>
</parallel>
</sequence>
</timer>
<script>timerRC2 = RC</script>
<call function="'checkTimerResult'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'outputFile' : outputFile2 ,
'timerDuration' : timerDuration2 ,
'timerRC' : timerRC2
}
</call>
<timer duration="timerDuration2">
<sequence>
<parallel>
<sequence>
<call function="'testStep'">
{ 'stepMessage' : 'Run the trap listener' }
</call>
<call function="'SNMPTrapListener'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpTrapPort' : SNMP_TRAP_PORT ,
'snmpTrapCommunity' : newTrapsCommunityProp ,
'snmpTrapNumber' : '2,0,0,0,0,0' ,
'outputFile' : outputFile2 ,
'knownIssue' : 'OPENDJ-870'
}
</call>
</sequence>
<sequence>
<call function="'testStep'">
{ 'stepMessage' : 'Wait event from the trap listener' }
</call>
<call function="'WaitEvent'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'name' : 'SNMPTrapListener/Ready'
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Delete event from the trap listener' }
</call>
<call function="'DeleteEvent'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'name' : 'SNMPTrapListener/Ready'
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Restart the server' }
</call>
<call function="'StopDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<!--- Check that DS started -->
<call function="'isAlive'">
{
'noOfLoops' : 10 ,
'noOfMilliSeconds' : 2000
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Send event to the trap listener' }
</call>
<call function="'SendEvent'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'name' : 'SendTrap/Complete'
}
</call>
</sequence>
</parallel>
</sequence>
</timer>
<script>timerRC2 = RC</script>
<call function="'checkTimerResult'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'outputFile' : outputFile2 ,
'timerDuration' : timerDuration2 ,
'timerRC' : timerRC2
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Restore the traps-community property' }
</call>
<call function="'dsconfig'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set traps-community:%s' \
% defTrapsCommunityProp
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Restart the SNMP Connection Handler' }
</call>
<call function="'restartSNMPConnectionHandler'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker SNMP traps with custom configuration
#@TestName traps_customconf: TODO
#@TestIssue OPENDJ-870
#@TestPurpose TODO.
#@TestPreamble none
#@TestStep TODO.
#@TestPostamble none
#@TestResult TODO.
-->
<function name="snmp_traps_custom_002" scope="local">
<testcase name="getTestCaseName('Set traps-destination property to correct value')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'testStep'">
{ 'stepMessage' : 'Change the traps-destination property' }
</call>
<call function="'dsconfig'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set traps-destination:%s' \
% newTrapsDestProp
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Restart the SNMP Connection Handler' }
</call>
<call function="'restartSNMPConnectionHandler'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<timer duration="timerDuration2">
<sequence>
<parallel>
<sequence>
<call function="'testStep'">
{ 'stepMessage' : 'Run the trap listener' }
</call>
<call function="'SNMPTrapListener'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpTrapPort' : SNMP_TRAP_PORT ,
'snmpTrapCommunity' : defTrapsCommunityProp ,
'snmpTrapNumber' : '2,0,0,0,0,0' ,
'outputFile' : outputFile2 ,
'knownIssue' : 'OPENDJ-870'
}
</call>
</sequence>
<sequence>
<call function="'testStep'">
{ 'stepMessage' : 'Wait event from the trap listener' }
</call>
<call function="'WaitEvent'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'name' : 'SNMPTrapListener/Ready'
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Delete event from the trap listener' }
</call>
<call function="'DeleteEvent'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'name' : 'SNMPTrapListener/Ready'
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Restart the server' }
</call>
<call function="'StopDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<!--- Check that DS started -->
<call function="'isAlive'">
{
'noOfLoops' : 10 ,
'noOfMilliSeconds' : 2000
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Send event to the trap listener' }
</call>
<call function="'SendEvent'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'name' : 'SendTrap/Complete'
}
</call>
</sequence>
</parallel>
</sequence>
</timer>
<script>timerRC2 = RC</script>
<call function="'checkTimerResult'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'outputFile' : outputFile2 ,
'timerDuration' : timerDuration2 ,
'timerRC' : timerRC2
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Restore the traps-destination property' }
</call>
<call function="'dsconfig'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--reset traps-destination'
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Restart the SNMP Connection Handler' }
</call>
<call function="'restartSNMPConnectionHandler'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker SNMP traps with custom configuration
#@TestName traps_customconf: TODO
#@TestIssue none
#@TestPurpose TODO.
#@TestPreamble none
#@TestStep TODO.
#@TestPostamble none
#@TestResult TODO.
-->
<function name="snmp_traps_custom_003" scope="local">
<testcase name="getTestCaseName('Set traps-destination property to a wrong value')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'testStep'">
{ 'stepMessage' : 'Change the traps-destination property' }
</call>
<call function="'dsconfig'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set traps-destination:%s' \
% wrongTrapsDestProp
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Restart the SNMP Connection Handler' }
</call>
<call function="'restartSNMPConnectionHandler'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<timer duration="timerDuration2">
<sequence>
<parallel>
<sequence>
<call function="'testStep'">
{ 'stepMessage' : 'Run the trap listener' }
</call>
<call function="'SNMPTrapListener'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpTrapPort' : SNMP_TRAP_PORT ,
'snmpTrapCommunity' : defTrapsCommunityProp ,
'snmpTrapNumber' : '0,0,0,0,0,0' ,
'outputFile' : outputFile2
}
</call>
</sequence>
<sequence>
<call function="'testStep'">
{ 'stepMessage' : 'Wait event from the trap listener' }
</call>
<call function="'WaitEvent'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'name' : 'SNMPTrapListener/Ready'
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Delete event from the trap listener' }
</call>
<call function="'DeleteEvent'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'name' : 'SNMPTrapListener/Ready'
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Restart the server' }
</call>
<call function="'StopDsWithScript'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'dsHost' : DIRECTORY_INSTANCE_HOST ,
'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<!--- Check that DS started -->
<call function="'isAlive'">
{
'noOfLoops' : 10 ,
'noOfMilliSeconds' : 2000
}
</call>
<script>
msg1 = 'Traps Destination %s is an unknown host.' \
% wrongTrapsDestProp
msg2 = 'Traps will not be sent to this destination'
msg = '%s %s' % (msg1, msg2)
</script>
<call function="'grep'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'filename' : serverLogFile ,
'testString': msg
}
</call>
<script>
msg1 = 'No valid trap destinations has been found.'
msg2 = 'No trap will be sent'
msg = '%s %s' % (msg1, msg2)
</script>
<call function="'grep'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'filename' : serverLogFile ,
'testString': msg
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Send event to the trap listener' }
</call>
<call function="'SendEvent'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'name' : 'SendTrap/Complete'
}
</call>
</sequence>
</parallel>
</sequence>
</timer>
<script>timerRC2 = RC</script>
<call function="'checkTimerResult'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'outputFile' : outputFile2 ,
'timerDuration' : timerDuration2 ,
'timerRC' : timerRC2
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Restore the traps-destination property' }
</call>
<call function="'dsconfig'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--reset traps-destination'
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Restart the SNMP Connection Handler' }
</call>
<call function="'restartSNMPConnectionHandler'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker SNMP traps with custom configuration
#@TestName traps_customconf: TODO
#@TestIssue OPENDJ-870
#@TestPurpose TODO.
#@TestPreamble none
#@TestStep TODO.
#@TestPostamble none
#@TestResult TODO.
-->
<function name="snmp_traps_custom_004" scope="local">
<testcase name="getTestCaseName('Set traps-destination property to a list')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'testStep'">
{ 'stepMessage' : 'Set traps-destination property to a list' }
</call>
<call function="'dsconfig'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set traps-destination:%s' \
% wrongTrapsDestProp
}
</call>
<call function="'dsconfig'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--add traps-destination:%s' \
% newTrapsDestProp
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Restart the SNMP Connection Handler' }
</call>
<call function="'restartSNMPConnectionHandler'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<timer duration="timerDuration2">
<sequence>
<parallel>
<sequence>
<call function="'testStep'">
{ 'stepMessage' : 'Run the trap listener' }
</call>
<call function="'SNMPTrapListener'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpTrapPort' : SNMP_TRAP_PORT ,
'snmpTrapCommunity' : defTrapsCommunityProp ,
'snmpTrapNumber' : '2,0,0,0,0,0' ,
'outputFile' : outputFile2 ,
'knownIssue' : 'OPENDJ-870'
}
</call>
</sequence>
<sequence>
<call function="'testStep'">
{ 'stepMessage' : 'Wait event from the trap listener' }
</call>
<call function="'WaitEvent'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'name' : 'SNMPTrapListener/Ready'
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Delete event from the trap listener' }
</call>
<call function="'DeleteEvent'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'name' : 'SNMPTrapListener/Ready'
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Restart the server' }
</call>
<call function="'StopDsWithScript'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'dsHost' : DIRECTORY_INSTANCE_HOST ,
'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<!--- Check that DS started -->
<call function="'isAlive'">
{
'noOfLoops' : 10 ,
'noOfMilliSeconds' : 2000
}
</call>
<script>
msg1 = 'Traps Destination %s is an unknown host.' \
% wrongTrapsDestProp
msg2 = 'Traps will not be sent to this destination'
msg = '%s %s' % (msg1, msg2)
</script>
<call function="'grep'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'filename' : serverLogFile ,
'testString': msg
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Send event to the trap listener' }
</call>
<call function="'SendEvent'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'name' : 'SendTrap/Complete'
}
</call>
</sequence>
</parallel>
</sequence>
</timer>
<script>timerRC2 = RC</script>
<call function="'checkTimerResult'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'outputFile' : outputFile2 ,
'timerDuration' : timerDuration2 ,
'timerRC' : timerRC2
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Restore the traps-destination property' }
</call>
<call function="'dsconfig'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--reset traps-destination'
}
</call>
<call function="'testStep'">
{ 'stepMessage' : 'Restart the SNMP Connection Handler' }
</call>
<call function="'restartSNMPConnectionHandler'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
<!--- Test Case information
#@TestMarker SNMP traps with custom configuration
#@TestName traps_customconf: TODO
#@TestIssue none
#@TestPurpose TODO.
#@TestPreamble none
#@TestStep TODO.
#@TestPostamble none
#@TestResult TODO.
-->
<function name="snmp_traps_custom_005" scope="local">
<testcase name="getTestCaseName('Set the traps-community property to a list')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'testStep'">
{ 'stepMessage' : 'Set the traps-community property to a list' }
</call>
<call function="'dsconfig'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--add traps-community:%s' \
% newTrapsCommunityProp ,
'expectedRC' : 1
}
</call>
<script>
returnString = STAXResult[0][1]
returnString = STAXResult[0][1]
msg1 = 'It is not possible to specify multiple values for the'
msg2 = 'SNMP Connection Handler%sproperty "traps-community"' \
% newLine
msg3 = 'as it is single-valued'
msg = '%s %s %s' % (msg1, msg2, msg3)
</script>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : msg
}
</call>
</sequence>
<catch exception="'STAXException'" typevar="eType" var="eInfo">
<message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
</message>
</catch>
<finally>
<sequence>
<call function="'testCase_Postamble'"/>
</sequence>
</finally>
</try>
</sequence>
</testcase>
</function>
</stax>