<?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_basic"/>
<function name="main_snmp_basic" scope="local">
<sequence>
<block name="'main_snmp_basic'">
<try>
<sequence>
<script>
CurrentTestPath['group']='snmp'
CurrentTestPath['suite']='basic'
__group=CurrentTestPath['group']
__groupdir='%s/testcases/%s' % (TESTS_DIR,__group)
</script>
<!--- Test Suite information
#@TestSuiteName SNMP basic test suite
#@TestSuitePurpose Verify basic SNMP operations
#@TestSuiteID basic
#@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('basic/snmp_basic_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 basic SNMP tests -->
<script>
# Globals
global_DEFAULT_VALUES = STAXGlobal([])
global_indexLDAP = STAXGlobal([])
# Default Properties
EXPECTED_PROPERTIES = {}
EXPECTED_PROPERTIES['allowed-client'] = ''
EXPECTED_PROPERTIES['allowed-manager'] = '*'
EXPECTED_PROPERTIES['allowed-user'] = '*'
EXPECTED_PROPERTIES['community'] = 'OpenDJ'
EXPECTED_PROPERTIES['denied-client'] = ''
EXPECTED_PROPERTIES['enabled'] = 'false'
EXPECTED_PROPERTIES['listen-address'] = '0.0.0.0'
EXPECTED_PROPERTIES['listen-port'] = '161'
EXPECTED_PROPERTIES['opendmk-jarfile'] = ''
EXPECTED_PROPERTIES['registered-mbean'] = 'false'
file = 'config/snmp/security/opendj-snmp.security'
EXPECTED_PROPERTIES['security-agent-file'] = '%s' % file
EXPECTED_PROPERTIES['security-level'] = 'authnopriv'
EXPECTED_PROPERTIES['trap-port'] = '162'
EXPECTED_PROPERTIES['traps-community'] = 'OpenDJ'
EXPECTED_PROPERTIES['traps-destination'] = ''
# MIB
community = '%s@%s' \
% (SNMP_PROPERTIES['community'], SNMP_PROPERTIES['community'])
nbLoop = 10
# Register Mbeans
refRegisteredMbeanProp = SNMP_PROPERTIES['registered-mbean']
defCommunityProp = SNMP_PROPERTIES['community']
defCommunity = '%s@%s' %(defCommunityProp, defCommunityProp)
oid = 'dsServerType.1'
# Status
community = '%s@%s' \
% (SNMP_PROPERTIES['community'], SNMP_PROPERTIES['community'])
oid = 'dsServerType.1'
serverLogFile = '%s/%s/logs/server.out' \
% (DIRECTORY_INSTANCE_DIR, OPENDSNAME)
</script>
<!-- List of Test Cases -->
<script>
testsList=[]
testsList.append('snmp_basic_001')
testsList.append('snmp_basic_002')
testsList.append('snmp_basic_003')
testsList.append('snmp_basic_004')
testsList.append('snmp_basic_005')
testsList.append('snmp_basic_006')
testsList.append('snmp_basic_007')
testsList.append('snmp_basic_008')
testsList.append('snmp_basic_009')
testsList.append('snmp_basic_010')
testsList.append('snmp_basic_011')
testsList.append('snmp_basic_012')
testsList.append('snmp_basic_013')
testsList.append('snmp_basic_014')
testsList.append('snmp_basic_015')
testsList.append('snmp_basic_016')
if get_system_uid() != "root":
testsList.append('snmp_basic_017')
</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>