1653N/A<?
xml version="1.0" encoding="UTF-8" standalone="no"?>
1653N/A ! The contents of this file are subject to the terms of the 1653N/A ! Common Development and Distribution License, Version 1.0 only 1653N/A ! (the "License"). You may not use this file except in compliance 6983N/A ! You can obtain a copy of the license at 1653N/A ! See the License for the specific language governing permissions 1653N/A ! and limitations under the License. 6983N/A ! When distributing Covered Code, include this CDDL HEADER in each 6983N/A ! file and include the License file at 1653N/A ! add the following below this CDDL HEADER, with the fields enclosed 1653N/A ! by brackets "[]" replaced with your own identifying information: 1653N/A ! Portions Copyright [yyyy] [name of copyright owner] 5636N/A ! Copyright 2008 Sun Microsystems, Inc. 5636N/A <
defaultcall function="snmp_status"/>
1653N/A <
function name="snmp_status">
1653N/A <
block name="'snmp_status'">
<!--- Test Suite information #@TestSuiteName SNMP Connection Handler status #@TestSuitePurpose Check SNMP Connection Handler status. #@TestSuiteGroup SNMP Connection Handler status CurrentTestPath['group'] = 'snmp'
CurrentTestPath['suite'] = STAXCurrentBlock
<
call function="'testSuite_Preamble'"/>
<!--- Define default values --> % (SNMP_PROPERTIES['community'], SNMP_PROPERTIES['community'])
% (DIRECTORY_INSTANCE_DIR, OPENDSNAME)
<!--- Test Case information #@TestMarker SNMP Connection Handler status #@TestName status: check status when the server is #@TestPurpose Check status when the server is #@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 #@TestResult Success if output of status is correct. <
testcase name="getTestCaseName <
call function="'testCase_Preamble'"/>
'status: stop DS running on port %s' \
% (DIRECTORY_INSTANCE_PORT)
<
call function="'StopDsWithScript'">
'location' : STAF_REMOTE_HOSTNAME ,
'dsHost' : DIRECTORY_INSTANCE_HOST ,
'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
'status: status when the server is stopped'
<
call function="'StatusWithScript'">
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
returnString = STAXResult[0][1]
<
call function="'searchString'">
'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
'returnString' : returnString ,
'expectedRC' : expectedRC
'status: start DS to run on port %s' \
% (DIRECTORY_INSTANCE_PORT)
<
call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
<!--- Check that DS started --> <
call function="'isAlive'">
'noOfMilliSeconds' : 2000
'status: status when the server is started'
<
call function="'StatusWithScript'">
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
returnString = STAXResult[0][1]
<
call function="'searchString'">
'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
'returnString' : returnString ,
'expectedRC' : expectedRC
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : community ,
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker SNMP Connection Handler status #@TestName status: check status when the connection #@TestPurpose Check status when the SNMP connection handler #@TestStep disable the SNMP connection handler #@TestStep check status using status command #@TestStep enable the SNMP connection handler #@TestStep check status using status command #@TestResult Success if output of status is correct. <
testcase name="getTestCaseName <
call function="'testCase_Preamble'"/>
'status: disable the SNMP Connection Handler'
<
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'
'status: status when the SNMP connection handler is disabled'
<
call function="'StatusWithScript'">
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
returnString = STAXResult[0][1]
<
call function="'searchString'">
'expectedString' : '0.0.0.0:%s : SNMP : Disabled' \
'returnString' : returnString ,
'expectedRC' : expectedRC
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : community ,
'snmpStatus' : 'reqTimeout'
'status: enable the SNMP Connection Handler'
<
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'
'status: status when the SNMP connection handler is enabled'
<
call function="'StatusWithScript'">
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
returnString = STAXResult[0][1]
<
call function="'searchString'">
'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
'returnString' : returnString ,
'expectedRC' : expectedRC
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : community ,
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker SNMP Connection Handler status #@TestName status: check error message and status when the opendmk-jarfile property is set to a #@TestPurpose Check error message and status when the opendmk-jarfile property is set to a #@TestStep set opendmk-jarfile property to a wrong value #@TestStep restart the server #@TestStep check that an error message is displayed at #@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 #@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')">
<
call function="'testCase_Preamble'"/>
'status: set opendmk-jarfile property to a wrong value'
<
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'
'status: restart DS running on port %s' \
% (DIRECTORY_INSTANCE_PORT)
<
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 function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
<!--- Check that DS started --> <
call function="'isAlive'">
'noOfMilliSeconds' : 2000
msg1 = 'You do not have the appropriated OpenDMK jar files to'
msg2 = 'enable the SNMP Connection Handler. Please go under'
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)
'location' : STAF_REMOTE_HOSTNAME ,
'filename' : serverLogFile ,
'status: status when the server is started'
<
call function="'StatusWithScript'">
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
returnString = STAXResult[0][1]
<
call function="'searchString'">
'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
'returnString' : returnString ,
'expectedRC' : expectedRC
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : community ,
'snmpStatus' : 'reqTimeout'
'status: restore value for opendmk-jarfile property'
<
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']
'status: restart the SNMP Connection Handler'
<
call function="'restartSNMPConnectionHandler'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
<
call function="'testCase_Postamble'"/>
<!--- 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 #@TestPurpose Check error message and status when the security-agent-file property is set to a #@TestStep set security-agent-file property to a wrong #@TestStep restart the server #@TestStep check that an error message is displayed at #@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 #@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')">
<
call function="'testCase_Preamble'"/>
'status: set the security-agent-file to a wrong value'
<
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'
'status: restart DS running on port %s' \
% (DIRECTORY_INSTANCE_PORT)
<
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 function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
<!--- Check that DS started --> <
call function="'isAlive'">
'noOfMilliSeconds' : 2000
msg1 = 'An unexpected error occurred while trying to initialize'
msg2 = 'the SNMP Connection Handler. Please check the'
msg3 = 'configuration attributes'
msg = '%s %s %s' % (msg1, msg2, msg3)
'location' : STAF_REMOTE_HOSTNAME ,
'filename' : serverLogFile ,
msg1 = 'You do not have the appropriated OpenDMK jar files to'
msg2 = 'enable the SNMP Connection Handler. Please go under'
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)
'location' : STAF_REMOTE_HOSTNAME ,
'filename' : serverLogFile ,
'status: status when the server is started'
<
call function="'StatusWithScript'">
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
returnString = STAXResult[0][1]
<
call function="'searchString'">
'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
'returnString' : returnString ,
'expectedRC' : expectedRC
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : community ,
'snmpStatus' : 'reqTimeout'
'status: restore value for security-agent-file property'
<
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']
'status: restart the SNMP Connection Handler'
<
call function="'restartSNMPConnectionHandler'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
<
call function="'testCase_Postamble'"/>
<!--- 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 #@TestPurpose Check error message and status when the listen-port property is set to a wrong #@TestStep set listen-port property to a wrong value #@TestStep restart the server #@TestStep check that an error message is displayed at #@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 #@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')">
<
call function="'testCase_Preamble'"/>
<!-- This testcase is not relevant on Windows --> if is_windows_platform(STAF_REMOTE_HOSTNAME):
'status: set the listen-port to a wrong value'
<
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']
'status: restart DS running on port %s' \
% (DIRECTORY_INSTANCE_PORT)
<
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 function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
<!--- Check that DS started --> <
call function="'isAlive'">
'noOfMilliSeconds' : 2000
msg1 = 'An unexpected error occurred while trying to'
msg2 = 'initialize the SNMP Connection Handler. Please'
msg3 = 'check the configuration attributes'
msg = '%s %s %s' % (msg1, msg2, msg3)
'location' : STAF_REMOTE_HOSTNAME ,
'filename' : serverLogFile ,
'status: status when the server is started'
<
call function="'StatusWithScript'">
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
returnString = STAXResult[0][1]
<
call function="'searchString'">
'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
% DEFAULT_PROPERTIES['listen-port'] ,
'returnString' : returnString ,
'expectedRC' : expectedRC
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : community ,
'snmpStatus' : 'reqTimeout'
'status: restore value for listen-port property'
<
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']
'status: restart the SNMP Connection Handler'
<
call function="'restartSNMPConnectionHandler'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
<
message>'This testcase is not relevant on Windows'</
message>
<
tcstatus result="'pass'"/>
<
call function="'testCase_Postamble'"/>
<
call function="'testSuite_Postamble'"/>