snmp_status.xml revision 23f633e1b8cc53fdac740eca4ab7e0341890bba2
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt<?xml version="1.0" encoding="UTF-8" standalone="no"?>
5d35f07318456d6ca01d3866c89ae9e50ab029b0Tinderbox User<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<!--
5d35f07318456d6ca01d3866c89ae9e50ab029b0Tinderbox User ! CDDL HEADER START
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews !
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews ! The contents of this file are subject to the terms of the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews ! Common Development and Distribution License, Version 1.0 only
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt ! (the "License"). You may not use this file except in compliance
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt ! with the License.
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt !
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt ! You can obtain a copy of the license at
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt ! See the License for the specific language governing permissions
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt ! and limitations under the License.
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt !
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt ! When distributing Covered Code, include this CDDL HEADER in each
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt ! file and include the License file at
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt ! add the following below this CDDL HEADER, with the fields enclosed
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt ! by brackets "[]" replaced with your own identifying information:
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt ! Portions Copyright [yyyy] [name of copyright owner]
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt !
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt ! CDDL HEADER END
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt !
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt ! Copyright 2008 Sun Microsystems, Inc.
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt ! -->
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt<stax>
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt <defaultcall function="snmp_status"/>
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt <function name="snmp_status">
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt <sequence>
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt <block name="'snmp_status'">
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt <sequence>
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt <!--- Test Suite information
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt #@TestSuiteName SNMP Connection Handler status
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt #@TestSuitePurpose Check SNMP Connection Handler status.
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt #@TestSuiteGroup SNMP Connection Handler status
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt #@TestScript snmp_status.xml
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt -->
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt <script>
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt if not CurrentTestPath.has_key('group'):
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt CurrentTestPath['group'] = 'snmp'
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt CurrentTestPath['suite'] = STAXCurrentBlock
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt </script>
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt <call function="'testSuite_Preamble'"/>
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt <!--- Define default values -->
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt <script>
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt community = '%s@%s' \
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt % (SNMP_PROPERTIES['community'], SNMP_PROPERTIES['community'])
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt oid = 'dsServerType.1'
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt serverLogFile = '%s/%s/logs/server.out' \
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt % (DIRECTORY_INSTANCE_DIR, OPENDSNAME)
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt </script>
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt <!--- Test Case information
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt #@TestMarker SNMP Connection Handler status
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt #@TestName status: check status when the server is
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt stopped/started
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt #@TestIssue none
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt #@TestPurpose Check status when the server is
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt stopped/started.
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt #@TestPreamble none
#@TestStep stop the server
#@TestStep check status using status command
#@TestStep start the server
#@TestStep check status using status command
#@TestStep do a SNMP get request to check that the
connection handler
#@TestPostamble none
#@TestResult Success if output of status is correct.
-->
<testcase name="getTestCaseName
('status: status when the server is stopped/started')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'status: stop DS running on port %s' \
% (DIRECTORY_INSTANCE_PORT)
</message>
<call function="'StopDsWithScript'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'dsHost' : DIRECTORY_INSTANCE_HOST ,
'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<message>
'status: status when the server is stopped'
</message>
<call function="'StatusWithScript'">
{
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchString'">
{
'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
% SNMP_PORT ,
'returnString' : returnString ,
'expectedRC' : 0
}
</call>
<message>
'status: start DS to run on port %s' \
% (DIRECTORY_INSTANCE_PORT)
</message>
<call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<!--- Check that DS started -->
<call function="'isAlive'">
{
'noOfLoops' : 10 ,
'noOfMilliSeconds' : 2000
}
</call>
<message>
'status: status when the server is started'
</message>
<call function="'StatusWithScript'">
{
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchString'">
{
'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
% SNMP_PORT ,
'returnString' : returnString ,
'expectedRC' : 0
}
</call>
<message>
'status: get request'
</message>
<call function="'SNMPGet'">
{
'snmpVersion' : '1',
'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 Connection Handler status
#@TestName status: check status when the connection
handler is disabled/enabled
#@TestIssue none
#@TestPurpose Check status when the SNMP connection handler
is disabled/enabled.
#@TestPreamble none
#@TestStep disable the SNMP connection handler
#@TestStep check status using status command
#@TestStep enable the SNMP connection handler
#@TestStep check status using status command
#@TestPostamble none
#@TestResult Success if output of status is correct.
-->
<testcase name="getTestCaseName
('status: status when SNMP Connection Handler is disabled/enabled')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'status: disable the SNMP Connection Handler'
</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 enabled:false'
}
</call>
<message>
'status: status when the SNMP connection handler is disabled'
</message>
<call function="'StatusWithScript'">
{
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchString'">
{
'expectedString' : '0.0.0.0:%s : SNMP : Disabled' \
% SNMP_PORT ,
'returnString' : returnString ,
'expectedRC' : 0
}
</call>
<message>
'status: get request'
</message>
<call function="'SNMPGet'">
{
'snmpVersion' : '1',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpCommunity' : community ,
'snmpOIDs' : oid ,
'snmpStatus' : 'reqTimeout'
}
</call>
<message>
'status: enable the SNMP Connection Handler'
</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 enabled:true'
}
</call>
<message>
'status: status when the SNMP connection handler is enabled'
</message>
<call function="'StatusWithScript'">
{
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchString'">
{
'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
% SNMP_PORT ,
'returnString' : returnString ,
'expectedRC' : 0
}
</call>
<message>
'status: get request'
</message>
<call function="'SNMPGet'">
{
'snmpVersion' : '1',
'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 Connection Handler status
#@TestName status: check error message and status when
the opendmk-jarfile property is set to a
wrong value
#@TestIssue none
#@TestPurpose Check error message and status when
the opendmk-jarfile property is set to a
wrong value.
#@TestPreamble none
#@TestStep set opendmk-jarfile property to a wrong value
#@TestStep restart the server
#@TestStep check that an error message is displayed at
startup
#@TestStep check status using status command
#@TestStep restore value for opendmk-jarfile property
#@TestStep disable the SNMP connection handler
#@TestStep enable the SNMP connection handler
#@TestPostamble none
#@TestResult Success if an error message is displayed and
if the output of status is correct.
-->
<testcase name="getTestCaseName
('status: status with a wrong opendmk-jarfile value')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'status: set opendmk-jarfile property to a wrong value'
</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 opendmk-jarfile:wrong_file'
}
</call>
<message>
'status: restart DS running on port %s' \
% (DIRECTORY_INSTANCE_PORT)
</message>
<call function="'StopDsWithScript'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'dsHost' : DIRECTORY_INSTANCE_HOST ,
'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<!--- Check that DS started -->
<call function="'isAlive'">
{
'noOfLoops' : 10 ,
'noOfMilliSeconds' : 2000
}
</call>
<script>
opendmkJarFile = '%s/%s/wrong_file' \
% (DIRECTORY_INSTANCE_DIR, OPENDSNAME)
if is_windows_platform(DIRECTORY_INSTANCE_HOST):
opendmkJarFile = opendmkJarFile.replace('/', '\\')
msg1 = 'The specified OpenDMK jar file'
msg2 = '\'%s\' could not be found.' % opendmkJarFile
msg3 = 'Verify that the value set in the opendmk-jarfile'
msg4 = 'configuration parameter of the SNMP connection handler'
msg5 = 'is the valid path to the jdmkrt.jar file and that the'
msg6 = 'file is accessible'
msg = '%s %s %s %s %s %s' % (msg1, msg2, msg3, msg4, msg5, msg6)
</script>
<call function="'grep'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'filename' : serverLogFile ,
'testString': msg
}
</call>
<message>
'status: status when the server is started'
</message>
<call function="'StatusWithScript'">
{
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchString'">
{
'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
% SNMP_PORT ,
'returnString' : returnString ,
'expectedRC' : 0
}
</call>
<message>
'status: get request'
</message>
<call function="'SNMPGet'">
{
'snmpVersion' : '1',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpCommunity' : community ,
'snmpOIDs' : oid ,
'snmpStatus' : 'reqTimeout'
}
</call>
<message>
'status: restore value for opendmk-jarfile 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 opendmk-jarfile:%s' \
% SNMP_PROPERTIES['opendmk-jarfile']
}
</call>
<message>
'status: 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 Connection Handler status
#@TestName status: check error message and status when
the security-agent-file property is set to a
wrong value
#@TestIssue none
#@TestPurpose Check error message and status when
the security-agent-file property is set to a
wrong value.
#@TestPreamble none
#@TestStep set security-agent-file property to a wrong
value
#@TestStep restart the server
#@TestStep check that an error message is displayed at
startup
#@TestStep check status using status command
#@TestStep restore value for security-agent-file property
#@TestStep disable the SNMP connection handler
#@TestStep enable the SNMP connection handler
#@TestPostamble none
#@TestResult Success if an error message is displayed and
if the output of status is correct.
-->
<testcase name="getTestCaseName
('status: status with a wrong security-agent-file value')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'status: set the security-agent-file to a wrong value'
</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 security-agent-file:wrong_file'
}
</call>
<message>
'status: restart DS running on port %s' \
% (DIRECTORY_INSTANCE_PORT)
</message>
<call function="'StopDsWithScript'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'dsHost' : DIRECTORY_INSTANCE_HOST ,
'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<!--- Check that DS started -->
<call function="'isAlive'">
{
'noOfLoops' : 10 ,
'noOfMilliSeconds' : 2000
}
</call>
<script>
msg1 = 'Cannot initialize the SNMP Connection Handler.'
msg2 = 'Please check the configuration attributes'
msg = '%s %s' % (msg1, msg2)
</script>
<call function="'grep'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'filename' : serverLogFile ,
'testString': msg
}
</call>
<script>
msg1 = 'You do not have the appropriated OpenDMK jar files to'
msg2 = 'enable the SNMP Connection Handler. Please go under'
msg3 = 'http:\/\/opendmk.dev.java.net and set the'
msg4 = 'ds-cfg-opendmk-jarfile configuration parameter to set'
msg5 = 'the full path of the required jdmkrt.jar file.'
msg6 = 'The SNMP connection Handler didn\'t started'
msg = '%s %s %s %s %s %s' % (msg1, msg2, msg3, msg4, msg5, msg6)
</script>
<call function="'grep'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'filename' : serverLogFile ,
'testString' : msg ,
'expectedRC' : 1
}
</call>
<message>
'status: status when the server is started'
</message>
<call function="'StatusWithScript'">
{
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchString'">
{
'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
% SNMP_PORT ,
'returnString' : returnString ,
'expectedRC' : 0
}
</call>
<message>
'status: get request'
</message>
<call function="'SNMPGet'">
{
'snmpVersion' : '1',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpCommunity' : community ,
'snmpOIDs' : oid ,
'snmpStatus' : 'reqTimeout'
}
</call>
<message>
'status: restore value for security-agent-file 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 security-agent-file:%s' \
% SNMP_PROPERTIES['security-agent-file']
}
</call>
<message>
'status: 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 Connection Handler status
#@TestName status: check error message and status when
the listen-port property is set to a wrong
value
#@TestIssue none
#@TestPurpose Check error message and status when
the listen-port property is set to a wrong
value.
#@TestPreamble none
#@TestStep set listen-port property to a wrong value
#@TestStep restart the server
#@TestStep check that an error message is displayed at
startup
#@TestStep check status using status command
#@TestStep restore value for listen-port property
#@TestStep disable the SNMP connection handler
#@TestStep enable the SNMP connection handler
#@TestPostamble none
#@TestResult Success if an error message is displayed and
if the output of status is correct.
-->
<testcase name="getTestCaseName
('status: status with a wrong listen-port value')">
<sequence>
<call function="'testCase_Preamble'"/>
<!-- This testcase is not relevant on Windows -->
<script>
if is_windows_platform(STAF_REMOTE_HOSTNAME):
skip=1
else:
skip=0
</script>
<if expr="skip == 0">
<sequence>
<message>
'status: set the listen-port to a wrong value'
</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 listen-port:%s' \
% DEFAULT_PROPERTIES['listen-port']
}
</call>
<message>
'status: restart DS running on port %s' \
% (DIRECTORY_INSTANCE_PORT)
</message>
<call function="'StopDsWithScript'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'dsHost' : DIRECTORY_INSTANCE_HOST ,
'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<!--- Check that DS started -->
<call function="'isAlive'">
{
'noOfLoops' : 10 ,
'noOfMilliSeconds' : 2000
}
</call>
<script>
msg1 = 'Cannot initialize the SNMP Connection Handler.'
msg2 = 'Please check the configuration attributes'
msg = '%s %s' % (msg1, msg2)
</script>
<call function="'grep'">
{
'location' : STAF_REMOTE_HOSTNAME ,
'filename' : serverLogFile ,
'testString': msg
}
</call>
<message>
'status: status when the server is started'
</message>
<call function="'StatusWithScript'">
{
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'searchString'">
{
'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
% DEFAULT_PROPERTIES['listen-port'] ,
'returnString' : returnString ,
'expectedRC' : 0
}
</call>
<message>
'status: get request'
</message>
<call function="'SNMPGet'">
{
'snmpVersion' : '1',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpCommunity' : community ,
'snmpOIDs' : oid ,
'snmpStatus' : 'reqTimeout'
}
</call>
<message>
'status: restore value for listen-port 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 listen-port:%s' \
% SNMP_PROPERTIES['listen-port']
}
</call>
<message>
'status: restart the SNMP Connection Handler'
</message>
<call function="'restartSNMPConnectionHandler'">
{
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
}
</call>
</sequence>
<else>
<sequence>
<message>'This testcase is not relevant on Windows'</message>
<tcstatus result="'pass'"/>
</sequence>
</else>
</if>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<call function="'testSuite_Postamble'"/>
</sequence>
</block>
</sequence>
</function>
</stax>