snmp_v1_customconf.xml revision d25372dc8e65a9ed019a88fdf659ca61313f1b31
<?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_v1_customconf"/>
<function name="snmp_v1_customconf">
<sequence>
<block name="'snmp_v1_customconf'">
<sequence>
<!--- Test Suite information
#@TestSuiteName SNMP v1 with custom configuration
#@TestSuitePurpose Check SNMP v1 with custom configuration.
#@TestSuiteGroup SNMP v1 with custom configuration
#@TestScript snmp_v1_customconf.xml
-->
<script>
if not CurrentTestPath.has_key('group'):
CurrentTestPath['group'] = 'snmp'
CurrentTestPath['suite'] = STAXCurrentBlock
</script>
<call function="'testSuite_Preamble'"/>
<!--- Define default values -->
<script>
defCommunityProp = SNMP_PROPERTIES['community']
defCommunity = '%s@%s' %(defCommunityProp, defCommunityProp)
defManagerProp = SNMP_PROPERTIES['allowed-manager']
newCommunityProp = 'myCommunity'
newCommunity = '%s@%s' %(newCommunityProp, newCommunityProp)
newManagerProp = DIRECTORY_INSTANCE_HOST
wrongManagerProp = 'myManager'
oid = 'dsServerType.1'
</script>
<!--- Test Case information
#@TestMarker SNMP v1 with custom configuration
#@TestName v1_customconf: TODO
#@TestIssue none
#@TestPurpose TODO.
#@TestPreamble none
#@TestStep TODO.
#@TestPostamble none
#@TestResult TODO.
-->
<testcase name="getTestCaseName
('v1_customconf: change the community property')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'v1_customconf: change the community property'
</message>
<call function="'dsconfig'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set community:%s' % newCommunityProp
}
</call>
<message>
'v1_customconf: restart the SNMP Connection Handler'
</message>
<call function="'restartSNMPConnectionHandler'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<message>
'v1_customconf: get with the old community'
</message>
<call function="'SNMPGet'">
{
'snmpVersion' : '1',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpCommunity' : defCommunity ,
'snmpOIDs' : oid ,
'snmpStatus' : 'reqTimeout'
}
</call>
<message>
'v1_customconf: get with the new community'
</message>
<call function="'SNMPGet'">
{
'snmpVersion' : '1',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpCommunity' : newCommunity ,
'snmpOIDs' : oid ,
'snmpStatus' : 'noError'
}
</call>
<message>
'v1_customconf: restore the community property'
</message>
<call function="'dsconfig'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set community:%s' % defCommunityProp
}
</call>
<message>
'v1_customconf: restart the SNMP Connection Handler'
</message>
<call function="'restartSNMPConnectionHandler'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker SNMP v1 with custom configuration
#@TestName v1_customconf: TODO
#@TestIssue none
#@TestPurpose TODO.
#@TestPreamble none
#@TestStep TODO.
#@TestPostamble none
#@TestResult TODO.
-->
<testcase name="getTestCaseName
('v1_customconf: set allowed-manager property to a correct value')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'v1_customconf: change the allowed-manager property'
</message>
<call function="'dsconfig'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set allowed-manager:%s' % newManagerProp
}
</call>
<message>
'v1_customconf: restart the SNMP Connection Handler'
</message>
<call function="'restartSNMPConnectionHandler'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<message>
'v1_customconf: get with the new community'
</message>
<call function="'SNMPGet'">
{
'snmpVersion' : '1',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpCommunity' : defCommunity ,
'snmpOIDs' : oid ,
'snmpStatus' : 'noError'
}
</call>
<message>
'v1_customconf: restore the community property'
</message>
<call function="'dsconfig'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set allowed-manager:%s' % defManagerProp
}
</call>
<message>
'v1_customconf: restart the SNMP Connection Handler'
</message>
<call function="'restartSNMPConnectionHandler'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker SNMP v1 with custom configuration
#@TestName v1_customconf: TODO
#@TestIssue none
#@TestPurpose TODO.
#@TestPreamble none
#@TestStep TODO.
#@TestPostamble none
#@TestResult TODO.
-->
<testcase name="getTestCaseName
('v1_customconf: set allowed-manager property to a wrong value')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'v1_customconf: change the allowed-manager property'
</message>
<call function="'dsconfig'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set allowed-manager:%s' \
% wrongManagerProp
}
</call>
<message>
'v1_customconf: restart the SNMP Connection Handler'
</message>
<call function="'restartSNMPConnectionHandler'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<message>
'v1_customconf: get with the old community'
</message>
<call function="'SNMPGet'">
{
'snmpVersion' : '1',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpCommunity' : defCommunity ,
'snmpOIDs' : oid ,
'snmpStatus' : 'noSuchName'
}
</call>
<message>
'v1_customconf: restore the community property'
</message>
<call function="'dsconfig'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set allowed-manager:%s' \
% defManagerProp
}
</call>
<message>
'v1_customconf: restart the SNMP Connection Handler'
</message>
<call function="'restartSNMPConnectionHandler'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker SNMP v1 with custom configuration
#@TestName v1_customconf: TODO
#@TestIssue none
#@TestPurpose TODO.
#@TestPreamble none
#@TestStep TODO.
#@TestPostamble none
#@TestResult TODO.
-->
<testcase name="getTestCaseName
('v1_customconf: set allowed-manager property to a list')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'v1_customconf: set allowed-manager property to a list'
</message>
<call function="'dsconfig'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set allowed-manager:%s' \
% wrongManagerProp
}
</call>
<call function="'dsconfig'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--add allowed-manager:%s' \
% newManagerProp
}
</call>
<message>
'v1_customconf: restart the SNMP Connection Handler'
</message>
<call function="'restartSNMPConnectionHandler'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<message>
'v1_customconf: get from a not allowed manager'
</message>
<call function="'SNMPGet'">
{
'snmpVersion' : '1',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpCommunity' : defCommunity ,
'snmpOIDs' : oid ,
'snmpStatus' : 'noError'
}
</call>
<message>
'v1_customconf: restore the community property'
</message>
<call function="'dsconfig'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set allowed-manager:%s' \
% defManagerProp
}
</call>
<message>
'v1_customconf: restart the SNMP Connection Handler'
</message>
<call function="'restartSNMPConnectionHandler'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker SNMP v1 with custom configuration
#@TestName v1_customconf: TODO
#@TestIssue none
#@TestPurpose TODO.
#@TestPreamble none
#@TestStep TODO.
#@TestPostamble none
#@TestResult TODO.
-->
<testcase name="getTestCaseName
('v1_customconf: set the community property to a list')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'v1_customconf: set the community property to a list'
</message>
<call function="'dsconfig'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--add community:%s' % newCommunityProp ,
'expectedRC' : 1
}
</call>
<script>
returnString = STAXResult[0][1]
if is_windows_platform(DIRECTORY_INSTANCE_HOST):
newline = '\r\n'
else:
newline = '\n'
msg1 = 'It is not possible to specify multiple values for the'
msg2 = 'SNMP Connection Handler%sproperty "community" as it' \
% newline
msg3 = 'is single-valued'
msg = '%s %s %s' % (msg1, msg2, msg3)
</script>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : msg
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<call function="'testSuite_Postamble'"/>
</sequence>
</block>
</sequence>
</function>
</stax>