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.
5767N/A ! Portions Copyright 2012 ForgeRock AS
5767N/A ! -->
5767N/A<stax>
5767N/A
5767N/A <!--- Test Case information
5767N/A #@TestMarker SNMP v3 with custom configuration
5767N/A #@TestName v3_customconf: 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_v3_custom_001" scope="local">
5767N/A <testcase name="getTestCaseName('v3 change the security-agent-file property')">
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' : 'Change the 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 % newSecurityFileProp
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 v3 with custom configuration
5767N/A #@TestName v3_customconf: 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_v3_custom_002" scope="local">
5767N/A <testcase name="getTestCaseName('v3 check the current security level (def)')">
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' : 'Get with the lowUser and low security level' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '3',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpUser' : lowUser ,
5767N/A 'snmpCommunity' : defContextProp ,
5767N/A 'snmpSecurityLevel' : lowSecurityLevelProp ,
5767N/A 'snmpSecurityFile' : mySecurityFile ,
5767N/A 'snmpOIDs' : oid ,
5767N/A 'snmpStatus' : 'authorizationError'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get with the defUser and def security level' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '3',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpUser' : defUser ,
5767N/A 'snmpCommunity' : defContextProp ,
5767N/A 'snmpSecurityLevel' : defSecurityLevelProp ,
5767N/A 'snmpSecurityFile' : mySecurityFile ,
5767N/A 'snmpOIDs' : oid ,
5767N/A 'snmpStatus' : 'noError'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get with the highUser and high security level' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '3',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpUser' : highUser ,
5767N/A 'snmpCommunity' : defContextProp ,
5767N/A 'snmpSecurityLevel' : highSecurityLevelProp ,
5767N/A 'snmpSecurityFile' : mySecurityFile ,
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 v3 with custom configuration
5767N/A #@TestName v3_customconf: 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_v3_custom_003" scope="local">
5767N/A <testcase name="getTestCaseName('v3 change the context property')">
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' : 'Change the context 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 community:%s' % newContextProp
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 <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get with the old context' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '3',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpUser' : defUser ,
5767N/A 'snmpCommunity' : defContextProp ,
5767N/A 'snmpSecurityLevel' : defSecurityLevelProp ,
5767N/A 'snmpSecurityFile' : mySecurityFile ,
5767N/A 'snmpOIDs' : oid ,
5767N/A 'snmpStatus' : 'reqTimeout'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get with the context' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '3',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpUser' : otherUser ,
5767N/A 'snmpCommunity' : newContextProp ,
5767N/A 'snmpSecurityLevel' : defSecurityLevelProp ,
5767N/A 'snmpSecurityFile' : mySecurityFile ,
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 context 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 community:%s' % defContextProp
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 v3 with custom configuration
5767N/A #@TestName v3_customconf: 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_v3_custom_004" scope="local">
5767N/A <testcase name="getTestCaseName('v3 set the allowed-user property to a list')">
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' : 'Set the allowed-user property to a list' }
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 allowed-user:%s' % defUser
5767N/A }
5767N/A </call>
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' : '--add allowed-user:%s' % otherUser
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 <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get with the myUser community' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '3',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpUser' : defUser ,
5767N/A 'snmpCommunity' : defContextProp ,
5767N/A 'snmpSecurityLevel' : defSecurityLevelProp ,
5767N/A 'snmpSecurityFile' : mySecurityFile ,
5767N/A 'snmpOIDs' : oid ,
5767N/A 'snmpStatus' : 'noError'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get with the myUser2 community' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '3',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpUser' : otherUser ,
5767N/A 'snmpCommunity' : defContextProp ,
5767N/A 'snmpSecurityLevel' : defSecurityLevelProp ,
5767N/A 'snmpSecurityFile' : mySecurityFile ,
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 allowed-user 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 allowed-user:%s' % defUserProp
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 v3 with custom configuration
5767N/A #@TestName v3_customconf: 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_v3_custom_005" scope="local">
5767N/A <testcase name="getTestCaseName('v3 set the allowed-user property to otherUser')">
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' : 'Set the allowed-user property to otherUser' }
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 allowed-user:%s' % otherUser
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 <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get with the defUser' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '3',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpUser' : defUser ,
5767N/A 'snmpCommunity' : defContextProp ,
5767N/A 'snmpSecurityLevel' : defSecurityLevelProp ,
5767N/A 'snmpSecurityFile' : mySecurityFile ,
5767N/A 'snmpOIDs' : oid ,
5767N/A 'snmpStatus' : 'authorizationError'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get with the otherUser' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '3',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpUser' : otherUser ,
5767N/A 'snmpCommunity' : defContextProp ,
5767N/A 'snmpSecurityLevel' : defSecurityLevelProp ,
5767N/A 'snmpSecurityFile' : mySecurityFile ,
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 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 allowed-user:%s' % defUserProp
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 v3 with custom configuration
5767N/A #@TestName v3_customconf: 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_v3_custom_006" scope="local">
5767N/A <testcase name="getTestCaseName('v3 set the security-level property to low')">
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' : 'Set the security-level property to low' }
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-level:%s' \
5767N/A % lowSecurityLevelProp
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 <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get with the myUser1 and low security level' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '3',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpUser' : lowUser ,
5767N/A 'snmpCommunity' : defContextProp ,
5767N/A 'snmpSecurityLevel' : lowSecurityLevelProp ,
5767N/A 'snmpSecurityFile' : mySecurityFile ,
5767N/A 'snmpOIDs' : oid ,
5767N/A 'snmpStatus' : 'noError'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get with the myUser2 and med security level' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '3',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpUser' : defUser ,
5767N/A 'snmpCommunity' : defContextProp ,
5767N/A 'snmpSecurityLevel' : defSecurityLevelProp ,
5767N/A 'snmpSecurityFile' : mySecurityFile ,
5767N/A 'snmpOIDs' : oid ,
5767N/A 'snmpStatus' : 'noError'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get with the myUser3 and high security level' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '3',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpUser' : highUser ,
5767N/A 'snmpCommunity' : defContextProp ,
5767N/A 'snmpSecurityLevel' : highSecurityLevelProp ,
5767N/A 'snmpSecurityFile' : mySecurityFile ,
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 security-level 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-level:%s' \
5767N/A % defSecurityLevelProp
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 v3 with custom configuration
5767N/A #@TestName v3_customconf: 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_v3_custom_007" scope="local">
5767N/A <testcase name="getTestCaseName('v3 set the security-level property to high')">
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' : 'Set the security-level property to high' }
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-level:%s' \
5767N/A % highSecurityLevelProp
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 <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get with the myUser1 and low security level' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '3',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpUser' : lowUser ,
5767N/A 'snmpCommunity' : defContextProp ,
5767N/A 'snmpSecurityLevel' : lowSecurityLevelProp ,
5767N/A 'snmpSecurityFile' : mySecurityFile ,
5767N/A 'snmpOIDs' : oid ,
5767N/A 'snmpStatus' : 'authorizationError'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get with the myUser2 and med security level' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '3',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpUser' : defUser ,
5767N/A 'snmpCommunity' : defContextProp ,
5767N/A 'snmpSecurityLevel' : defSecurityLevelProp ,
5767N/A 'snmpSecurityFile' : mySecurityFile ,
5767N/A 'snmpOIDs' : oid ,
5767N/A 'snmpStatus' : 'authorizationError'
5767N/A }
5767N/A </call>
5767N/A
5767N/A <call function="'testStep'">
5767N/A { 'stepMessage' : 'Get with the myUser3 and high security level' }
5767N/A </call>
5767N/A
5767N/A <call function="'SNMPGet'">
5767N/A {
5767N/A 'snmpVersion' : '3',
5767N/A 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
5767N/A 'snmpPort' : SNMP_PORT ,
5767N/A 'snmpUser' : highUser ,
5767N/A 'snmpCommunity' : defContextProp ,
5767N/A 'snmpSecurityLevel' : highSecurityLevelProp ,
5767N/A 'snmpSecurityFile' : mySecurityFile ,
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 security-level 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-level:%s' \
5767N/A % defSecurityLevelProp
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 v3 with custom configuration
5767N/A #@TestName v3_customconf: 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_v3_custom_008" scope="local">
5767N/A <testcase name="getTestCaseName('v3 set the security-level property to wrong')">
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' : 'Set the security-level property to wrong' }
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-level:%s' \
5767N/A % wrongSecurityLevelProp ,
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 "%s" is not a valid value for the' \
5767N/A % wrongSecurityLevelProp
5767N/A msg2 = 'SNMP Connection Handler property "security-level"'
5767N/A msg3 = 'which has the following syntax:'
5767N/A msg4 = 'authnopriv | authpriv | noauthnopriv'
5767N/A msg = '%s %s %s %s' % (msg1, msg2, msg3, msg4)
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
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 v3 with custom configuration
5767N/A #@TestName v3_customconf: 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_v3_custom_009" scope="local">
5767N/A <testcase name="getTestCaseName('v3 restore the security-agent-file property')">
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' : 'Restore the 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 % defSecurityFileProp
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</stax>