5767N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
5767N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
5767N/A<!--
5767N/A ! CDDL HEADER START
5767N/A !
5767N/A ! The contents of this file are subject to the terms of the
5767N/A ! Common Development and Distribution License, Version 1.0 only
5767N/A ! (the "License"). You may not use this file except in compliance
5767N/A ! with the License.
5767N/A !
5767N/A ! You can obtain a copy of the license at
5767N/A ! trunk/opends/resource/legal-notices/CDDLv1_0.txt
5767N/A ! or http://forgerock.org/license/CDDLv1.0.html.
5767N/A ! See the License for the specific language governing permissions
5767N/A ! and limitations under the License.
5767N/A !
5767N/A ! When distributing Covered Code, include this CDDL HEADER in each
5767N/A ! file and include the License file at
5767N/A ! trunk/opends/resource/legal-notices/CDDLv1_0.txt. If applicable,
5767N/A ! add the following below this CDDL HEADER, with the fields enclosed
5767N/A ! by brackets "[]" replaced with your own identifying information:
5767N/A ! Portions Copyright [yyyy] [name of copyright owner]
5767N/A !
5767N/A ! CDDL HEADER END
5767N/A !
5767N/A ! Copyright 2012 ForgeRock AS.
5767N/A ! -->
5767N/A<stax>
5767N/A <defaultcall function="main_snmp_basic"/>
5767N/A <function name="main_snmp_basic" scope="local">
5767N/A <sequence>
5767N/A <block name="'main_snmp_basic'">
5767N/A <try>
5767N/A <sequence>
5767N/A <script>
5767N/A CurrentTestPath['group']='snmp'
5767N/A CurrentTestPath['suite']='basic'
5767N/A
5767N/A __group=CurrentTestPath['group']
5767N/A __groupdir='%s/testcases/%s' % (TESTS_DIR,__group)
5767N/A </script>
5767N/A
5767N/A <!--- Test Suite information
5770N/A #@TestSuiteName SNMP basic test suite
5770N/A #@TestSuitePurpose Verify basic SNMP operations
5767N/A #@TestSuiteID basic
5767N/A #@TestSuiteGroup snmp
5767N/A #@TestGroup snmp
5767N/A #@TestScript snmp.xml
5767N/A #@TestHTMLLink http://www.forgerock.org/
5767N/A -->
5767N/A <call function="'testSuite_Preamble'"/>
5767N/A
5767N/A <try>
5767N/A <sequence>
5767N/A
5767N/A <!-- List of Import of Test Functions -->
5767N/A <script>
5767N/A importList=[]
5767N/A importList.append('basic/snmp_basic_tests')
5767N/A </script>
5767N/A
5767N/A <!-- Import the files for this test suite -->
5767N/A <iterate var="__import" in="importList">
5767N/A <import machine="STAF_LOCAL_HOSTNAME"
5767N/A file="'%s/%s.xml' % (__groupdir,__import)"/>
5767N/A </iterate>
5767N/A
5767N/A <!-- Specific to basic SNMP tests -->
5767N/A <script>
5767N/A # Globals
5767N/A global_DEFAULT_VALUES = STAXGlobal([])
5767N/A global_indexLDAP = STAXGlobal([])
5767N/A
5767N/A # Default Properties
5767N/A EXPECTED_PROPERTIES = {}
5767N/A EXPECTED_PROPERTIES['allowed-client'] = ''
5767N/A EXPECTED_PROPERTIES['allowed-manager'] = '*'
5767N/A EXPECTED_PROPERTIES['allowed-user'] = '*'
5767N/A EXPECTED_PROPERTIES['community'] = 'OpenDJ'
5767N/A EXPECTED_PROPERTIES['denied-client'] = ''
5767N/A EXPECTED_PROPERTIES['enabled'] = 'false'
5767N/A EXPECTED_PROPERTIES['listen-address'] = '0.0.0.0'
5767N/A EXPECTED_PROPERTIES['listen-port'] = '161'
5767N/A EXPECTED_PROPERTIES['opendmk-jarfile'] = ''
5767N/A EXPECTED_PROPERTIES['registered-mbean'] = 'false'
5767N/A file = 'config/snmp/security/opendj-snmp.security'
5767N/A EXPECTED_PROPERTIES['security-agent-file'] = '%s' % file
5767N/A EXPECTED_PROPERTIES['security-level'] = 'authnopriv'
5767N/A EXPECTED_PROPERTIES['trap-port'] = '162'
5767N/A EXPECTED_PROPERTIES['traps-community'] = 'OpenDJ'
5767N/A EXPECTED_PROPERTIES['traps-destination'] = ''
5767N/A
5767N/A # MIB
5767N/A community = '%s@%s' \
5767N/A % (SNMP_PROPERTIES['community'], SNMP_PROPERTIES['community'])
5767N/A nbLoop = 10
5767N/A
5767N/A # Register Mbeans
5767N/A refRegisteredMbeanProp = SNMP_PROPERTIES['registered-mbean']
5767N/A defCommunityProp = SNMP_PROPERTIES['community']
5767N/A defCommunity = '%s@%s' %(defCommunityProp, defCommunityProp)
5767N/A oid = 'dsServerType.1'
5767N/A
5767N/A # Status
5767N/A community = '%s@%s' \
5767N/A % (SNMP_PROPERTIES['community'], SNMP_PROPERTIES['community'])
5767N/A oid = 'dsServerType.1'
5767N/A serverLogFile = '%s/%s/logs/server.out' \
5767N/A % (DIRECTORY_INSTANCE_DIR, OPENDSNAME)
5767N/A </script>
5767N/A
5767N/A <!-- List of Test Cases -->
5767N/A <script>
5767N/A testsList=[]
5767N/A testsList.append('snmp_basic_001')
5767N/A testsList.append('snmp_basic_002')
5767N/A testsList.append('snmp_basic_003')
5767N/A testsList.append('snmp_basic_004')
5767N/A testsList.append('snmp_basic_005')
5767N/A testsList.append('snmp_basic_006')
5767N/A testsList.append('snmp_basic_007')
5767N/A testsList.append('snmp_basic_008')
5767N/A testsList.append('snmp_basic_009')
5767N/A testsList.append('snmp_basic_010')
5767N/A testsList.append('snmp_basic_011')
5767N/A testsList.append('snmp_basic_012')
5767N/A testsList.append('snmp_basic_013')
5767N/A testsList.append('snmp_basic_014')
5767N/A testsList.append('snmp_basic_015')
5767N/A testsList.append('snmp_basic_016')
5783N/A if get_system_uid() != "root":
5781N/A testsList.append('snmp_basic_017')
5767N/A </script>
5767N/A
5767N/A <!-- Execute the Tests -->
5767N/A <iterate var="__test" in="testsList">
5767N/A <sequence>
5767N/A <call function="'%s' % (__test)" />
5767N/A </sequence>
5767N/A </iterate>
5767N/A
5767N/A </sequence>
5767N/A <catch exception="'STAFException.TestSuite.SetupException'">
5767N/A <sequence>
5767N/A <message log="1" level="'fatal'">
5767N/A 'Setup of test suite failed.'
5767N/A </message>
5767N/A <rethrow/>
5767N/A </sequence>
5767N/A </catch>
5767N/A
5767N/A <finally>
5767N/A <message>'Test Cases Completed.'</message>
5767N/A </finally>
5767N/A
5767N/A </try>
5767N/A
5767N/A </sequence>
5767N/A
5767N/A <finally>
5767N/A <sequence>
5767N/A <!-- Test Suite Cleanup -->
5821N/A <message>'Finally: Global Cleanup.'</message>
5767N/A <try>
5767N/A <message>'No Test Suite Cleanup'</message>
5767N/A <catch exception="'STAFException'">
5767N/A <sequence>
5767N/A <message log="1" level="'fatal'">'Cleanup of test suite failed.'</message>
5767N/A </sequence>
5767N/A </catch>
5767N/A <finally>
5767N/A <call function="'testSuite_Postamble'"/>
5767N/A </finally>
5767N/A </try>
5767N/A </sequence>
5767N/A </finally>
5767N/A
5767N/A </try>
5767N/A </block>
5767N/A </sequence>
5767N/A </function>
5767N/A</stax>