<?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 2012 ForgeRock AS.
! -->
<stax>
<defaultcall function="main_snmp_traps"/>
<function name="main_snmp_traps" scope="local">
<sequence>
<block name="'main_snmp_traps'">
<try>
<sequence>
<script>
CurrentTestPath['group']='snmp'
CurrentTestPath['suite']='traps'
__group=CurrentTestPath['group']
__groupdir='%s/testcases/%s' % (TESTS_DIR,__group)
</script>
<!--- Test Suite information
#@TestSuiteName SNMP traps test suite
#@TestSuitePurpose Verify SNMP traps
#@TestSuiteID traps
#@TestSuiteGroup snmp
#@TestGroup snmp
#@TestScript snmp.xml
#@TestHTMLLink http://www.forgerock.org/
-->
<call function="'testSuite_Preamble'"/>
<try>
<sequence>
<!-- List of Import of Test Functions -->
<script>
importList=[]
importList.append('traps/snmp_traps_defaultconf_tests')
importList.append('traps/snmp_traps_customconf_tests')
</script>
<!-- Import the files for this test suite -->
<iterate var="__import" in="importList">
<import machine="STAF_LOCAL_HOSTNAME"
file="'%s/%s.xml' % (__groupdir,__import)"/>
</iterate>
<!-- Specific to traps SNMP tests -->
<script>
# Default
trapsCommunity = '%s' % SNMP_PROPERTIES['traps-community']
outputFile = '%s/timer.out' % DIRECTORY_INSTANCE_DIR
timerDuration = '5m'
# Custom
defTrapsCommunityProp = '%s' % SNMP_PROPERTIES['traps-community']
newTrapsCommunityProp = 'myCommunity'
newTrapsDestProp = DIRECTORY_INSTANCE_HOST
wrongTrapsDestProp = 'wrongtrapdestination'
outputFile2 = '%s/timer.out' % DIRECTORY_INSTANCE_DIR
timerDuration2 = '5m'
serverLogFile = '%s/%s/logs/server.out' \
% (DIRECTORY_INSTANCE_DIR, OPENDSNAME)
</script>
<!-- List of Test Cases -->
<script>
testsList=[]
testsList.append('snmp_traps_default_001')
testsList.append('snmp_traps_default_002')
testsList.append('snmp_traps_default_003')
testsList.append('snmp_traps_custom_001')
testsList.append('snmp_traps_custom_002')
testsList.append('snmp_traps_custom_003')
testsList.append('snmp_traps_custom_004')
testsList.append('snmp_traps_custom_005')
</script>
<!-- Execute the Tests -->
<iterate var="__test" in="testsList">
<sequence>
<call function="'%s' % (__test)" />
</sequence>
</iterate>
</sequence>
<catch exception="'STAFException.TestSuite.SetupException'">
<sequence>
<message log="1" level="'fatal'">
'Setup of test suite failed.'
</message>
<rethrow/>
</sequence>
</catch>
<finally>
<message>'Test Cases Completed.'</message>
</finally>
</try>
</sequence>
<finally>
<sequence>
<!-- Test Suite Cleanup -->
<message>'Finally: Global Cleanup.'</message>
<try>
<message>'No Test Suite Cleanup'</message>
<catch exception="'STAFException'">
<sequence>
<message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
</sequence>
</catch>
<finally>
<call function="'testSuite_Postamble'"/>
</finally>
</try>
</sequence>
</finally>
</try>
</block>
</sequence>
</function>
</stax>