0N/A<?
xml version="1.0" encoding="UTF-8" standalone="no"?>
0N/A ! The contents of this file are subject to the terms of the 0N/A ! Common Development and Distribution License, Version 1.0 only 0N/A ! (the "License"). You may not use this file except in compliance 0N/A ! You can obtain a copy of the license at 0N/A ! See the License for the specific language governing permissions 0N/A ! and limitations under the License. 0N/A ! When distributing Covered Code, include this CDDL HEADER in each 0N/A ! file and include the License file at 0N/A ! add the following below this CDDL HEADER, with the fields enclosed 0N/A ! by brackets "[]" replaced with your own identifying information: 0N/A ! Portions Copyright [yyyy] [name of copyright owner] 0N/A ! Copyright 2008 Sun Microsystems, Inc. 2080N/A ! Portions Copyright 2012 ForgeRock AS 0N/A <!--- Test Case information 0N/A #@TestMarker SNMP v3 with custom configuration 0N/A #@TestName v3_customconf: TODO 0N/A <
function name="snmp_v3_custom_001" scope="local">
2080N/A <
testcase name="getTestCaseName('v3 change the security-agent-file property')">
2080N/A <
call function="'testCase_Preamble'"/>
2080N/A <
call function="'testStep'">
2080N/A { 'stepMessage' : 'Change the security-agent-file property' }
2080N/A <
call function="'dsconfig'">
2080N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
2080N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
2080N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
2080N/A 'subcommand' : 'set-connection-handler-prop' ,
0N/A 'objectType' : 'handler-name' ,
0N/A 'objectName' : 'SNMP Connection Handler' ,
0N/A 'optionsString' : '--set security-agent-file:%s' \
0N/A % newSecurityFileProp
2080N/A <
call function="'testStep'">
0N/A { 'stepMessage' : 'Restart the SNMP Connection Handler' }
<
call function="'restartSNMPConnectionHandler'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker SNMP v3 with custom configuration #@TestName v3_customconf: TODO <
function name="snmp_v3_custom_002" scope="local">
<
testcase name="getTestCaseName('v3 check the current security level (def)')">
<
call function="'testCase_Preamble'"/>
<
call function="'testStep'">
{ 'stepMessage' : 'Get with the lowUser and low security level' }
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : defContextProp ,
'snmpSecurityLevel' : lowSecurityLevelProp ,
'snmpSecurityFile' : mySecurityFile ,
'snmpStatus' : 'authorizationError'
<
call function="'testStep'">
{ 'stepMessage' : 'Get with the defUser and def security level' }
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : defContextProp ,
'snmpSecurityLevel' : defSecurityLevelProp ,
'snmpSecurityFile' : mySecurityFile ,
<
call function="'testStep'">
{ 'stepMessage' : 'Get with the highUser and high security level' }
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : defContextProp ,
'snmpSecurityLevel' : highSecurityLevelProp ,
'snmpSecurityFile' : mySecurityFile ,
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker SNMP v3 with custom configuration #@TestName v3_customconf: TODO <
function name="snmp_v3_custom_003" scope="local">
<
testcase name="getTestCaseName('v3 change the context property')">
<
call function="'testCase_Preamble'"/>
<
call function="'testStep'">
{ 'stepMessage' : 'Change the context property' }
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set community:%s' % newContextProp
<
call function="'testStep'">
{ 'stepMessage' : 'Restart the SNMP Connection Handler' }
<
call function="'restartSNMPConnectionHandler'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
<
call function="'testStep'">
{ 'stepMessage' : 'Get with the old context' }
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : defContextProp ,
'snmpSecurityLevel' : defSecurityLevelProp ,
'snmpSecurityFile' : mySecurityFile ,
'snmpStatus' : 'reqTimeout'
<
call function="'testStep'">
{ 'stepMessage' : 'Get with the context' }
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : newContextProp ,
'snmpSecurityLevel' : defSecurityLevelProp ,
'snmpSecurityFile' : mySecurityFile ,
<
call function="'testStep'">
{ 'stepMessage' : 'Restore the context property' }
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set community:%s' % defContextProp
<
call function="'testStep'">
{ 'stepMessage' : 'Restart the SNMP Connection Handler' }
<
call function="'restartSNMPConnectionHandler'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker SNMP v3 with custom configuration #@TestName v3_customconf: TODO <
function name="snmp_v3_custom_004" scope="local">
<
testcase name="getTestCaseName('v3 set the allowed-user property to a list')">
<
call function="'testCase_Preamble'"/>
<
call function="'testStep'">
{ 'stepMessage' : 'Set the allowed-user property to a list' }
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set allowed-user:%s' % defUser
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--add allowed-user:%s' % otherUser
<
call function="'testStep'">
{ 'stepMessage' : 'Restart the SNMP Connection Handler' }
<
call function="'restartSNMPConnectionHandler'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
<
call function="'testStep'">
{ 'stepMessage' : 'Get with the myUser community' }
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : defContextProp ,
'snmpSecurityLevel' : defSecurityLevelProp ,
'snmpSecurityFile' : mySecurityFile ,
<
call function="'testStep'">
{ 'stepMessage' : 'Get with the myUser2 community' }
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : defContextProp ,
'snmpSecurityLevel' : defSecurityLevelProp ,
'snmpSecurityFile' : mySecurityFile ,
<
call function="'testStep'">
{ 'stepMessage' : 'Restore the allowed-user property' }
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set allowed-user:%s' % defUserProp
<
call function="'testStep'">
{ 'stepMessage' : 'Restart the SNMP Connection Handler' }
<
call function="'restartSNMPConnectionHandler'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker SNMP v3 with custom configuration #@TestName v3_customconf: TODO <
function name="snmp_v3_custom_005" scope="local">
<
testcase name="getTestCaseName('v3 set the allowed-user property to otherUser')">
<
call function="'testCase_Preamble'"/>
<
call function="'testStep'">
{ 'stepMessage' : 'Set the allowed-user property to otherUser' }
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set allowed-user:%s' % otherUser
<
call function="'testStep'">
{ 'stepMessage' : 'Restart the SNMP Connection Handler' }
<
call function="'restartSNMPConnectionHandler'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
<
call function="'testStep'">
{ 'stepMessage' : 'Get with the defUser' }
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : defContextProp ,
'snmpSecurityLevel' : defSecurityLevelProp ,
'snmpSecurityFile' : mySecurityFile ,
'snmpStatus' : 'authorizationError'
<
call function="'testStep'">
{ 'stepMessage' : 'Get with the otherUser' }
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : defContextProp ,
'snmpSecurityLevel' : defSecurityLevelProp ,
'snmpSecurityFile' : mySecurityFile ,
<
call function="'testStep'">
{ 'stepMessage' : 'Restore the security-agent-file property' }
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set allowed-user:%s' % defUserProp
<
call function="'testStep'">
{ 'stepMessage' : 'Restart the SNMP Connection Handler' }
<
call function="'restartSNMPConnectionHandler'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker SNMP v3 with custom configuration #@TestName v3_customconf: TODO <
function name="snmp_v3_custom_006" scope="local">
<
testcase name="getTestCaseName('v3 set the security-level property to low')">
<
call function="'testCase_Preamble'"/>
<
call function="'testStep'">
{ 'stepMessage' : 'Set the security-level property to low' }
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set security-level:%s' \
<
call function="'testStep'">
{ 'stepMessage' : 'Restart the SNMP Connection Handler' }
<
call function="'restartSNMPConnectionHandler'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
<
call function="'testStep'">
{ 'stepMessage' : 'Get with the myUser1 and low security level' }
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : defContextProp ,
'snmpSecurityLevel' : lowSecurityLevelProp ,
'snmpSecurityFile' : mySecurityFile ,
<
call function="'testStep'">
{ 'stepMessage' : 'Get with the myUser2 and med security level' }
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : defContextProp ,
'snmpSecurityLevel' : defSecurityLevelProp ,
'snmpSecurityFile' : mySecurityFile ,
<
call function="'testStep'">
{ 'stepMessage' : 'Get with the myUser3 and high security level' }
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : defContextProp ,
'snmpSecurityLevel' : highSecurityLevelProp ,
'snmpSecurityFile' : mySecurityFile ,
<
call function="'testStep'">
{ 'stepMessage' : 'Restore the security-level property' }
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set security-level:%s' \
<
call function="'testStep'">
{ 'stepMessage' : 'Restart the SNMP Connection Handler' }
<
call function="'restartSNMPConnectionHandler'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker SNMP v3 with custom configuration #@TestName v3_customconf: TODO <
function name="snmp_v3_custom_007" scope="local">
<
testcase name="getTestCaseName('v3 set the security-level property to high')">
<
call function="'testCase_Preamble'"/>
<
call function="'testStep'">
{ 'stepMessage' : 'Set the security-level property to high' }
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set security-level:%s' \
<
call function="'testStep'">
{ 'stepMessage' : 'Restart the SNMP Connection Handler' }
<
call function="'restartSNMPConnectionHandler'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
<
call function="'testStep'">
{ 'stepMessage' : 'Get with the myUser1 and low security level' }
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : defContextProp ,
'snmpSecurityLevel' : lowSecurityLevelProp ,
'snmpSecurityFile' : mySecurityFile ,
'snmpStatus' : 'authorizationError'
<
call function="'testStep'">
{ 'stepMessage' : 'Get with the myUser2 and med security level' }
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : defContextProp ,
'snmpSecurityLevel' : defSecurityLevelProp ,
'snmpSecurityFile' : mySecurityFile ,
'snmpStatus' : 'authorizationError'
<
call function="'testStep'">
{ 'stepMessage' : 'Get with the myUser3 and high security level' }
<
call function="'SNMPGet'">
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpCommunity' : defContextProp ,
'snmpSecurityLevel' : highSecurityLevelProp ,
'snmpSecurityFile' : mySecurityFile ,
<
call function="'testStep'">
{ 'stepMessage' : 'Restore the security-level property' }
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set security-level:%s' \
<
call function="'testStep'">
{ 'stepMessage' : 'Restart the SNMP Connection Handler' }
<
call function="'restartSNMPConnectionHandler'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker SNMP v3 with custom configuration #@TestName v3_customconf: TODO <
function name="snmp_v3_custom_008" scope="local">
<
testcase name="getTestCaseName('v3 set the security-level property to wrong')">
<
call function="'testCase_Preamble'"/>
<
call function="'testStep'">
{ 'stepMessage' : 'Set the security-level property to wrong' }
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set security-level:%s' \
% wrongSecurityLevelProp ,
returnString = STAXResult[0][1]
msg1 = 'The value "%s" is not a valid value for the' \
msg2 = 'SNMP Connection Handler property "security-level"'
msg3 = 'which has the following syntax:'
msg4 = 'authnopriv | authpriv | noauthnopriv'
msg = '%s %s %s %s' % (msg1, msg2, msg3, msg4)
<
call function="'checktestString'">
'returnString' : returnString ,
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestMarker SNMP v3 with custom configuration #@TestName v3_customconf: TODO <
function name="snmp_v3_custom_009" scope="local">
<
testcase name="getTestCaseName('v3 restore the security-agent-file property')">
<
call function="'testCase_Preamble'"/>
<
call function="'testStep'">
{ 'stepMessage' : 'Restore the security-agent-file property' }
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set security-agent-file:%s' \
<
call function="'testStep'">
{ 'stepMessage' : 'Restart the SNMP Connection Handler' }
<
call function="'restartSNMPConnectionHandler'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>