snmp_trap_defaultconf.xml revision d81978a0815d5b8a75633c35e3e1f8708d36f017
<?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 Sun Microsystems, Inc.
! -->
<stax>
<defaultcall function="snmp_trap_defaultconf"/>
<function name="snmp_trap_defaultconf">
<sequence>
<block name="'snmp_trap_defaultconf'">
<sequence>
<!--- Test Suite information
#@TestSuiteName SNMP trap with default configuration
#@TestSuitePurpose Check SNMP trap with default configuration.
#@TestSuiteGroup SNMP trap with default configuration
#@TestScript snmp_trap_defaultconf.xml
-->
<script>
if not CurrentTestPath.has_key('group'):
CurrentTestPath['group'] = 'snmp'
CurrentTestPath['suite'] = STAXCurrentBlock
</script>
<call function="'testSuite_Preamble'"/>
<!--- Define default value for community -->
<script>
trapsCommunity = '%s' % SNMP_PROPERTIES['traps-community']
outputFile = '%s/timer.out' % DIRECTORY_INSTANCE_DIR
timerDuration = '5m'
</script>
<!--- Test Case information
#@TestMarker SNMP trap with default configuration
#@TestName trap_defaultconf: trap on stop-ds
#@TestIssue 3435
#@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.
-->
<testcase name="getTestCaseName('trap_defaultconf: trap on stop-ds')">
<sequence>
<timer duration="timerDuration">
<sequence>
<parallel>
<sequence>
<message>
'trap_defaultconf: run the trap listener'
</message>
<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
}
</call>
</sequence>
<sequence>
<message>
'trap_defaultconf: wait event from the trap listener'
</message>
<call function="'WaitEvent'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'name' : 'SNMPTrapListener/Ready'
}
</call>
<message>
'trap_defaultconf: delete event from the trap listener'
</message>
<call function="'DeleteEvent'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'name' : 'SNMPTrapListener/Ready'
}
</call>
<message>
'trap_defaultconf: stop the server'
</message>
<call function="'StopDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<message>
'trap_defaultconf: send event to the trap listener'
</message>
<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>
<if expr="is_windows_platform(STAF_REMOTE_HOSTNAME)">
<script>
knownIssue(3435)
</script>
</if>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker SNMP trap with default configuration
#@TestName trap_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.
-->
<testcase name="getTestCaseName
('trap_defaultconf: trap on start-ds')">
<sequence>
<timer duration="timerDuration">
<sequence>
<parallel>
<sequence>
<message>
'trap_defaultconf: run the trap listener'
</message>
<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>
<message>
'trap_defaultconf: wait event from the trap listener'
</message>
<call function="'WaitEvent'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'name' : 'SNMPTrapListener/Ready'
}
</call>
<message>
'trap_defaultconf: delete event from the trap listener'
</message>
<call function="'DeleteEvent'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'name' : 'SNMPTrapListener/Ready'
}
</call>
<message>
'trap_defaultconf: start the server'
</message>
<call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<message>
'trap_defaultconf: send event to the trap listener'
</message>
<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>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker SNMP trap with default configuration
#@TestName trap_defaultconf: trap on stop-ds -R
#@TestIssue 3435
#@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.
-->
<testcase name="getTestCaseName
('trap_defaultconf: trap on stop-ds -R')">
<sequence>
<timer duration="timerDuration">
<sequence>
<parallel>
<sequence>
<message>
'trap_defaultconf: run the trap listener'
</message>
<call function="'SNMPTrapListener'">
{
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpTrapPort' : SNMP_TRAP_PORT ,
'snmpTrapCommunity' : trapsCommunity ,
'snmpTrapNumber' : '2,0,0,0,0,0' ,
'outputFile' : outputFile
}
</call>
</sequence>
<sequence>
<message>
'trap_defaultconf: wait event from the trap listener'
</message>
<call function="'WaitEvent'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'name' : 'SNMPTrapListener/Ready'
}
</call>
<message>
'trap_defaultconf: delete event from the trap listener'
</message>
<call function="'DeleteEvent'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'name' : 'SNMPTrapListener/Ready'
}
</call>
<message>
'trap_defaultconf: restart the server'
</message>
<call function="'StopDsWithScript'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'dsRestart' : 'True'
}
</call>
<message>
'trap_defaultconf: send event to the trap listener'
</message>
<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>
<if expr="is_windows_platform(STAF_REMOTE_HOSTNAME)">
<script>
knownIssue(3435)
</script>
</if>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<call function="'testSuite_Postamble'"/>
</sequence>
</block>
</sequence>
</function>
</stax>