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 2362N/A ! add the following below this CDDL HEADER, with the fields enclosed 2362N/A ! by brackets "[]" replaced with your own identifying information: 0N/A ! Portions Copyright [yyyy] [name of copyright owner] 0N/A ! Copyright 2008-2009 Sun Microsystems, Inc. 0N/A <
defaultcall function="snmp_setup" />
0N/A <
function name="snmp_setup">
0N/A <
block name="'snmp_setup'">
0N/A <!--- Test Suite information 0N/A #@TestSuiteName setup 0N/A #@TestSuitePurpose Setup for the snmp test suite. 0N/A #@TestSuiteGroup setup 0N/A CurrentTestPath['group'] = 'snmp'
0N/A CurrentTestPath['suite'] = STAXCurrentBlock
0N/A <
call function="'testSuite_Preamble'"/>
0N/A <!--- Define default value for manager --> 0N/A <!--- Test Case information 0N/A #@TestName setup: create DS topology 0N/A #@TestPurpose Create the topology necessary to the 0N/A #@TestPostamble none 0N/A #@TestResult Success if createTopology returns 0. 0N/A <
testcase name="getTestCaseName('setup: create DS tpology')">
0N/A <
call function="'testCase_Preamble'"/>
0N/A <
call function="'createTopology'">
0N/A { 'initialiseInstance' : False }
0N/A <
call function="'checktestRC'">
0N/A 'result' : STAXResult
0N/A <
call function="'testCase_Postamble'"/>
0N/A <!-- Check if 'opendmkPath' exists --> 0N/A <
call function="'GetEntry'">
0N/A 'location' : STAF_REMOTE_HOSTNAME ,
0N/A 'entry' : opendmkPath ,
0N/A 'attribute' : 'TYPE'
0N/A <!-- 'opendmkPath' exists so we can continue --> 0N/A <
if expr="RC != 48">
0N/A <!--- Test Case information 0N/A #@TestName setup: start DS 0N/A #@TestPurpose Start DS. 0N/A #@TestStep Start the server. 0N/A #@TestStep Check that the server is alive. 0N/A #@TestPostamble none #@TestResult Success if StartDsWithScript returns 0. <
testcase name="getTestCaseName('setup: start DS')">
<
call function="'testCase_Preamble'"/>
'setup: start DS to run on port %s' \
% (DIRECTORY_INSTANCE_PORT)
<
call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
<!--- Check that DS started --> <
call function="'isAlive'">
'noOfMilliSeconds' : 2000
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestName setup: add initial entries #@TestPurpose Load the data needed by the test suite. #@TestStep Load the data needed by the test suite. #@TestResult Success if importLdif returns 0. <
testcase name="getTestCaseName('setup: add initial entries')">
<
call function="'testCase_Preamble'"/>
'setup: add initial entries'
<
call function="'dsconfigSet'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstanceAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'objectName' : 'password-policy',
'propertyType' : 'policy',
'propertyName' : 'Default Password Policy',
'attributeName' : 'allow-pre-encoded-passwords',
'attributeValue' : 'true'
<
call function="'addEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestName setup: get default SNMP connection handler #@TestPurpose Get default SNMP connection handler #@TestStep get default SNMP connection handler properties using dsconfig. #@TestResult Success if GetDSConfigProperties returns 0 <
testcase name="getTestCaseName ('setup: get default SNMP Connection Handler properties')">
<
call function="'testCase_Preamble'"/>
'setup: get default 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' : 'DEFAULT_PROPERTIES'
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestName setup: check SNMP Connection Handler is #@TestPurpose Check SNMP Connection Handler is disabled. #@TestStep check SNMP Connection Handler is disabled using status command #@TestResult Success if output of status is correct. <
testcase name="getTestCaseName ('setup: check SNMP Connection Handler is disabled')">
<
call function="'testCase_Preamble'"/>
'setup: check SNMP Connection Handler is disabled'
<
call function="'StatusWithScript'">
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
returnString = STAXResult[0][1]
<
call function="'checktestString'">
'returnString' : returnString ,
'expectedString' : ': SNMP : Disabled'
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestName setup: enable SNMP Connection Handler #@TestPurpose Enable SNMP Connection Handler. #@TestStep enable SNMP Connection Handler using #@TestResult Success if dsconfig returns 0. <
testcase name="getTestCaseName ('setup: enable SNMP Connection Handler')">
<
call function="'testCase_Preamble'"/>
'setup: enable SNMP Connection Handler'
<
call function="'dsconfig'">
'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'subcommand' : 'set-connection-handler-prop' ,
'objectType' : 'handler-name' ,
'objectName' : 'SNMP Connection Handler' ,
'optionsString' : '--set enabled:true \
--set opendmk-jarfile:%s' \
% (SNMP_PORT, SNMP_TRAP_PORT, opendmkPath)
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestName setup: check SNMP Connection Handler is #@TestPurpose Check SNMP Connection Handler is enabled. #@TestStep check SNMP Connection Handler is enabled using status command #@TestResult Success if output of status is correct. <
testcase name="getTestCaseName ('setup: check SNMP Connection Handler is enabled')">
<
call function="'testCase_Preamble'"/>
'setup: check SNMP Connection Handler is enabled'
<
call function="'StatusWithScript'">
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
returnString = STAXResult[0][1]
<
call function="'checktestString'">
'returnString' : returnString ,
'expectedString' : ': SNMP : Enabled'
<
call function="'testCase_Postamble'"/>
<!--- Test Case information #@TestName setup: get SNMP connection handler #@TestPurpose Get SNMP connection handler properties. #@TestStep get SNMP connection handler properties #@TestResult Success if GetDSConfigProperties returns 0 <
testcase name="getTestCaseName ('setup: get SNMP Connection Handler properties')">
<
call function="'testCase_Preamble'"/>
'setup: 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'
<
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'"/>
<
message log="1" level="'Error'">
'WARNING: Check if SNMP_OPENDMK_LIBDIR is set \
<
tcstatus result="'fail'"></
tcstatus>
<
call function="'testCase_Postamble'"/>
<
call function="'testSuite_Postamble'"/>