5767N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
5767N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
5767N/A<!--
5767N/A ! CDDL HEADER START
5767N/A !
5767N/A ! The contents of this file are subject to the terms of the
5767N/A ! Common Development and Distribution License, Version 1.0 only
5767N/A ! (the "License"). You may not use this file except in compliance
5767N/A ! with the License.
5767N/A !
5767N/A ! You can obtain a copy of the license at
5767N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
5767N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
5767N/A ! See the License for the specific language governing permissions
5767N/A ! and limitations under the License.
5767N/A !
5767N/A ! When distributing Covered Code, include this CDDL HEADER in each
5767N/A ! file and include the License file at
5767N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
5767N/A ! add the following below this CDDL HEADER, with the fields enclosed
5767N/A ! by brackets "[]" replaced with your own identifying information:
5767N/A ! Portions Copyright [yyyy] [name of copyright owner]
5767N/A !
5767N/A ! CDDL HEADER END
5767N/A !
5767N/A ! Copyright 2008 Sun Microsystems, Inc.
6036N/A ! Portions Copyright 2012-2013 ForgeRock AS
5767N/A ! -->
5767N/A<stax>
5767N/A
5767N/A <!--- Test Case information
5767N/A #@TestMarker SNMP Connection Handler default properties
5767N/A #@TestName snmp_defaultproperties: TODO
5767N/A #@TestIssue none
5767N/A #@TestPurpose TODO.
5767N/A #@TestPreamble none
5767N/A #@TestStep TODO.
5767N/A #@TestPostamble none
5767N/A #@TestResult TODO.
5767N/A -->
5767N/A <function name="snmp_basic_001" scope="local">
5767N/A <testcase name="getTestCaseName('SNMP Default Properties')">
5767N/A <sequence>
5767N/A <try>
5767N/A <sequence>
5767N/A <call function="'testCase_Preamble'"/>
5767N/A <message>
5767N/A 'Test Name = %s' % STAXCurrentTestcase
5767N/A </message>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Check the default properties.' }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A result = compare_property_table(EXPECTED_PROPERTIES,
5767N/A DEFAULT_PROPERTIES)
5767N/A </script>
5767N/A
5767N/A <message>
5767N/A '%s' % result
5767N/A </message>
5767N/A
5767N/A <call function="'checktestStringNotPresent'">
5767N/A {
5767N/A 'returnString' : result ,
5767N/A 'testString' : 'ERROR'
5767N/A }
5767N/A </call>
5767N/A
5767N/A </sequence>
5767N/A
5767N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5767N/A <message log="1" level="'fatal'">
5767N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5767N/A </message>
5767N/A </catch>
5767N/A <finally>
5767N/A <sequence>
5767N/A <call function="'testCase_Postamble'"/>
5767N/A </sequence>
5767N/A </finally>
5767N/A </try>
5767N/A </sequence>
5767N/A </testcase>
5767N/A </function>
5767N/A
5767N/A <!--- Test Case information
5767N/A #@TestMarker SNMP MIB values
5767N/A #@TestName snmp_mibvalues: TODO
6076N/A #@TestIssue none
5767N/A #@TestPurpose TODO.
5767N/A #@TestPreamble none
5767N/A #@TestStep TODO.
5767N/A #@TestPostamble none
5767N/A #@TestResult TODO.
5767N/A -->
5767N/A <function name="snmp_basic_002" scope="local">
5767N/A <testcase name="getTestCaseName('Check the connection handlers')">
5767N/A <sequence>
5767N/A <try>
5767N/A <sequence>
5767N/A
5767N/A <call function="'testCase_Preamble'"/>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Save the SNMP values.' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '1',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpCommunity' : community ,
5767N/A 'snmpOIDs' : '' ,
5767N/A 'snmpStatus' : 'noError' ,
6076N/A 'snmpWalk' : 'True'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A DEFAULT_VALUES = create_table_fromoutput(STAXResult[0][1])
5767N/A global_DEFAULT_VALUES.set(DEFAULT_VALUES)
5767N/A DEFAULT_VALUES = global_DEFAULT_VALUES.get()
5767N/A </script>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Check the connection handlers.' }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A nbHandler = get_handler_count(DEFAULT_VALUES)
5767N/A indexSNMP = get_handler_index(DEFAULT_VALUES, '1.3.6.1.27.3.%s'\
5767N/A % SNMP_PORT)
5767N/A indexLDAP = get_handler_index(DEFAULT_VALUES, '1.3.6.1.27.3.%s'\
5767N/A % DIRECTORY_INSTANCE_PORT)
5767N/A global_indexLDAP.set(indexLDAP)
5767N/A </script>
5767N/A
5767N/A <if expr="nbHandler == 2 and indexSNMP != 0 and indexLDAP != 0">
5767N/A <sequence>
5767N/A <script>
5767N/A msg1 = 'The connection handlers info are correct.\n'
5767N/A msg2 = 'number of handler: %s\n' % nbHandler
5767N/A msg3 = 'index SNMP handler: %s\n' % indexSNMP
5767N/A msg4 = 'index LDAP handler: %s\n' % indexLDAP
5767N/A msg = '%s%s%s%s' % (msg1, msg2, msg3, msg4)
5767N/A </script>
5767N/A <message>
5767N/A '%s' % msg
5767N/A </message>
5767N/A <tcstatus result="'pass'"></tcstatus>
5767N/A </sequence>
5767N/A <else>
5767N/A <sequence>
5767N/A <script>
5767N/A msg1 = 'The connection handlers info are wrong.\n'
5767N/A msg2 = 'number of handler: %s/3\n' % nbHandler
5767N/A msg3 = 'index SNMP handler: %s\n' % indexSNMP
5767N/A msg4 = 'index LDAP handler: %s\n' % indexLDAP
5767N/A msg = '%s%s%s%s' % (msg1, msg2, msg3, msg4)
5767N/A </script>
5767N/A <message>
5767N/A '%s' % msg
5767N/A </message>
5767N/A <tcstatus result="'fail'"></tcstatus>
5767N/A </sequence>
5767N/A </else>
5767N/A </if>
5767N/A
5767N/A </sequence>
5767N/A
5767N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5767N/A <message log="1" level="'fatal'">
5767N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5767N/A </message>
5767N/A </catch>
5767N/A <finally>
5767N/A <sequence>
5767N/A <call function="'testCase_Postamble'"/>
5767N/A </sequence>
5767N/A </finally>
5767N/A </try>
5767N/A </sequence>
5767N/A </testcase>
5767N/A </function>
5767N/A
5767N/A <!--- Test Case information
5767N/A #@TestMarker SNMP MIB values
5767N/A #@TestName snmp_mibvalues: TODO
5767N/A #@TestIssue none
5767N/A #@TestPurpose TODO.
5767N/A #@TestPreamble none
5767N/A #@TestStep TODO.
5767N/A #@TestPostamble none
5767N/A #@TestResult TODO.
5767N/A -->
5767N/A <function name="snmp_basic_003" scope="local">
5767N/A <testcase name="getTestCaseName('Check value of dsServerType entry')">
5767N/A <sequence>
5767N/A <try>
5767N/A
5767N/A <sequence>
5767N/A
5767N/A <call function="'testCase_Preamble'"/>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Check value of dsServerType entry.' }
5767N/A </call>
5767N/A
5767N/A <!-- Get the information about the server -->
5767N/A <call function="'GetVar'">
5767N/A { 'location' : STAF_REMOTE_HOSTNAME,
5767N/A 'type' : 'shared',
5767N/A 'variable' : 'Job%s_ServerInfo' % STAXParentID
5767N/A }
5767N/A </call>
5767N/A
5767N/A <if expr="RC != 0">
5767N/A <script>
5767N/A STAFResult='{}'
5767N/A </script>
5767N/A </if>
5767N/A
5767N/A <script>
5767N/A jobInfo=eval(STAFResult)
5767N/A
5767N/A # In IPS mode, DIRECTORY_INSTANCE_BIN is used
5767N/A # for installation path
5767N/A if IPS_PKG == True:
5767N/A instPath = DIRECTORY_INSTANCE_BIN
5767N/A else:
5767N/A instPath = DIRECTORY_INSTANCE_DIR
5767N/A
5767N/A if jobInfo.has_key('%s/%s' % (instPath,OPENDSNAME)):
5767N/A serverInformation=jobInfo['%s/%s' % (instPath,OPENDSNAME)]
5767N/A dsVersion=serverInformation['server version']
5767N/A dsBuild=serverInformation['server buildid']
5767N/A else:
5767N/A dsVersion='unknown'
5767N/A dsBuild='unknown'
5767N/A
5767N/A dsServer = '%s %s - %s' \
5767N/A % (PRODUCTNAME, dsVersion.rstrip(), dsBuild)
5767N/A
5767N/A DEFAULT_VALUES = global_DEFAULT_VALUES.get()
5767N/A dsServerType = DEFAULT_VALUES['dsServerType.1']
5767N/A </script>
5767N/A
5767N/A <if expr="dsServerType == dsServer">
5767N/A <sequence>
5767N/A <script>
5767N/A msg1 = 'Value for dsServerType entry is correct.\n'
5767N/A msg2 = 'Current value: %s' % dsServerType
5767N/A msg = '%s%s' % (msg1, msg2)
5767N/A </script>
5767N/A <message>
5767N/A '%s' % msg
5767N/A </message>
5767N/A <tcstatus result="'pass'"></tcstatus>
5767N/A </sequence>
5767N/A <else>
5767N/A <sequence>
5767N/A <script>
5767N/A msg1 = 'Value for dsServerType entry is wrong.\n'
5767N/A msg2 = 'Expected value: %s\n' % dsServer
5767N/A msg3 = 'Current value: %s' % dsServerType
5767N/A msg = '%s%s%s' % (msg1, msg2, msg3)
5767N/A </script>
5767N/A <message>
5767N/A '%s' % msg
5767N/A </message>
5767N/A <tcstatus result="'fail'"></tcstatus>
5767N/A </sequence>
5767N/A </else>
5767N/A </if>
5767N/A
5767N/A </sequence>
5767N/A
5767N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5767N/A <message log="1" level="'fatal'">
5767N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5767N/A </message>
5767N/A </catch>
5767N/A <finally>
5767N/A <sequence>
5767N/A <call function="'testCase_Postamble'"/>
5767N/A </sequence>
5767N/A </finally>
5767N/A </try>
5767N/A </sequence>
5767N/A </testcase>
5767N/A </function>
5767N/A
5767N/A <!--- Test Case information
5767N/A #@TestMarker SNMP MIB values
5767N/A #@TestName snmp_mibvalues: TODO
5767N/A #@TestIssue none
5767N/A #@TestPurpose TODO.
5767N/A #@TestPreamble none
5767N/A #@TestStep TODO.
5767N/A #@TestPostamble none
5767N/A #@TestResult TODO.
5767N/A -->
5767N/A <function name="snmp_basic_004" scope="local">
5767N/A <testcase name="getTestCaseName('Check value of dsServerDescription entry')">
5767N/A <sequence>
5767N/A <try>
5767N/A
5767N/A <sequence>
5767N/A
5767N/A <call function="'testCase_Preamble'"/>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Check value of dsServerDescription entry.' }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A DEFAULT_VALUES = global_DEFAULT_VALUES.get()
5767N/A dsServerDescription = DEFAULT_VALUES['dsServerDescription.1']
5767N/A dsPath = '%s/%s' % (DIRECTORY_INSTANCE_BIN, OPENDSNAME)
5767N/A if is_windows_platform(DIRECTORY_INSTANCE_HOST):
5767N/A dsPath = dsPath.replace('/', '\\')
5767N/A </script>
5767N/A
5767N/A <if expr="dsServerDescription == dsPath">
5767N/A <sequence>
5767N/A <script>
5767N/A msg1 = 'Value for dsServerDescription entry is correct.\n'
5767N/A msg2 = 'Current value: %s' % dsServerDescription
5767N/A msg = '%s%s' % (msg1, msg2)
5767N/A </script>
5767N/A <message>
5767N/A '%s' % msg
5767N/A </message>
5767N/A <tcstatus result="'pass'"></tcstatus>
5767N/A </sequence>
5767N/A <else>
5767N/A <sequence>
5767N/A <script>
5767N/A msg1 = 'Value for dsServerDescription entry is wrong.\n'
5767N/A msg2 = 'Expected value: %s\n' % dsPath
5767N/A msg3 = 'Current value: %s' % dsServerDescription
5767N/A msg = '%s%s%s' % (msg1, msg2, msg3)
5767N/A </script>
5767N/A <message>
5767N/A '%s' % msg
5767N/A </message>
5767N/A <tcstatus result="'fail'"></tcstatus>
5767N/A </sequence>
5767N/A </else>
5767N/A </if>
5767N/A
5767N/A </sequence>
5767N/A
5767N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5767N/A <message log="1" level="'fatal'">
5767N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5767N/A </message>
5767N/A </catch>
5767N/A <finally>
5767N/A <sequence>
5767N/A <call function="'testCase_Postamble'"/>
5767N/A </sequence>
5767N/A </finally>
5767N/A </try>
5767N/A </sequence>
5767N/A </testcase>
5767N/A </function>
5767N/A
5767N/A <!--- Test Case information
5767N/A #@TestMarker SNMP MIB values
5767N/A #@TestName snmp_mibvalues: TODO
6132N/A #@TestIssue none
5767N/A #@TestPurpose TODO.
5767N/A #@TestPreamble none
5767N/A #@TestStep TODO.
5767N/A #@TestPostamble none
5767N/A #@TestResult TODO.
5767N/A -->
5767N/A <function name="snmp_basic_005" scope="local">
5767N/A <testcase name="getTestCaseName('Check value of dsApplIfSearchOps entry')">
5767N/A <sequence>
5767N/A <try>
5767N/A
5767N/A <sequence>
5767N/A
5767N/A <call function="'testCase_Preamble'"/>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Perform %s search operation' % nbLoop }
5767N/A </call>
5767N/A
5767N/A <loop var="loop" from="1" to="nbLoop">
5767N/A <sequence>
5767N/A
5767N/A <script>
5767N/A id = 700 + loop
5767N/A userDn = 'uid=user.%s,o=snmp tests,dc=example,dc=com' % id
5767N/A </script>
5767N/A
5767N/A <message>
5767N/A 'LOOP %s: %s' % (loop, userDn)
5767N/A </message>
5767N/A
5767N/A <call function="'ldapSearchWithScript'">
5767N/A {
5767N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5767N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5767N/A 'dsTypesOnly' : 'True' ,
5767N/A 'dsBaseDN' : 'dc=com' ,
5767N/A 'dsFilter' : userDn
5767N/A }
5767N/A </call>
5767N/A
5767N/A </sequence>
5767N/A </loop>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Increment the SNMP values' }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A indexLDAP = global_indexLDAP.get()
5767N/A key = 'dsApplIfReadOps.%s' % indexLDAP
5767N/A DEFAULT_VALUES = global_DEFAULT_VALUES.get()
5767N/A DEFAULT_VALUES[key] = \
5767N/A str(int(DEFAULT_VALUES[key]) + nbLoop)
5767N/A key = 'dsApplIfSearchOps.%s' % indexLDAP
5767N/A DEFAULT_VALUES[key] = \
5767N/A str(int(DEFAULT_VALUES[key]) + nbLoop)
6132N/A key = 'dsApplIfWholeSubtreeSearchOps.%s' % indexLDAP
6132N/A DEFAULT_VALUES[key] = \
6132N/A str(int(DEFAULT_VALUES[key]) + nbLoop)
5767N/A </script>
6036N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Check value of dsApplIfSearchOps entry' }
5767N/A </call>
5767N/A
5767N/A <call function="'compareSNMPValues'">
5767N/A {
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpCommunity' : community ,
6132N/A 'index' : indexLDAP
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Save the snmp values' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '1',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpCommunity' : community ,
5767N/A 'snmpOIDs' : '' ,
5767N/A 'snmpStatus' : 'noError' ,
5767N/A 'snmpWalk' : 'True'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A DEFAULT_VALUES = {}
5767N/A global_DEFAULT_VALUES.set({})
5767N/A DEFAULT_VALUES = create_table_fromoutput(STAXResult[0][1])
5767N/A global_DEFAULT_VALUES.set(DEFAULT_VALUES)
5767N/A </script>
5767N/A
5767N/A </sequence>
5767N/A
5767N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5767N/A <message log="1" level="'fatal'">
5767N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5767N/A </message>
5767N/A </catch>
5767N/A <finally>
5767N/A <sequence>
5767N/A <call function="'testCase_Postamble'"/>
5767N/A </sequence>
5767N/A </finally>
5767N/A </try>
5767N/A </sequence>
5767N/A </testcase>
5767N/A </function>
5767N/A
5767N/A <!--- Test Case information
5767N/A #@TestMarker SNMP MIB values
5767N/A #@TestName snmp_mibvalues: TODO
6132N/A #@TestIssue none
5767N/A #@TestPurpose TODO.
5767N/A #@TestPreamble none
5767N/A #@TestStep TODO.
5767N/A #@TestPostamble none
5767N/A #@TestResult TODO.
5767N/A -->
5767N/A <function name="snmp_basic_006" scope="local">
5767N/A <testcase name="getTestCaseName('Check value of dsApplIfAddEntryOps entry')">
5767N/A <sequence>
5767N/A <try>
5767N/A
5767N/A <sequence>
5767N/A
5767N/A <call function="'testCase_Preamble'"/>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Perform %s add operations' % nbLoop }
5767N/A </call>
5767N/A
5767N/A <loop var="loop" from="1" to="nbLoop">
5767N/A <sequence>
5767N/A
5767N/A <script>
5767N/A id = 1000 + loop
5767N/A userDn = 'uid=user.%s,o=snmp tests,dc=example,dc=com' % id
5767N/A
5767N/A listAttr = []
5767N/A listAttr.append('objectclass:top')
5767N/A listAttr.append('objectclass:organizationalperson')
5767N/A listAttr.append('objectclass:inetorgperson')
5767N/A listAttr.append('objectclass:person')
5767N/A listAttr.append('givenname:Izen.0')
5767N/A listAttr.append('sn:Abizen.0')
5767N/A listAttr.append('cn:Izen Abizen.0')
5767N/A listAttr.append('l:ICNC')
5767N/A </script>
5767N/A
5767N/A <message>
5767N/A 'LOOP %s: %s' % (loop, userDn)
5767N/A </message>
5767N/A
5767N/A <call function="'addAnEntry'">
5767N/A {
5767N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5767N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5767N/A 'DNToAdd' : userDn,
5767N/A 'listAttributes' : listAttr
5767N/A }
5767N/A </call>
5767N/A
5767N/A </sequence>
5767N/A </loop>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Increment the SNMP values' }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A indexLDAP = global_indexLDAP.get()
5767N/A key = 'dsApplIfReadOps.%s' % indexLDAP
5767N/A DEFAULT_VALUES = global_DEFAULT_VALUES.get()
5767N/A DEFAULT_VALUES[key] = \
5767N/A str(int(DEFAULT_VALUES[key]) + nbLoop)
5767N/A key = 'dsApplIfAddEntryOps.%s' % indexLDAP
5767N/A DEFAULT_VALUES[key] = \
5767N/A str(int(DEFAULT_VALUES[key]) + nbLoop)
5767N/A DEFAULT_VALUES['dsMasterEntries.1'] = \
5767N/A str(int(DEFAULT_VALUES['dsMasterEntries.1']) + nbLoop)
5767N/A </script>
6036N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Check value of dsApplIfAddEntryOps entry' }
5767N/A </call>
5767N/A
5767N/A <call function="'compareSNMPValues'">
5767N/A {
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpCommunity' : community ,
6132N/A 'index' : indexLDAP
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Save the SNMP values' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '1',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpCommunity' : community ,
5767N/A 'snmpOIDs' : '' ,
5767N/A 'snmpStatus' : 'noError' ,
5767N/A 'snmpWalk' : 'True'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A DEFAULT_VALUES = {}
5767N/A global_DEFAULT_VALUES.set({})
5767N/A DEFAULT_VALUES = create_table_fromoutput(STAXResult[0][1])
5767N/A global_DEFAULT_VALUES.set(DEFAULT_VALUES)
5767N/A </script>
5767N/A
5767N/A </sequence>
5767N/A
5767N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5767N/A <message log="1" level="'fatal'">
5767N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5767N/A </message>
5767N/A </catch>
5767N/A <finally>
5767N/A <sequence>
5767N/A <call function="'testCase_Postamble'"/>
5767N/A </sequence>
5767N/A </finally>
5767N/A </try>
5767N/A </sequence>
5767N/A </testcase>
5767N/A </function>
5767N/A
5767N/A <!--- Test Case information
5767N/A #@TestMarker SNMP MIB values
5767N/A #@TestName snmp_mibvalues: TODO
6132N/A #@TestIssue none
5767N/A #@TestPurpose TODO.
5767N/A #@TestPreamble none
5767N/A #@TestStep TODO.
5767N/A #@TestPostamble none
5767N/A #@TestResult TODO.
5767N/A -->
5767N/A <function name="snmp_basic_007" scope="local">
5767N/A <testcase name="getTestCaseName('Check value of dsApplIfRemoveEntryOps entry')">
5767N/A <sequence>
5767N/A <try>
5767N/A
5767N/A <sequence>
5767N/A
5767N/A <call function="'testCase_Preamble'"/>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Perform %s remove operations' % nbLoop }
5767N/A </call>
5767N/A
5767N/A <loop var="loop" from="1" to="nbLoop">
5767N/A <sequence>
5767N/A
5767N/A <script>
5767N/A id = 1000 + loop
5767N/A userDn = 'uid=user.%s,o=snmp tests,dc=example,dc=com' % id
5767N/A </script>
5767N/A
5767N/A <message>
5767N/A 'LOOP %s: %s' % (loop, userDn)
5767N/A </message>
5767N/A
5767N/A <call function="'ldapDeleteWithScript'">
5767N/A {
5767N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5767N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5767N/A 'dsDn' : ['%s' % userDn]
5767N/A }
5767N/A </call>
5767N/A
5767N/A </sequence>
5767N/A </loop>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Increment the SNMP values' }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A indexLDAP = global_indexLDAP.get()
5767N/A key = 'dsApplIfReadOps.%s' % indexLDAP
5767N/A DEFAULT_VALUES = global_DEFAULT_VALUES.get()
5767N/A DEFAULT_VALUES[key] = \
5767N/A str(int(DEFAULT_VALUES[key]) + nbLoop)
5767N/A key = 'dsApplIfRemoveEntryOps.%s' % indexLDAP
5767N/A DEFAULT_VALUES[key] = \
5767N/A str(int(DEFAULT_VALUES[key]) + nbLoop)
5767N/A DEFAULT_VALUES['dsMasterEntries.1'] = \
5767N/A str(int(DEFAULT_VALUES['dsMasterEntries.1']) - nbLoop)
5767N/A </script>
6036N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Check value of dsApplIfRemoveEntryOps entry' }
5767N/A </call>
5767N/A
5767N/A <call function="'compareSNMPValues'">
5767N/A {
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpCommunity' : community ,
6132N/A 'index' : indexLDAP
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Save the SNMP values' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '1',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpCommunity' : community ,
5767N/A 'snmpOIDs' : '' ,
5767N/A 'snmpStatus' : 'noError' ,
5767N/A 'snmpWalk' : 'True'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A DEFAULT_VALUES = {}
5767N/A global_DEFAULT_VALUES.set({})
5767N/A DEFAULT_VALUES = create_table_fromoutput(STAXResult[0][1])
5767N/A global_DEFAULT_VALUES.set(DEFAULT_VALUES)
5767N/A </script>
5767N/A
5767N/A </sequence>
5767N/A
5767N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5767N/A <message log="1" level="'fatal'">
5767N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5767N/A </message>
5767N/A </catch>
5767N/A <finally>
5767N/A <sequence>
5767N/A <call function="'testCase_Postamble'"/>
5767N/A </sequence>
5767N/A </finally>
5767N/A </try>
5767N/A </sequence>
5767N/A </testcase>
5767N/A </function>
5767N/A
5767N/A <!--- Test Case information
5767N/A #@TestMarker SNMP MIB values
5767N/A #@TestName snmp_mibvalues: TODO
6132N/A #@TestIssue none
5767N/A #@TestPurpose TODO.
5767N/A #@TestPreamble none
5767N/A #@TestStep TODO.
5767N/A #@TestPostamble none
5767N/A #@TestResult TODO.
5767N/A -->
5767N/A <function name="snmp_basic_008" scope="local">
5767N/A <testcase name="getTestCaseName('Check value of dsApplIfCompareOps entry')">
5767N/A <sequence>
5767N/A <try>
5767N/A
5767N/A <sequence>
5767N/A
5767N/A <call function="'testCase_Preamble'"/>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Perform %s compare operations' % nbLoop }
5767N/A </call>
5767N/A
5767N/A <loop var="loop" from="1" to="nbLoop">
5767N/A <sequence>
5767N/A
5767N/A <script>
5767N/A id = 0 + loop
5767N/A userDn = 'uid=user.%s,o=snmp tests,dc=example,dc=com' % id
5767N/A </script>
5767N/A
5767N/A <message>
5767N/A 'LOOP %s: %s' % (loop, userDn)
5767N/A </message>
5767N/A
5767N/A <call function="'ldapCompareWithScript'">
5767N/A {
5767N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5767N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5767N/A 'dsDn' : ['postalCode:64447', '%s' % userDn] ,
5767N/A 'expectedRC' : 'noCheck'
5767N/A }
5767N/A </call>
5767N/A
5767N/A </sequence>
5767N/A </loop>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Increment the SNMP values' }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A indexLDAP = global_indexLDAP.get()
5767N/A key = 'dsApplIfReadOps.%s' % indexLDAP
5767N/A DEFAULT_VALUES = global_DEFAULT_VALUES.get()
5767N/A DEFAULT_VALUES[key] = \
5767N/A str(int(DEFAULT_VALUES[key]) + nbLoop)
5767N/A key = 'dsApplIfCompareOps.%s' % indexLDAP
5767N/A DEFAULT_VALUES[key] = \
5767N/A str(int(DEFAULT_VALUES[key]) + nbLoop)
5767N/A </script>
6036N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Check value of dsApplIfCompareOps entry' }
5767N/A </call>
5767N/A
5767N/A <call function="'compareSNMPValues'">
5767N/A {
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpCommunity' : community ,
6132N/A 'index' : indexLDAP
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Save the SNMP values' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '1',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpCommunity' : community ,
5767N/A 'snmpOIDs' : '' ,
5767N/A 'snmpStatus' : 'noError' ,
5767N/A 'snmpWalk' : 'True'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A DEFAULT_VALUES = {}
5767N/A global_DEFAULT_VALUES.set({})
5767N/A DEFAULT_VALUES = create_table_fromoutput(STAXResult[0][1])
5767N/A global_DEFAULT_VALUES.set(DEFAULT_VALUES)
5767N/A </script>
5767N/A
5767N/A </sequence>
5767N/A
5767N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5767N/A <message log="1" level="'fatal'">
5767N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5767N/A </message>
5767N/A </catch>
5767N/A <finally>
5767N/A <sequence>
5767N/A <call function="'testCase_Postamble'"/>
5767N/A </sequence>
5767N/A </finally>
5767N/A </try>
5767N/A </sequence>
5767N/A </testcase>
5767N/A </function>
5767N/A
5767N/A <!--- Test Case information
5767N/A #@TestMarker SNMP MIB values
5767N/A #@TestName snmp_mibvalues: TODO
6132N/A #@TestIssue none
5767N/A #@TestPurpose TODO.
5767N/A #@TestPreamble none
5767N/A #@TestStep TODO.
5767N/A #@TestPostamble none
5767N/A #@TestResult TODO.
5767N/A -->
5767N/A <function name="snmp_basic_009" scope="local">
5767N/A <testcase name="getTestCaseName('Check value of dsApplIfModifyEntryOps entry')">
5767N/A <sequence>
5767N/A <try>
5767N/A
5767N/A <sequence>
5767N/A
5767N/A <call function="'testCase_Preamble'"/>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Perform %s modify operations' % nbLoop }
5767N/A </call>
5767N/A
5767N/A <loop var="loop" from="1" to="nbLoop">
5767N/A <sequence>
5767N/A
5767N/A <script>
5767N/A id = 400 + loop
5767N/A userDn = 'uid=user.%s,o=snmp tests,dc=example,dc=com' % id
5767N/A </script>
5767N/A
5767N/A <message>
5767N/A 'LOOP %s: %s' % (loop, userDn)
5767N/A </message>
5767N/A
5767N/A <call function="'modifyAnAttribute'">
5767N/A {
5767N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5767N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5767N/A 'DNToModify' : userDn ,
5767N/A 'attributeName' : 'postalCode' ,
5767N/A 'newAttributeValue' : '%s' % id ,
5767N/A 'changetype' : 'replace'
5767N/A }
5767N/A </call>
5767N/A
5767N/A </sequence>
5767N/A </loop>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Increment the SNMP values' }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A indexLDAP = global_indexLDAP.get()
5767N/A key = 'dsApplIfReadOps.%s' % indexLDAP
5767N/A DEFAULT_VALUES = global_DEFAULT_VALUES.get()
5767N/A DEFAULT_VALUES[key] = \
5767N/A str(int(DEFAULT_VALUES[key]) + nbLoop)
5767N/A key = 'dsApplIfModifyEntryOps.%s' % indexLDAP
5767N/A DEFAULT_VALUES[key] = \
5767N/A str(int(DEFAULT_VALUES[key]) + nbLoop)
5767N/A </script>
6036N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Check value of dsApplIfModifyEntryOps entry' }
5767N/A </call>
5767N/A
5767N/A <call function="'compareSNMPValues'">
5767N/A {
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpCommunity' : community ,
6132N/A 'index' : indexLDAP
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Save the SNMP values' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '1',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpCommunity' : community ,
5767N/A 'snmpOIDs' : '' ,
5767N/A 'snmpStatus' : 'noError' ,
5767N/A 'snmpWalk' : 'True'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A DEFAULT_VALUES = {}
5767N/A global_DEFAULT_VALUES.set({})
5767N/A DEFAULT_VALUES = create_table_fromoutput(STAXResult[0][1])
5767N/A global_DEFAULT_VALUES.set(DEFAULT_VALUES)
5767N/A </script>
5767N/A
5767N/A </sequence>
5767N/A
5767N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5767N/A <message log="1" level="'fatal'">
5767N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5767N/A </message>
5767N/A </catch>
5767N/A <finally>
5767N/A <sequence>
5767N/A <call function="'testCase_Postamble'"/>
5767N/A </sequence>
5767N/A </finally>
5767N/A </try>
5767N/A </sequence>
5767N/A </testcase>
5767N/A </function>
5767N/A
5767N/A <!--- Test Case information
5767N/A #@TestMarker SNMP MIB values
5767N/A #@TestName snmp_mibvalues: TODO
6132N/A #@TestIssue none
5767N/A #@TestPurpose TODO.
5767N/A #@TestPreamble none
5767N/A #@TestStep TODO.
5767N/A #@TestPostamble none
5767N/A #@TestResult TODO.
5767N/A -->
5767N/A <function name="snmp_basic_010" scope="local">
5767N/A <testcase name="getTestCaseName('Check value of dsApplIfModifyRDNOps entry')">
5767N/A <sequence>
5767N/A <try>
5767N/A
5767N/A <sequence>
5767N/A
5767N/A <call function="'testCase_Preamble'"/>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Perform %s modify RDN operations' % nbLoop }
5767N/A </call>
5767N/A
5767N/A <loop var="loop" from="1" to="nbLoop">
5767N/A <sequence>
5767N/A
5767N/A <!--- Create a ldif file for moddn -->
5767N/A <script>
5767N/A id = 800 + loop
5767N/A userDn = 'uid=user.%s,o=snmp tests,dc=example,dc=com' % id
5767N/A newid = 2000 + loop
5767N/A newDn = 'uid=user.%s' % newid
5767N/A
5767N/A templateFile = 'template-%s.ldif' % loop
5767N/A templatePath = '%s/%s' % (remote.temp, templateFile)
5767N/A ldifFile = 'moddn-%s.ldif' % loop
5767N/A ldifPath = '%s/%s' % (DIRECTORY_INSTANCE_DIR, ldifFile)
5767N/A ldifLines = []
5767N/A ldifLines.append('dn: %s' % userDn)
5767N/A ldifLines.append('changetype: moddn')
5767N/A ldifLines.append('newRDN: %s' % newDn)
5767N/A ldifLines.append('deleteOldRDN: 1')
5767N/A outFile = open(templatePath, "w")
5767N/A for line in ldifLines:
5767N/A outFile.write("%s\n" % line)
5767N/A outFile.close()
5767N/A </script>
5767N/A
5767N/A <message>
5767N/A 'LOOP %s: %s => %s' % (loop, userDn, newDn)
5767N/A </message>
5767N/A
5767N/A <!--- Copy file to remote host -->
5767N/A <message>
5767N/A 'Copy %s to %s on %s' \
5767N/A % (templateFile,DIRECTORY_INSTANCE_DIR,STAF_REMOTE_HOSTNAME)
5767N/A </message>
5767N/A <call function="'copyFile'">
5767N/A {
5767N/A 'srcfile' : templatePath ,
5767N/A 'destfile' : ldifPath ,
5767N/A 'remotehost' : STAF_REMOTE_HOSTNAME
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'ldapModifyWithScript'">
5767N/A {
5767N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
5767N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5767N/A 'dsFilename' : ldifPath
5767N/A }
5767N/A </call>
5767N/A
5767N/A <!--- Delete the ldif file used for moddn on remote host -->
5767N/A <message>
5767N/A 'Delete %s on %s' % (ldifPath, STAF_REMOTE_HOSTNAME)
5767N/A </message>
5767N/A <call function="'deleteFile'">
5767N/A {
5767N/A 'location' : STAF_REMOTE_HOSTNAME ,
5767N/A 'filename' : ldifPath
5767N/A }
5767N/A </call>
5767N/A
5767N/A <!--- Delete locally the ldif file used for moddn -->
5767N/A <message>
5767N/A 'Delete locally %s' % templatePath
5767N/A </message>
5767N/A <call function="'deleteFile'">
5767N/A {
5767N/A 'location' : STAXServiceMachine ,
5767N/A 'filename' : templatePath
5767N/A }
5767N/A </call>
5767N/A </sequence>
5767N/A </loop>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Increment the SNMP values' }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A indexLDAP = global_indexLDAP.get()
5767N/A key = 'dsApplIfReadOps.%s' % indexLDAP
5767N/A DEFAULT_VALUES = global_DEFAULT_VALUES.get()
5767N/A DEFAULT_VALUES[key] = \
5767N/A str(int(DEFAULT_VALUES[key]) + nbLoop)
5767N/A key = 'dsApplIfModifyRDNOps.%s' % indexLDAP
5767N/A DEFAULT_VALUES[key] = \
5767N/A str(int(DEFAULT_VALUES[key]) + nbLoop)
5767N/A </script>
6036N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Check value of dsApplIfModifyRDNOps entry' }
5767N/A </call>
5767N/A
5767N/A <call function="'compareSNMPValues'">
5767N/A {
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpCommunity' : community ,
6132N/A 'index' : indexLDAP
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Save the SNMP values' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '1',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpCommunity' : community ,
5767N/A 'snmpOIDs' : '' ,
5767N/A 'snmpStatus' : 'noError' ,
5767N/A 'snmpWalk' : 'True'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A DEFAULT_VALUES = {}
5767N/A global_DEFAULT_VALUES.set({})
5767N/A DEFAULT_VALUES = create_table_fromoutput(STAXResult[0][1])
5767N/A global_DEFAULT_VALUES.set(DEFAULT_VALUES)
5767N/A </script>
5767N/A
5767N/A </sequence>
5767N/A
5767N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5767N/A <message log="1" level="'fatal'">
5767N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5767N/A </message>
5767N/A </catch>
5767N/A <finally>
5767N/A <sequence>
5767N/A <call function="'testCase_Postamble'"/>
5767N/A </sequence>
5767N/A </finally>
5767N/A </try>
5767N/A </sequence>
5767N/A </testcase>
5767N/A </function>
5767N/A
5767N/A <!--- Test Case information
5767N/A #@TestMarker SNMP Connection Handler register mbean
5767N/A #@TestName registermbean: TODO
5767N/A #@TestIssue none
5767N/A #@TestPurpose TODO.
5767N/A #@TestPreamble none
5767N/A #@TestStep TODO.
5767N/A #@TestPostamble none
5767N/A #@TestResult TODO.
5767N/A -->
5767N/A <function name="snmp_basic_011" scope="local">
5767N/A <testcase name="getTestCaseName('Check that there is no error at startup')">
5767N/A <sequence>
5767N/A <try>
5767N/A
5767N/A <sequence>
5767N/A
5767N/A <call function="'testCase_Preamble'"/>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Set the register-mbean property to true' }
5767N/A </call>
5767N/A
5767N/A <call function="'dsconfig'">
5767N/A {
5767N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5767N/A 'subcommand' : 'set-connection-handler-prop' ,
5767N/A 'objectType' : 'handler-name' ,
5767N/A 'objectName' : 'SNMP Connection Handler' ,
5767N/A 'optionsString' : '--set registered-mbean:true'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <message>
5767N/A 'status: restart DS running on port %s' \
5767N/A % (DIRECTORY_INSTANCE_PORT)
5767N/A </message>
5767N/A <call function="'StopDsWithScript'">
5767N/A {
5767N/A 'location' : STAF_REMOTE_HOSTNAME ,
5767N/A 'dsHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
5767N/A 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
5767N/A }
5767N/A </call>
5767N/A <call function="'StartDsWithScript'">
5767N/A { 'location' : STAF_REMOTE_HOSTNAME }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A returnString = STAXResult[0][1]
5767N/A </script>
5767N/A
5767N/A <!--- Check that DS started -->
5767N/A <call function="'isAlive'">
5767N/A {
5767N/A 'noOfLoops' : 10 ,
5767N/A 'noOfMilliSeconds' : 2000
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'checktestStringNotPresent'">
5767N/A {
5767N/A 'returnString' : returnString ,
5767N/A 'testString' : 'category=PROTOCOL severity=SEVERE_ERROR'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get to check the SNMPConnection Handler' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '1',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpCommunity' : defCommunity ,
5767N/A 'snmpOIDs' : oid ,
5767N/A 'snmpStatus' : 'noError'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Restore the register-mbean property' }
5767N/A </call>
5767N/A
5767N/A <call function="'dsconfig'">
5767N/A {
5767N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5767N/A 'subcommand' : 'set-connection-handler-prop' ,
5767N/A 'objectType' : 'handler-name' ,
5767N/A 'objectName' : 'SNMP Connection Handler' ,
5767N/A 'optionsString' : '--set registered-mbean:%s' \
5767N/A % refRegisteredMbeanProp
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Restart the SNMP Connection Handler' }
5767N/A </call>
5767N/A
5767N/A <call function="'restartSNMPConnectionHandler'">
5767N/A {
5767N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
5767N/A }
5767N/A </call>
5767N/A
5767N/A </sequence>
5767N/A
5767N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5767N/A <message log="1" level="'fatal'">
5767N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5767N/A </message>
5767N/A </catch>
5767N/A <finally>
5767N/A <sequence>
5767N/A <call function="'testCase_Postamble'"/>
5767N/A </sequence>
5767N/A </finally>
5767N/A </try>
5767N/A </sequence>
5767N/A </testcase>
5767N/A </function>
5767N/A
5767N/A <!--- Test Case information
5767N/A #@TestMarker SNMP Connection Handler register mbean
5767N/A #@TestName registermbean: TODO
5767N/A #@TestIssue none
5767N/A #@TestPurpose TODO.
5767N/A #@TestPreamble none
5767N/A #@TestStep TODO.
5767N/A #@TestPostamble none
5767N/A #@TestResult TODO.
5767N/A -->
5767N/A <function name="snmp_basic_012" scope="local">
5767N/A <testcase name="getTestCaseName('Set the register-mbean property to a wrong value')">
5767N/A <sequence>
5767N/A <try>
5767N/A
5767N/A <sequence>
5767N/A
5767N/A <call function="'testCase_Preamble'"/>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Set register-mbean property to a wrong value' }
5767N/A </call>
5767N/A
5767N/A <call function="'dsconfig'">
5767N/A {
5767N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5767N/A 'subcommand' : 'set-connection-handler-prop' ,
5767N/A 'objectType' : 'handler-name' ,
5767N/A 'objectName' : 'SNMP Connection Handler' ,
5767N/A 'optionsString' : '--set registered-mbean:myValue' ,
5767N/A 'expectedRC' : 1
5767N/A }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A returnString = STAXResult[0][1]
5767N/A msg1 = 'The value "myValue" is not a valid value for the'
5767N/A msg2 = 'SNMP Connection Handler\nproperty "registered-mbean"'
5767N/A msg3 = 'which has the following syntax: false | true'
5767N/A msg = '%s %s %s' % (msg1, msg2, msg3)
5767N/A </script>
5767N/A
5767N/A <call function="'checktestString'">
5767N/A {
5767N/A 'returnString' : returnString ,
5767N/A 'expectedString' : msg
5767N/A }
5767N/A </call>
5767N/A </sequence>
5767N/A
5767N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5767N/A <message log="1" level="'fatal'">
5767N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5767N/A </message>
5767N/A </catch>
5767N/A <finally>
5767N/A <sequence>
5767N/A <call function="'testCase_Postamble'"/>
5767N/A </sequence>
5767N/A </finally>
5767N/A </try>
5767N/A </sequence>
5767N/A </testcase>
5767N/A </function>
5767N/A
5767N/A <!--- Test Case information
5767N/A #@TestMarker SNMP Connection Handler status
5767N/A #@TestName status: check status when the server is
5767N/A stopped/started
5767N/A #@TestIssue none
5767N/A #@TestPurpose Check status when the server is
5767N/A stopped/started.
5767N/A #@TestPreamble none
5767N/A #@TestStep stop the server
5767N/A #@TestStep check status using status command
5767N/A #@TestStep start the server
5767N/A #@TestStep check status using status command
5767N/A #@TestStep do a SNMP get request to check that the
5767N/A connection handler
5767N/A #@TestPostamble none
5767N/A #@TestResult Success if output of status is correct.
5767N/A -->
5767N/A <function name="snmp_basic_013" scope="local">
5767N/A <testcase name="getTestCaseName('Status when the server is stopped/started')">
5767N/A <sequence>
5767N/A <try>
5767N/A
5767N/A <sequence>
5767N/A
5767N/A <call function="'testCase_Preamble'"/>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'stop DS running on port %s' % (DIRECTORY_INSTANCE_PORT) }
5767N/A </call>
5767N/A
5767N/A <call function="'StopDsWithScript'">
5767N/A {
5767N/A 'location' : STAF_REMOTE_HOSTNAME ,
5767N/A 'dsHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
5767N/A 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get status when the server is stopped' }
5767N/A </call>
5767N/A
5767N/A <call function="'StatusWithScript'">
5767N/A {
5767N/A 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
5767N/A }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A returnString = STAXResult[0][1]
5767N/A </script>
5767N/A
5767N/A <call function="'searchString'">
5767N/A {
6142N/A 'expectedString' : '0.0.0.0:%s\\s+:\\s+SNMP\\s+:\\s+Enabled' \
5767N/A % SNMP_PORT ,
5767N/A 'returnString' : returnString ,
5767N/A 'expectedRC' : 0
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Start DS to run on port %s' % (DIRECTORY_INSTANCE_PORT) }
5767N/A </call>
5767N/A
5767N/A <call function="'StartDsWithScript'">
5767N/A { 'location' : STAF_REMOTE_HOSTNAME }
5767N/A </call>
5767N/A <!--- Check that DS started -->
5767N/A <call function="'isAlive'">
5767N/A {
5767N/A 'noOfLoops' : 10 ,
5767N/A 'noOfMilliSeconds' : 2000
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get status when the server is started' }
5767N/A </call>
5767N/A
5767N/A <call function="'StatusWithScript'">
5767N/A {
5767N/A 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
5767N/A }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A returnString = STAXResult[0][1]
5767N/A </script>
5767N/A
5767N/A <call function="'searchString'">
5767N/A {
6142N/A 'expectedString' : '0.0.0.0:%s\\s+:\\s+SNMP\\s+:\\s+Enabled' \
5767N/A % SNMP_PORT ,
5767N/A 'returnString' : returnString ,
5767N/A 'expectedRC' : 0
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Send SNMP Get request' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '1',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpCommunity' : community ,
5767N/A 'snmpOIDs' : oid ,
5767N/A 'snmpStatus' : 'noError'
5767N/A }
5767N/A </call>
5767N/A
5767N/A </sequence>
5767N/A
5767N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5767N/A <message log="1" level="'fatal'">
5767N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5767N/A </message>
5767N/A </catch>
5767N/A <finally>
5767N/A <sequence>
5767N/A <call function="'testCase_Postamble'"/>
5767N/A </sequence>
5767N/A </finally>
5767N/A </try>
5767N/A </sequence>
5767N/A </testcase>
5767N/A </function>
5767N/A
5767N/A <!--- Test Case information
5767N/A #@TestMarker SNMP Connection Handler status
5767N/A #@TestName status: check status when the connection
5767N/A handler is disabled/enabled
5767N/A #@TestIssue none
5767N/A #@TestPurpose Check status when the SNMP connection handler
5767N/A is disabled/enabled.
5767N/A #@TestPreamble none
5767N/A #@TestStep disable the SNMP connection handler
5767N/A #@TestStep check status using status command
5767N/A #@TestStep enable the SNMP connection handler
5767N/A #@TestStep check status using status command
5767N/A #@TestPostamble none
5767N/A #@TestResult Success if output of status is correct.
5767N/A -->
5767N/A <function name="snmp_basic_014" scope="local">
5767N/A <testcase name="getTestCaseName('Status when SNMP Connection Handler is disabled/enabled')">
5767N/A <sequence>
5767N/A <try>
5767N/A
5767N/A <sequence>
5767N/A
5767N/A <call function="'testCase_Preamble'"/>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Disable the SNMP Connection Handler' }
5767N/A </call>
5767N/A
5767N/A <call function="'dsconfig'">
5767N/A {
5767N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5767N/A 'subcommand' : 'set-connection-handler-prop' ,
5767N/A 'objectType' : 'handler-name' ,
5767N/A 'objectName' : 'SNMP Connection Handler' ,
5767N/A 'optionsString' : '--set enabled:false'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get status when the SNMP connection handler is disabled' }
5767N/A </call>
5767N/A
5767N/A <call function="'StatusWithScript'">
5767N/A {
5767N/A 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
5767N/A }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A returnString = STAXResult[0][1]
5767N/A </script>
5767N/A
5767N/A <call function="'searchString'">
5767N/A {
6142N/A 'expectedString' : '0.0.0.0:%s\\s+:\\s+SNMP\\s+:\\s+Disabled' \
5767N/A % SNMP_PORT ,
5767N/A 'returnString' : returnString ,
5767N/A 'expectedRC' : 0
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Send SNMP Get request' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '1',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpCommunity' : community ,
5767N/A 'snmpOIDs' : oid ,
5767N/A 'snmpStatus' : 'reqTimeout'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Enable the SNMP Connection Handler' }
5767N/A </call>
5767N/A
5767N/A <call function="'dsconfig'">
5767N/A {
5767N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5767N/A 'subcommand' : 'set-connection-handler-prop' ,
5767N/A 'objectType' : 'handler-name' ,
5767N/A 'objectName' : 'SNMP Connection Handler' ,
5767N/A 'optionsString' : '--set enabled:true'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get status when the SNMP connection handler is enabled' }
5767N/A </call>
5767N/A
5767N/A <call function="'StatusWithScript'">
5767N/A {
5767N/A 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
5767N/A }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A returnString = STAXResult[0][1]
5767N/A </script>
5767N/A
5767N/A <call function="'searchString'">
5767N/A {
6142N/A 'expectedString' : '0.0.0.0:%s\\s+:\\s+SNMP\\s+:\\s+Enabled' \
5767N/A % SNMP_PORT ,
5767N/A 'returnString' : returnString ,
5767N/A 'expectedRC' : 0
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Send SNMP Get request' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '1',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpCommunity' : community ,
5767N/A 'snmpOIDs' : oid ,
5767N/A 'snmpStatus' : 'noError'
5767N/A }
5767N/A </call>
5767N/A
5767N/A </sequence>
5767N/A
5767N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5767N/A <message log="1" level="'fatal'">
5767N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5767N/A </message>
5767N/A </catch>
5767N/A <finally>
5767N/A <sequence>
5767N/A <call function="'testCase_Postamble'"/>
5767N/A </sequence>
5767N/A </finally>
5767N/A </try>
5767N/A </sequence>
5767N/A </testcase>
5767N/A </function>
5767N/A
5767N/A <!--- Test Case information
5767N/A #@TestMarker SNMP Connection Handler status
5767N/A #@TestName status: check error message and status when
5767N/A the opendmk-jarfile property is set to a
5767N/A wrong value
6132N/A #@TestIssue none
5767N/A #@TestPurpose Check error message and status when
5767N/A the opendmk-jarfile property is set to a
5767N/A wrong value.
5767N/A #@TestPreamble none
5767N/A #@TestStep set opendmk-jarfile property to a wrong value
5767N/A #@TestStep restart the server
5767N/A #@TestStep check that an error message is displayed at
5767N/A startup
5767N/A #@TestStep check status using status command
5767N/A #@TestStep restore value for opendmk-jarfile property
5767N/A #@TestStep disable the SNMP connection handler
5767N/A #@TestStep enable the SNMP connection handler
5767N/A #@TestPostamble none
5767N/A #@TestResult Success if an error message is displayed and
5767N/A if the output of status is correct.
5767N/A -->
5767N/A <function name="snmp_basic_015" scope="local">
5767N/A <testcase name="getTestCaseName('Status with a wrong opendmk-jarfile value')">
5767N/A <sequence>
5767N/A <try>
5767N/A
5767N/A <sequence>
5767N/A
5767N/A <call function="'testCase_Preamble'"/>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Set opendmk-jarfile property to a wrong value' }
5767N/A </call>
5767N/A
5767N/A <call function="'dsconfig'">
5767N/A {
5767N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5767N/A 'subcommand' : 'set-connection-handler-prop' ,
5767N/A 'objectType' : 'handler-name' ,
5767N/A 'objectName' : 'SNMP Connection Handler' ,
5767N/A 'optionsString' : '--set opendmk-jarfile:wrong_file'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Restart DS running on port %s' % (DIRECTORY_INSTANCE_PORT) }
5767N/A </call>
5767N/A
5767N/A <call function="'StopDsWithScript'">
5767N/A {
5767N/A 'location' : STAF_REMOTE_HOSTNAME ,
5767N/A 'dsHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
5767N/A 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'StartDsWithScript'">
5767N/A { 'location' : STAF_REMOTE_HOSTNAME }
5767N/A </call>
5767N/A
5767N/A <!--- Check that DS started -->
5767N/A <call function="'isAlive'">
5767N/A {
5767N/A 'noOfLoops' : 10 ,
5767N/A 'noOfMilliSeconds' : 2000
5767N/A }
5767N/A </call>
5767N/A
6297N/A <!-- Run this check only on Unix.
6297N/A Difficult to check that on Windows due to '\' characters -->
6297N/A <if expr="not is_windows_platform(STAF_REMOTE_HOSTNAME)">
6297N/A <!-- Unix -->
6297N/A <sequence>
6297N/A <script>
6297N/A opendmkJarFile = '%s/%s/wrong_file' \
6297N/A % (DIRECTORY_INSTANCE_DIR, OPENDSNAME)
6297N/A if is_windows_platform(DIRECTORY_INSTANCE_HOST):
6297N/A opendmkJarFile = opendmkJarFile.replace('/', '\\')
6297N/A
6297N/A msg1 = 'The specified OpenDMK jar file'
6297N/A msg2 = '\'%s\' could not be found.' % opendmkJarFile
6297N/A msg = '%s %s' % (msg1, msg2)
6297N/A </script>
6297N/A
6297N/A <call function="'grep'">
6297N/A {
6297N/A 'location' : STAF_REMOTE_HOSTNAME ,
6297N/A 'filename' : serverLogFile ,
6297N/A 'testString': msg
6297N/A }
6297N/A </call>
6297N/A </sequence>
6297N/A </if>
6289N/A
6289N/A <script>
6289N/A msg1 = 'Verify that the value set in the opendmk-jarfile'
6289N/A msg2 = 'configuration parameter of the SNMP connection handler'
6289N/A msg3 = 'is the valid path to the jdmkrt.jar file and that the'
6289N/A msg4 = 'file is accessible'
6289N/A msg = '%s %s %s %s' % (msg1, msg2, msg3, msg4)
6289N/A </script>
6289N/A
6289N/A <call function="'grep'">
6289N/A {
6289N/A 'location' : STAF_REMOTE_HOSTNAME ,
6289N/A 'filename' : serverLogFile ,
6289N/A 'testString': msg
6289N/A }
6289N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get status when the server is started' }
5767N/A </call>
5767N/A
5767N/A <call function="'StatusWithScript'">
5767N/A {
5767N/A 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
5767N/A }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A returnString = STAXResult[0][1]
5767N/A </script>
5767N/A
5767N/A <call function="'searchString'">
5767N/A {
6142N/A 'expectedString' : '0.0.0.0:%s\\s+:\\s+SNMP\\s+:\\s+Enabled' \
5767N/A % SNMP_PORT ,
5767N/A 'returnString' : returnString ,
5767N/A 'expectedRC' : 0
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Send SNMP Get request' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '1',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpCommunity' : community ,
5767N/A 'snmpOIDs' : oid ,
5767N/A 'snmpStatus' : 'reqTimeout'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Restore value for opendmk-jarfile property' }
5767N/A </call>
5767N/A
5767N/A <call function="'dsconfig'">
5767N/A {
5767N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5767N/A 'subcommand' : 'set-connection-handler-prop' ,
5767N/A 'objectType' : 'handler-name' ,
5767N/A 'objectName' : 'SNMP Connection Handler' ,
5767N/A 'optionsString' : '--set opendmk-jarfile:%s' \
5767N/A % SNMP_PROPERTIES['opendmk-jarfile']
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Restart the SNMP Connection Handler' }
5767N/A </call>
5767N/A
5767N/A <call function="'restartSNMPConnectionHandler'">
5767N/A {
5767N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
5767N/A }
5767N/A </call>
5767N/A
5767N/A </sequence>
5767N/A
5767N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5767N/A <message log="1" level="'fatal'">
5767N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5767N/A </message>
5767N/A </catch>
5767N/A <finally>
5767N/A <sequence>
5767N/A <call function="'testCase_Postamble'"/>
5767N/A </sequence>
5767N/A </finally>
5767N/A </try>
5767N/A </sequence>
5767N/A </testcase>
5767N/A </function>
5767N/A
5767N/A <!--- Test Case information
5767N/A #@TestMarker SNMP Connection Handler status
5767N/A #@TestName status: check error message and status when
5767N/A the security-agent-file property is set to a
5767N/A wrong value
5767N/A #@TestIssue none
5767N/A #@TestPurpose Check error message and status when
5767N/A the security-agent-file property is set to a
5767N/A wrong value.
5767N/A #@TestPreamble none
5767N/A #@TestStep set security-agent-file property to a wrong
5767N/A value
5767N/A #@TestStep restart the server
5767N/A #@TestStep check that an error message is displayed at
5767N/A startup
5767N/A #@TestStep check status using status command
5767N/A #@TestStep restore value for security-agent-file property
5767N/A #@TestStep disable the SNMP connection handler
5767N/A #@TestStep enable the SNMP connection handler
5767N/A #@TestPostamble none
5767N/A #@TestResult Success if an error message is displayed and
5767N/A if the output of status is correct.
5767N/A -->
5767N/A <function name="snmp_basic_016" scope="local">
5767N/A <testcase name="getTestCaseName('Status with a wrong security-agent-file value')">
5767N/A <sequence>
5767N/A <try>
5767N/A
5767N/A <sequence>
5767N/A
5767N/A <call function="'testCase_Preamble'"/>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Set the security-agent-file to a wrong value' }
5767N/A </call>
5767N/A
5767N/A <call function="'dsconfig'">
5767N/A {
5767N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5767N/A 'subcommand' : 'set-connection-handler-prop' ,
5767N/A 'objectType' : 'handler-name' ,
5767N/A 'objectName' : 'SNMP Connection Handler' ,
5767N/A 'optionsString' : '--set security-agent-file:wrong_file'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Restart DS running on port %s' % (DIRECTORY_INSTANCE_PORT) }
5767N/A </call>
5767N/A
5767N/A <call function="'StopDsWithScript'">
5767N/A {
5767N/A 'location' : STAF_REMOTE_HOSTNAME ,
5767N/A 'dsHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
5767N/A 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'StartDsWithScript'">
5767N/A { 'location' : STAF_REMOTE_HOSTNAME }
5767N/A </call>
5767N/A
5767N/A <!--- Check that DS started -->
5767N/A <call function="'isAlive'">
5767N/A {
5767N/A 'noOfLoops' : 10 ,
5767N/A 'noOfMilliSeconds' : 2000
5767N/A }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A msg1 = 'Cannot initialize the SNMP Connection Handler.'
5767N/A msg2 = 'Please check the configuration attributes'
5767N/A msg = '%s %s' % (msg1, msg2)
5767N/A </script>
5767N/A
5767N/A <call function="'grep'">
5767N/A {
5767N/A 'location' : STAF_REMOTE_HOSTNAME ,
5767N/A 'filename' : serverLogFile ,
5767N/A 'testString': msg
5767N/A }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A msg1 = 'You do not have the appropriated OpenDMK jar files to'
5767N/A msg2 = 'enable the SNMP Connection Handler. Please go under'
5767N/A msg3 = 'http:\/\/opendmk.dev.java.net and set the'
5767N/A msg4 = 'ds-cfg-opendmk-jarfile configuration parameter to set'
5767N/A msg5 = 'the full path of the required jdmkrt.jar file.'
5767N/A msg6 = 'The SNMP connection Handler didn\'t started'
5767N/A msg = '%s %s %s %s %s %s' % (msg1, msg2, msg3, msg4, msg5, msg6)
5767N/A </script>
5767N/A
5767N/A <call function="'grep'">
5767N/A {
5767N/A 'location' : STAF_REMOTE_HOSTNAME ,
5767N/A 'filename' : serverLogFile ,
5767N/A 'testString' : msg ,
5767N/A 'expectedRC' : 1
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get status when the server is started' }
5767N/A </call>
5767N/A
5767N/A <call function="'StatusWithScript'">
5767N/A {
5767N/A 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
5767N/A }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A returnString = STAXResult[0][1]
5767N/A </script>
5767N/A
5767N/A <call function="'searchString'">
5767N/A {
6142N/A 'expectedString' : '0.0.0.0:%s\\s+:\\s+SNMP\\s+:\\s+Enabled' \
5767N/A % SNMP_PORT ,
5767N/A 'returnString' : returnString ,
5767N/A 'expectedRC' : 0
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Send SNMP Get request' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '1',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpCommunity' : community ,
5767N/A 'snmpOIDs' : oid ,
5767N/A 'snmpStatus' : 'reqTimeout'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Restore value for security-agent-file property' }
5767N/A </call>
5767N/A
5767N/A <call function="'dsconfig'">
5767N/A {
5767N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5767N/A 'subcommand' : 'set-connection-handler-prop' ,
5767N/A 'objectType' : 'handler-name' ,
5767N/A 'objectName' : 'SNMP Connection Handler' ,
5767N/A 'optionsString' : '--set security-agent-file:%s' \
5767N/A % SNMP_PROPERTIES['security-agent-file']
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Restart the SNMP Connection Handler' }
5767N/A </call>
5767N/A
5767N/A <call function="'restartSNMPConnectionHandler'">
5767N/A {
5767N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
5767N/A }
5767N/A </call>
5767N/A
5767N/A </sequence>
5767N/A
5767N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5767N/A <message log="1" level="'fatal'">
5767N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5767N/A </message>
5767N/A </catch>
5767N/A <finally>
5767N/A <sequence>
5767N/A <call function="'testCase_Postamble'"/>
5767N/A </sequence>
5767N/A </finally>
5767N/A </try>
5767N/A </sequence>
5767N/A </testcase>
5767N/A </function>
5767N/A
5767N/A <!-- Test Case information
5767N/A #@TestMarker SNMP Connection Handler status
5767N/A #@TestName status: check error message and status when
5767N/A the listen-port property is set to a wrong
5767N/A value
5767N/A #@TestIssue none
5767N/A #@TestPurpose Check error message and status when
5767N/A the listen-port property is set to a wrong
5767N/A value.
5767N/A #@TestPreamble none
5767N/A #@TestStep set listen-port property to a wrong value
5767N/A #@TestStep restart the server
5767N/A #@TestStep check that an error message is displayed at
5767N/A startup
5767N/A #@TestStep check status using status command
5767N/A #@TestStep restore value for listen-port property
5767N/A #@TestStep disable the SNMP connection handler
5767N/A #@TestStep enable the SNMP connection handler
5767N/A #@TestPostamble none
5767N/A #@TestResult Success if an error message is displayed and
5767N/A if the output of status is correct.
5767N/A -->
5767N/A <function name="snmp_basic_017" scope="local">
5767N/A <testcase name="getTestCaseName('Status with a wrong listen-port value')">
5767N/A <sequence>
5767N/A <try>
5767N/A
5767N/A <sequence>
5767N/A
5767N/A <call function="'testCase_Preamble'"/>
5767N/A
5767N/A <script>
5767N/A if is_windows_platform(STAF_REMOTE_HOSTNAME) or IPS_PKG:
5767N/A skip=1
5767N/A else:
5767N/A skip=0
5767N/A </script>
5767N/A
5767N/A <if expr="skip == 0">
5767N/A <sequence>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Set the listen-port to a wrong value' }
5767N/A </call>
5767N/A
5767N/A <call function="'dsconfig'">
5767N/A {
5767N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5767N/A 'subcommand' : 'set-connection-handler-prop' ,
5767N/A 'objectType' : 'handler-name' ,
5767N/A 'objectName' : 'SNMP Connection Handler' ,
5767N/A 'optionsString' : '--set listen-port:%s' \
5767N/A % DEFAULT_PROPERTIES['listen-port']
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Restart DS running on port %s' % (DIRECTORY_INSTANCE_PORT) }
5767N/A </call>
5767N/A
5767N/A <call function="'StopDsWithScript'">
5767N/A {
5767N/A 'location' : STAF_REMOTE_HOSTNAME ,
5767N/A 'dsHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
5767N/A 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
5767N/A }
5767N/A </call>
5767N/A <call function="'StartDsWithScript'">
5767N/A { 'location' : STAF_REMOTE_HOSTNAME }
5767N/A </call>
5767N/A
5767N/A <call function="'isAlive'">
5767N/A {
5767N/A 'noOfLoops' : 10 ,
5767N/A 'noOfMilliSeconds' : 2000
5767N/A }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A msg1 = 'Cannot initialize the SNMP Connection Handler.'
5767N/A msg2 = 'Please check the configuration attributes'
5767N/A msg = '%s %s' % (msg1, msg2)
5767N/A </script>
5767N/A
5767N/A <call function="'grep'">
5767N/A {
5767N/A 'location' : STAF_REMOTE_HOSTNAME ,
5767N/A 'filename' : serverLogFile ,
5767N/A 'testString': msg
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get status when the server is started' }
5767N/A </call>
5767N/A
5767N/A <call function="'StatusWithScript'">
5767N/A {
5767N/A 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
5767N/A }
5767N/A </call>
5767N/A
5767N/A <script>
5767N/A returnString = STAXResult[0][1]
5767N/A </script>
5767N/A
5767N/A <call function="'searchString'">
5767N/A {
6142N/A 'expectedString' : '0.0.0.0:%s\\s+:\\s+SNMP\\s+:\\s+Enabled' \
5767N/A % DEFAULT_PROPERTIES['listen-port'] ,
5767N/A 'returnString' : returnString ,
5767N/A 'expectedRC' : 0
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Send SNMP Get request' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '1',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpCommunity' : community ,
5767N/A 'snmpOIDs' : oid ,
5767N/A 'snmpStatus' : 'reqTimeout'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Restore value for listen-port property' }
5767N/A </call>
5767N/A
5767N/A <call function="'dsconfig'">
5767N/A {
5767N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
5767N/A 'subcommand' : 'set-connection-handler-prop' ,
5767N/A 'objectType' : 'handler-name' ,
5767N/A 'objectName' : 'SNMP Connection Handler' ,
5767N/A 'optionsString' : '--set listen-port:%s' \
5767N/A % SNMP_PROPERTIES['listen-port']
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Restart the SNMP Connection Handler' }
5767N/A </call>
5767N/A
5767N/A <call function="'restartSNMPConnectionHandler'">
5767N/A {
5767N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
5767N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
5767N/A }
5767N/A </call>
5767N/A </sequence>
5767N/A <else>
5767N/A <sequence>
5767N/A <message>'This testcase is not relevant on Windows'</message>
5767N/A <tcstatus result="'pass'"/>
5767N/A </sequence>
5767N/A </else>
5767N/A </if>
5767N/A
5767N/A </sequence>
5767N/A
5767N/A <catch exception="'STAXException'" typevar="eType" var="eInfo">
5767N/A <message log="1" level="'fatal'">
5767N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
5767N/A </message>
5767N/A </catch>
5767N/A <finally>
5767N/A <sequence>
5767N/A <call function="'testCase_Postamble'"/>
5767N/A </sequence>
5767N/A </finally>
5767N/A </try>
5767N/A </sequence>
5767N/A </testcase>
5767N/A </function>
5767N/A
5767N/A</stax>