snmp_setup.xml revision c274c9240a50d300aec6cc72832af6805df5a2a0
0N/A<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2362N/A<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
0N/A<!--
0N/A ! CDDL HEADER START
0N/A !
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 ! with the License.
0N/A !
0N/A ! You can obtain a copy of the license at
0N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
0N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
0N/A ! See the License for the specific language governing permissions
0N/A ! and limitations under the License.
0N/A !
0N/A ! When distributing Covered Code, include this CDDL HEADER in each
0N/A ! file and include the License file at
2362N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
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 !
0N/A ! CDDL HEADER END
0N/A !
0N/A ! Copyright 2008-2009 Sun Microsystems, Inc.
0N/A! -->
0N/A<stax>
0N/A
0N/A <defaultcall function="snmp_setup" />
0N/A
0N/A <function name="snmp_setup">
0N/A
0N/A <sequence>
0N/A
0N/A <block name="'snmp_setup'">
0N/A
0N/A <sequence>
0N/A
0N/A <!--- Test Suite information
0N/A #@TestSuiteName setup
0N/A #@TestSuitePurpose Setup for the snmp test suite.
0N/A #@TestSuiteGroup setup
0N/A #@TestScript snmp_setup.xml
0N/A -->
0N/A <script>
0N/A if not CurrentTestPath.has_key('group'):
0N/A CurrentTestPath['group'] = 'snmp'
0N/A CurrentTestPath['suite'] = STAXCurrentBlock
0N/A </script>
0N/A
0N/A <call function="'testSuite_Preamble'"/>
0N/A
0N/A <!--- Define default value for manager -->
0N/A <script>
0N/A snmpPath = '%s/snmp' % remote.java,
0N/A opendmkPath = '%s/jdmkrt.jar' % snmpPath
0N/A </script>
0N/A
0N/A <!--- Test Case information
0N/A #@TestMarker setup
0N/A #@TestName setup: create DS topology
0N/A #@TestIssue none
0N/A #@TestPurpose Create the topology necessary to the
0N/A test suite.
0N/A #@TestPreamble none
0N/A #@TestStep Create DS topology as described in config.py.
0N/A #@TestPostamble none
0N/A #@TestResult Success if createTopology returns 0.
0N/A -->
0N/A <testcase name="getTestCaseName('setup: create DS tpology')">
0N/A
0N/A <sequence>
0N/A
0N/A <call function="'testCase_Preamble'"/>
0N/A
0N/A <message>
0N/A 'setup: create DS topology as described in config.py'
0N/A </message>
0N/A
0N/A <call function="'createTopology'">
0N/A { 'initialiseInstance' : False }
0N/A </call>
0N/A
0N/A <call function="'checktestRC'">
0N/A {
0N/A 'returncode' : RC ,
0N/A 'result' : STAXResult
0N/A }
0N/A </call>
0N/A
0N/A <call function="'testCase_Postamble'"/>
0N/A
0N/A </sequence>
0N/A
0N/A </testcase>
0N/A
0N/A <!-- Check if 'opendmkPath' exists -->
0N/A <call function="'GetEntry'">
0N/A {
0N/A 'location' : STAF_REMOTE_HOSTNAME ,
0N/A 'entry' : opendmkPath ,
0N/A 'attribute' : 'TYPE'
0N/A }
0N/A </call>
0N/A <!-- 'opendmkPath' exists so we can continue -->
0N/A <if expr="RC != 48">
0N/A <sequence>
0N/A
0N/A <!--- Test Case information
0N/A #@TestMarker setup
0N/A #@TestName setup: start DS
0N/A #@TestIssue none
0N/A #@TestPurpose Start DS.
0N/A #@TestPreamble none
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')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'setup: start DS to run on port %s' \
% (DIRECTORY_INSTANCE_PORT)
</message>
<!--- Start DS -->
<call function="'StartDsWithScript'">
{ 'location' : STAF_REMOTE_HOSTNAME }
</call>
<!--- Check that DS started -->
<call function="'isAlive'">
{
'noOfLoops' : 10 ,
'noOfMilliSeconds' : 2000
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker setup
#@TestName setup: add initial entries
#@TestIssue none
#@TestPurpose Load the data needed by the test suite.
#@TestPreamble none
#@TestStep Load the data needed by the test suite.
#@TestPostamble none
#@TestResult Success if importLdif returns 0.
-->
<testcase name="getTestCaseName('setup: add initial entries')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'setup: add initial entries'
</message>
<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>
<call function="'addEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD,
'entryToBeAdded' : '%s/snmp/snmp_start.ldif'
% remote.data,
'verbose' : False
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker setup
#@TestName setup: get default SNMP connection handler
properties
#@TestIssue none
#@TestPurpose Get default SNMP connection handler
properties.
#@TestPreamble none
#@TestStep get default SNMP connection handler
properties using dsconfig.
#@TestPostamble none
#@TestResult Success if GetDSConfigProperties returns 0
-->
<testcase name="getTestCaseName
('setup: get default SNMP Connection Handler properties')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'setup: get default SNMP Connection Handler properties'
</message>
<script>
options = '--handler-name "SNMP Connection Handler"'
</script>
<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>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker setup
#@TestName setup: check SNMP Connection Handler is
disabled
#@TestIssue none
#@TestPurpose Check SNMP Connection Handler is disabled.
#@TestPreamble none
#@TestStep check SNMP Connection Handler is
disabled using status command
#@TestPostamble none
#@TestResult Success if output of status is correct.
-->
<testcase name="getTestCaseName
('setup: check SNMP Connection Handler is disabled')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'setup: check SNMP Connection Handler is disabled'
</message>
<call function="'StatusWithScript'">
{
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : ': SNMP : Disabled'
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker setup
#@TestName setup: enable SNMP Connection Handler
#@TestIssue none
#@TestPurpose Enable SNMP Connection Handler.
#@TestPreamble none
#@TestStep enable SNMP Connection Handler using
dsconfig.
#@TestPostamble none
#@TestResult Success if dsconfig returns 0.
-->
<testcase name="getTestCaseName
('setup: enable SNMP Connection Handler')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'setup: enable SNMP Connection Handler'
</message>
<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 listen-port:%s \
--set trap-port:%s \
--set opendmk-jarfile:%s' \
% (SNMP_PORT, SNMP_TRAP_PORT, opendmkPath)
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker setup
#@TestName setup: check SNMP Connection Handler is
enabled
#@TestIssue none
#@TestPurpose Check SNMP Connection Handler is enabled.
#@TestPreamble none
#@TestStep check SNMP Connection Handler is
enabled using status command
#@TestPostamble none
#@TestResult Success if output of status is correct.
-->
<testcase name="getTestCaseName
('setup: check SNMP Connection Handler is enabled')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'setup: check SNMP Connection Handler is enabled'
</message>
<call function="'StatusWithScript'">
{
'dsBindDN' : DIRECTORY_INSTANCE_DN ,
'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
}
</call>
<script>
returnString = STAXResult[0][1]
</script>
<call function="'checktestString'">
{
'returnString' : returnString ,
'expectedString' : ': SNMP : Enabled'
}
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case information
#@TestMarker setup
#@TestName setup: get SNMP connection handler
properties
#@TestIssue none
#@TestPurpose Get SNMP connection handler properties.
#@TestPreamble none
#@TestStep get SNMP connection handler properties
using dsconfig.
#@TestPostamble none
#@TestResult Success if GetDSConfigProperties returns 0
-->
<testcase name="getTestCaseName
('setup: get SNMP Connection Handler properties')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'setup: get SNMP Connection Handler properties'
</message>
<script>
options = '--handler-name "SNMP Connection Handler"'
</script>
<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>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
</sequence>
<else>
<sequence>
<!--- Test Case information
#@TestMarker setup
#@TestName setup: warning
#@TestIssue none
#@TestPurpose Warning
#@TestPreamble none
#@TestStep Print a warning message to indicate that
the SNMP_OPENDMK_LIBDIR is not set.
#@TestPostamble none
#@TestResult Always fails.
-->
<testcase name="getTestCaseName('setup: Warning')">
<sequence>
<call function="'testCase_Preamble'"/>
<script>
STOP_RUN = 'True'
</script>
<message log="1" level="'Error'">
'WARNING: Check if SNMP_OPENDMK_LIBDIR is set \
in the config.py.stubs file.'
</message>
<tcstatus result="'fail'"></tcstatus>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
</sequence>
</else>
</if>
<call function="'testSuite_Postamble'"/>
</sequence>
</block>
</sequence>
</function>
</stax>