<?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.
! Portions Copyright 2012 ForgeRock AS
! -->
<stax>
<!--- Test Case information
#@TestMarker SNMP v2c with default configuration
#@TestName v2c_defaultconf: get with default community
#@TestIssue none
#@TestPurpose Check that a SNMP Get request with default
community succeeds.
#@TestPreamble none
#@TestStep SNMP Get request.
#@TestPostamble none
#@TestResult Success if SNMPGet returns 0.
-->
<function name="snmp_v2c_default_001" scope="local">
<testcase name="getTestCaseName('v2c get with default community')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'testStep'">
{ 'stepMessage' : 'Get with default community.' }
</call>
<call function="'SNMPGet'">
{
'snmpVersion' : '2',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpCommunity' : community ,
'snmpOIDs' : oid ,
'snmpStatus' : 'noError'
}
</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 v2c with default configuration
#@TestName v2c_defaultconf: get with wrong community
#@TestIssue none
#@TestPurpose Check that a SNMP Get request with wrong
community fails with noSuchName.
#@TestPreamble none
#@TestStep SNMP Get request.
#@TestPostamble none
#@TestResult Success if SNMPGet returns 0.
-->
<function name="snmp_v2c_default_002" scope="local">
<testcase name="getTestCaseName('v2c get with wrong community')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'testStep'">
{ 'stepMessage' : 'Get with wrong community.' }
</call>
<call function="'SNMPGet'">
{
'snmpVersion' : '2',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpCommunity' : 'OpenDS' ,
'snmpOIDs' : oid ,
'snmpStatus' : 'noError' ,
'snmpValidOIDs' : 'False'
}
</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 v2c with default configuration
#@TestName v2c_defaultconf: set with default community
#@TestIssue none
#@TestPurpose Check that a SNMP Set request with default
community fails with noSuchName.
#@TestPreamble none
#@TestStep SNMP Set request.
#@TestPostamble none
#@TestResult Success if SNMPSet returns 0.
-->
<function name="snmp_v2c_default_003" scope="local">
<testcase name="getTestCaseName('v2c set with default community')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'testStep'">
{ 'stepMessage' : 'Set with default community.' }
</call>
<call function="'SNMPSet'">
{
'snmpVersion' : '2',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpCommunity' : community ,
'snmpOIDs' : oid ,
'snmpStatus' : 'authorizationError'
}
</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 v2c with default configuration
#@TestName v2c_defaultconf: set with wrong community
#@TestIssue none
#@TestPurpose Check that a SNMP Set request with wrong
community fails with noSuchName.
#@TestPreamble none
#@TestStep SNMP Set request.
#@TestPostamble none
#@TestResult Success if SNMPSet returns 0.
-->
<function name="snmp_v2c_default_004" scope="local">
<testcase name="getTestCaseName('v2c set with wrong community')">
<sequence>
<try>
<sequence>
<call function="'testCase_Preamble'"/>
<call function="'testStep'">
{ 'stepMessage' : 'Set with wrong community.' }
</call>
<call function="'SNMPSet'">
{
'snmpVersion' : '2',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpCommunity' : 'OpenDS' ,
'snmpOIDs' : oid ,
'snmpStatus' : 'noAccess'
}
</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>