10139N/A<?
xml version="1.0" encoding="UTF-8" standalone="no"?>
10139N/A ! The contents of this file are subject to the terms of the 10139N/A ! Common Development and Distribution License, Version 1.0 only 10139N/A ! (the "License"). You may not use this file except in compliance 10139N/A ! See the License for the specific language governing permissions 10615N/A ! and limitations under the License. 10613N/A ! When distributing Covered Code, include this CDDL HEADER in each 10139N/A ! If applicable, add the following below this CDDL HEADER, with the 10139N/A ! fields enclosed by brackets "[]" replaced with your own identifying 10613N/A ! Portions Copyright [yyyy] [name of copyright owner] 10139N/A ! Copyright 2008-2010 Sun Microsystems, Inc. 10139N/A ! Portions Copyright 2012-2013 ForgeRock AS 10139N/A <
function name="main_snmp_setup">
10284N/A #@TestSuitePurpose Setup for the snmp test suite. 10476N/A CurrentTestPath['group'] = 'snmp'
10535N/A CurrentTestPath['suite'] = 'setup'
10139N/A <
call function="'testSuite_Preamble'"/>
10139N/A <!--- Define default value for manager --> 10139N/A #@TestName setup: create DS topology 10139N/A #@TestPurpose Create the topology necessary to the 10139N/A #@TestResult Success if createTopology returns 0. 10139N/A <
testcase name="getTestCaseName('setup: create DS topology')">
10139N/A <
call function="'testCase_Preamble'"/>
10139N/A <
call function="'createTopology'">
10139N/A { 'initialiseInstance' : False }
10139N/A <
call function="'checktestRC'">
10139N/A <
catch exception="'STAXException'" typevar="eType" var="eInfo">
10139N/A <
message log="1" level="'fatal'">
10139N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
10139N/A <
call function="'testCase_Postamble'"/>
10139N/A <!-- Check if 'opendmkPath' exists --> 10139N/A 'location' : STAF_REMOTE_HOSTNAME ,
10139N/A <!-- 'opendmkPath' exists so we can continue --> 10213N/A #@TestStep Check that the server is alive. 10387N/A #@TestResult Success if StartDsWithScript returns 0. 10139N/A <
testcase name="getTestCaseName('setup: start DS')">
10139N/A <
call function="'testCase_Preamble'"/>
10139N/A { 'stepMessage' : 'start DS to run on port %s.' % (DIRECTORY_INSTANCE_PORT) }
10139N/A <
call function="'StartDsWithScript'">
10139N/A { 'location' : STAF_REMOTE_HOSTNAME }
10139N/A <!--- Check that DS started --> 10139N/A <
catch exception="'STAXException'" typevar="eType" var="eInfo">
10139N/A <
message log="1" level="'fatal'">
10139N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
10139N/A <
call function="'testCase_Postamble'"/>
10139N/A #@TestName setup: add initial entries 10139N/A #@TestPurpose Load the data needed by the test suite. 10139N/A #@TestStep Load the data needed by the test suite. 10139N/A #@TestResult Success if importLdif returns 0. 10139N/A <
testcase name="getTestCaseName('setup: add initial entries')">
10139N/A <
call function="'testCase_Preamble'"/>
10139N/A { 'stepMessage' : 'Add initial entries' }
10139N/A <
call function="'dsconfigSet'">
10139N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
10139N/A 'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
10139N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
10139N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
10139N/A 'objectName' : 'password-policy',
10139N/A 'propertyName' : 'Default Password Policy',
10139N/A 'attributeName' : 'allow-pre-encoded-passwords',
10139N/A { 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
10139N/A 'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
10139N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
10139N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
10139N/A <
catch exception="'STAXException'" typevar="eType" var="eInfo">
10139N/A <
message log="1" level="'fatal'">
10139N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
10139N/A <
call function="'testCase_Postamble'"/>
10139N/A #@TestName setup: get default SNMP connection handler 10139N/A #@TestPurpose Get default SNMP connection handler 10139N/A #@TestStep get default SNMP connection handler 10139N/A #@TestResult Success if GetDSConfigProperties returns 0 10615N/A <
testcase name="getTestCaseName 10535N/A ('setup: get default SNMP Connection Handler properties')">
10436N/A <
call function="'testCase_Preamble'"/>
10438N/A { 'stepMessage' : 'Get default SNMP Connection Handler properties' }
10418N/A options = '--handler-name "SNMP Connection Handler"'
10418N/A <
call function="'GetDSConfigProperties'">
10339N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
10339N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
10283N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
10284N/A 'subcommand' : 'get-connection-handler-prop' ,
10169N/A 'myVariableName' : 'DEFAULT_PROPERTIES'
10139N/A <
catch exception="'STAXException'" typevar="eType" var="eInfo">
10139N/A <
message log="1" level="'fatal'">
10139N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
10139N/A <
call function="'testCase_Postamble'"/>
10139N/A #@TestName setup: check SNMP Connection Handler is 10139N/A #@TestPurpose Check SNMP Connection Handler is disabled. 10139N/A #@TestStep check SNMP Connection Handler is 10139N/A #@TestResult Success if output of status is correct. 10139N/A <
testcase name="getTestCaseName 10139N/A ('setup: check SNMP Connection Handler is disabled')">
10139N/A <
call function="'testCase_Preamble'"/>
10139N/A { 'stepMessage' : 'Check SNMP Connection Handler is disabled' }
10139N/A <
call function="'StatusWithScript'">
10535N/A 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
10139N/A 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
10139N/A returnString = STAXResult[0][1]
10139N/A <
call function="'checktestString'">
10139N/A 'returnString' : returnString ,
10139N/A 'expectedString' : ':\\s+SNMP\\s+:\\s+Disabled'
10139N/A <
catch exception="'STAXException'" typevar="eType" var="eInfo">
10139N/A <
message log="1" level="'fatal'">
10139N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
10139N/A <
call function="'testCase_Postamble'"/>
10139N/A #@TestName setup: enable SNMP Connection Handler 10139N/A #@TestPurpose Enable SNMP Connection Handler. 10139N/A #@TestStep enable SNMP Connection Handler using 10139N/A #@TestResult Success if dsconfig returns 0. 10139N/A <
testcase name="getTestCaseName 10139N/A ('setup: enable SNMP Connection Handler')">
10139N/A <
call function="'testCase_Preamble'"/>
10139N/A { 'stepMessage' : 'Enable SNMP Connection Handler' }
10139N/A 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
10139N/A 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
10139N/A 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
10139N/A 'subcommand' : 'set-connection-handler-prop' ,
10139N/A 'objectType' : 'handler-name' ,
10139N/A 'objectName' : 'SNMP Connection Handler' ,
10139N/A 'optionsString' : '--set enabled:true \
10139N/A % (SNMP_PORT, SNMP_TRAP_PORT, opendmkPath)
10139N/A <
catch exception="'STAXException'" typevar="eType" var="eInfo">
10139N/A <
message log="1" level="'fatal'">
10139N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
10139N/A <
call function="'testCase_Postamble'"/>
10139N/A #@TestName setup: check SNMP Connection Handler is 10139N/A #@TestPurpose Check SNMP Connection Handler is enabled. 10139N/A #@TestStep check SNMP Connection Handler is 10139N/A #@TestResult Success if output of status is correct. 10139N/A <
testcase name="getTestCaseName 10139N/A ('setup: check SNMP Connection Handler is enabled')">
10139N/A <
call function="'testCase_Preamble'"/>
10139N/A { 'stepMessage' : 'Check SNMP Connection Handler is enabled' }
10139N/A <
call function="'StatusWithScript'">
10139N/A 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
10139N/A 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
10139N/A returnString = STAXResult[0][1]
10139N/A <
call function="'checktestString'">
10139N/A 'returnString' : returnString ,
10139N/A 'expectedString' : ':\\s+SNMP\\s+:\\s+Enabled'
10139N/A <
catch exception="'STAXException'" typevar="eType" var="eInfo">
10139N/A <
message log="1" level="'fatal'">
10139N/A '%s: Test failed. eInfo(%s)' % (eType,eInfo)
10139N/A <
call function="'testCase_Postamble'"/>
10139N/A #@TestName setup: get SNMP connection handler 10139N/A #@TestPurpose Get SNMP connection handler properties. 10139N/A #@TestStep get SNMP connection handler properties 10139N/A #@TestResult Success if GetDSConfigProperties returns 0 10139N/A <
testcase name="getTestCaseName 10139N/A ('setup: get SNMP Connection Handler properties')">
10139N/A <
call function="'testCase_Preamble'"/>
10139N/A { 'stepMessage' : 'Copy snmp files to the remote host' }
10139N/A 'location' : STAXServiceMachine ,
10139N/A 'remotehost' : STAF_REMOTE_HOSTNAME
<
call function="'copyFile'">
'location' : STAXServiceMachine ,
'remotehost' : STAF_REMOTE_HOSTNAME
<
call function="'testStep'">
{ 'stepMessage' : 'Get SNMP Connection Handler properties' }
options = '--handler-name "SNMP Connection Handler"'
<
call function="'GetDSConfigProperties'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'get-connection-handler-prop' ,
'optionsString' : options ,
'myVariableName' : 'SNMP_PROPERTIES'
<
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 #@TestName setup: warning #@TestStep Print a warning message to indicate that the SNMP_OPENDMK_LIBDIR is not set. #@TestResult Always fails. <
testcase name="getTestCaseName('setup: Warning')">
<
call function="'testCase_Preamble'"/>
<
call function="'testStep'">
{ 'stepMessage' : 'Print a warning message' }
<
message log="1" level="'Error'">
'WARNING: Check if SNMP_OPENDMK_LIBDIR is set \
<
tcstatus result="'fail'"></
tcstatus>
<
catch exception="'STAXException'" typevar="eType" var="eInfo">
<
message log="1" level="'fatal'">
'%s: Test failed. eInfo(%s)' % (eType,eInfo)
<
call function="'testCase_Postamble'"/>
<
call function="'testSuite_Postamble'"/>