snmp_v2c_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_v2c_defaultconf"/>
<function name="snmp_v2c_defaultconf">
<sequence>
<block name="'snmp_v2c_defaultconf'">
<sequence>
<!--- Test Suite information
#@TestSuiteName SNMP v2c with default configuration
#@TestSuitePurpose Check SNMP v2c with default configuration.
#@TestSuiteGroup SNMP v2c with default configuration
#@TestScript snmp_v2c_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 and oid -->
<script>
community = '%s@%s' \
% (SNMP_PROPERTIES['community'], SNMP_PROPERTIES['community'])
oid = 'dsServerType.1'
</script>
<!--- Test Case information
#@TestMarker SNMP v2c with default configuration
#@TestName v2c_defaultconf: get with default commnunity
#@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.
-->
<testcase name="getTestCaseName
('v2c_defaultconf: get with default commnunity')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'v2c_defaultconf: get with default community'
</message>
<call function="'SNMPGet'">
{
'snmpVersion' : '2',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpCommunity' : community ,
'snmpOIDs' : oid ,
'snmpStatus' : 'noError'
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker SNMP v2c with default configuration
#@TestName v2c_defaultconf: get with wrong
commnunity
#@TestIssue none
#@TestPurpose Check that a SNMP Get request with wrong
community succeeds but the OIDs values are
not correct.
#@TestPreamble none
#@TestStep SNMP Get request.
#@TestPostamble none
#@TestResult Success if SNMPGet returns 0.
-->
<testcase name="getTestCaseName
('v2c_defaultconf: get with wrong community')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'v2c_defaultconf: get with wrong community'
</message>
<call function="'SNMPGet'">
{
'snmpVersion' : '2',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpCommunity' : 'OpenDS' ,
'snmpOIDs' : oid ,
'snmpStatus' : 'noError' ,
'snmpValidOIDs' : 'False'
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker SNMP v2c with default configuration
#@TestName v2c_defaultconf: set with default ommnunity
#@TestIssue none
#@TestPurpose Check that a SNMP Set request with default
community fails with authorizationError.
#@TestPreamble none
#@TestStep SNMP Set request.
#@TestPostamble none
#@TestResult Success if SNMPSet returns 0.
-->
<testcase name="getTestCaseName
('v2c_defaultconf: set with default community')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'v2c_defaultconf: set with default community'
</message>
<call function="'SNMPSet'">
{
'snmpVersion' : '2',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpCommunity' : community ,
'snmpOIDs' : oid ,
'snmpStatus' : 'authorizationError'
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker SNMP v2c with default configuration
#@TestName v2c_defaultconf: set with wrong
commnunity
#@TestIssue none
#@TestPurpose Check that a SNMP Set request with wrong
community fails with noAccess.
#@TestPreamble none
#@TestStep SNMP Set request.
#@TestPostamble none
#@TestResult Success if SNMPSet returns 0.
-->
<testcase name="getTestCaseName
('v2c_defaultconf: set with wrong community')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'v2c_defaultconf: set with wrong community'
</message>
<call function="'SNMPSet'">
{
'snmpVersion' : '2',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpCommunity' : 'OpenDS' ,
'snmpOIDs' : oid ,
'snmpStatus' : 'noAccess'
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<call function="'testSuite_Postamble'"/>
</sequence>
</block>
</sequence>
</function>
</stax>