<?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 legal-notices/CDDLv1_0.txt
! or http://forgerock.org/license/CDDLv1.0.html.
! 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 legal-notices/CDDLv1_0.txt.
! 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 default configuration
#@TestName traps_defaultconf: traps on stop-ds
#@TestIssue OPENDJ-870
#@TestPurpose Check that a trap is sent on default trap
community after stop-ds command.
#@TestPreamble none
#@TestStep Run the trap listener, it send an event to
notify that it is ready.
#@TestStep When this event is received, stop-ds command
is executed and a another event is sent to
notify that the command is completed.
#@TestStep The trap listener catches this event and send
a result.
#@TestPostamble none
#@TestResult Success if SNMPTrapListener returns 0.
-->
<function name="snmp_traps_default_001" scope="local">
<testcase name="getTestCaseName('Trap on stop-ds')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<timer duration="timerDuration">
<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' : trapsCommunity ,
'snmpTrapNumber' : '1,0,0,0,0,0' ,
'outputFile' : outputFile ,
'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' : 'Stop the server' }
</call>
<call function="'StopDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</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>timerRC = RC</script>
<call function="'checkTimerResult'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'outputFile' : outputFile ,
'timerDuration' : timerDuration ,
'timerRC' : timerRC
}
</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 default configuration
#@TestName traps_defaultconf: trap on start-ds
#@TestIssue none
#@TestPurpose Check that a trap is sent on default trap
community after start-ds command.
#@TestPreamble none
#@TestStep Run the trap listener, it send an event to
notify that it is ready.
#@TestStep When this event is received, start-ds command
is executed and a another event is sent to
notify that the command is completed.
#@TestStep The trap listener catches this event and send
a result.
#@TestPostamble none
#@TestResult Success if SNMPTrapListener returns 0.
-->
<function name="snmp_traps_default_002" scope="local">
<testcase name="getTestCaseName('Trap on start-ds')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<timer duration="timerDuration">
<sequence>
<parallel>
<sequence>
<call function="'testStep'">
{ 'stepMessage' : 'Run the trap listener' }
</call>
<call function="'SNMPTrapListener'">
{
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpTrapPort' : SNMP_TRAP_PORT ,
'snmpTrapCommunity' : trapsCommunity ,
'snmpTrapNumber' : '1,0,0,0,0,0' ,
'outputFile' : outputFile
}
</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' : 'Start the server' }
</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>timerRC = RC</script>
<call function="'checkTimerResult'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'outputFile' : outputFile ,
'timerDuration' : timerDuration ,
'timerRC' : timerRC
}
</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 default configuration
#@TestName traps_defaultconf: trap on stop-ds -R
#@TestIssue OPENDJ-870
#@TestPurpose Check that 2 traps are sent on default trap
community after stop-ds -R command.
#@TestPreamble none
#@TestStep Run the trap listener, it send an event to
notify that it is ready.
#@TestStep When this event is received, stop-ds -R
command is executed and a another event is
sent to notify that the command is completed.
#@TestStep The trap listener catches this event and send
a result.
#@TestPostamble none
#@TestResult Success if SNMPTrapListener returns 0.
-->
<function name="snmp_traps_default_003" scope="local">
<testcase name="getTestCaseName('Trap on stop-ds -R')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<timer duration="timerDuration">
<sequence>
<parallel>
<sequence>
<call function="'testStep'">
{ 'stepMessage' : 'Run the trap listener' }
</call>
<call function="'SNMPTrapListener'">
{
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpTrapPort' : SNMP_TRAP_PORT ,
'snmpTrapCommunity' : trapsCommunity ,
'snmpTrapNumber' : '2,0,0,0,0,0' ,
'outputFile' : outputFile ,
'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>timerRC = RC</script>
<call function="'checkTimerResult'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'outputFile' : outputFile ,
'timerDuration' : timerDuration ,
'timerRC' : timerRC
}
</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>