From 251b4cc83d05ed47da59c323786fce28cd5a30f5 Mon Sep 17 00:00:00 2001
From: Gary Williams <gary.williams@forgerock.com>
Date: Mon, 05 Mar 2012 10:39:34 +0000
Subject: [PATCH] Remove old snmp test suite from functional tests
---
/dev/null | 601 ------------------------------------------------------
1 files changed, 0 insertions(+), 601 deletions(-)
diff --git a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp.xml b/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp.xml
deleted file mode 100644
index 0528a34..0000000
--- a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp.xml
+++ /dev/null
@@ -1,118 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
-<!--
- ! CDDL HEADER START
- !
- ! The contents of this file are subject to the terms of the
- ! Common Development and Distribution License, Version 1.0 only
- ! (the "License"). You may not use this file except in compliance
- ! with the License.
- !
- ! You can obtain a copy of the license at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
- ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- ! See the License for the specific language governing permissions
- ! and limitations under the License.
- !
- ! When distributing Covered Code, exclude this CDDL HEADER in each
- ! file and exclude the License file at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- ! add the following below this CDDL HEADER, with the fields enclosed
- ! by brackets "[]" replaced with your own identifying information:
- ! Portions Copyright [yyyy] [name of copyright owner]
- !
- ! CDDL HEADER END
- !
- ! Copyright 2008 Sun Microsystems, Inc.
-! -->
-<stax>
-
- <defaultcall function="main_snmp"/>
-
- <function name="main_snmp" scope="local">
-
- <function-list-args>
- <function-required-arg name="STAXParentID"/>
- </function-list-args>
-
- <sequence>
-
- <block name="'snmp'">
-
- <sequence>
-
- <!--- Load the job environment for the test group execution -->
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/environment.xml' % TESTS_FUNCTIONS_DIR"/>
- <call function="'loadJobEnvironment'">
- { 'parent' : STAXParentID }
- </call>
-
- <!--- Test Group information
- #@TestGroupName SNMP tests
- #@TestGroupPurpose Test the SNMP Connection Handler.
- -->
- <script>
- CurrentTestPath['group'] = 'snmp'
- </script>
-
- <call function="'testGroup_Preamble'"/>
-
- <!--- Activate the verbose mode -->
- <script>
- VERBOSE_MODE = 'true'
- </script>
-
- <script>
- STOP_RUN = 'False'
- SNMP_PROPERTIES = {}
-
- testList = []
- testList.append(['.','snmp_setup'])
- testList.append(['.','snmp_defaultproperties'])
- testList.append(['.','snmp_v1_defaultconf'])
- testList.append(['.','snmp_v2c_defaultconf'])
- testList.append(['.','snmp_v3_defaultconf'])
- testList.append(['.','snmp_trap_defaultconf'])
- testList.append(['.','snmp_mibvalues'])
- testList.append(['.','snmp_v1_customconf'])
- testList.append(['.','snmp_v2c_customconf'])
- testList.append(['.','snmp_v3_customconf'])
- testList.append(['.','snmp_trap_customconf'])
- testList.append(['.','snmp_registermbean'])
- testList.append(['.','snmp_status'])
- testList.append(['.','snmp_cleanup'])
- </script>
-
- <iterate var="_test" in="testList">
-
- <if expr="STOP_RUN == 'False'">
- <sequence>
-
- <import machine="STAF_LOCAL_HOSTNAME"
- file="'%s/testcases/snmp/%s/%s.xml' %
- (TESTS_DIR,_test[0],_test[1])"/>
-
- <call function="'%s' % _test[1]" />
-
- </sequence>
- </if>
-
- </iterate>
-
- <!--- Desactivate the verbose mode -->
- <script>
- VERBOSE_MODE = 'false'
- </script>
-
- <call function="'testGroup_Postamble'"/>
-
- </sequence>
-
- </block>
-
- </sequence>
-
- </function>
-
-</stax>
diff --git a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_cleanup.xml b/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_cleanup.xml
deleted file mode 100644
index a5e4d7f..0000000
--- a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_cleanup.xml
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
-<!--
- ! CDDL HEADER START
- !
- ! The contents of this file are subject to the terms of the
- ! Common Development and Distribution License, Version 1.0 only
- ! (the "License"). You may not use this file except in compliance
- ! with the License.
- !
- ! You can obtain a copy of the license at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
- ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- ! See the License for the specific language governing permissions
- ! and limitations under the License.
- !
- ! When distributing Covered Code, include this CDDL HEADER in each
- ! file and include the License file at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- ! add the following below this CDDL HEADER, with the fields enclosed
- ! by brackets "[]" replaced with your own identifying information:
- ! Portions Copyright [yyyy] [name of copyright owner]
- !
- ! CDDL HEADER END
- !
- ! Copyright 2008 Sun Microsystems, Inc.
- ! -->
-<stax>
-
- <defaultcall function="snmp_cleanup"/>
-
- <function name="snmp_cleanup">
-
- <sequence>
-
- <block name="'snmp_cleanup'">
-
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName cleanup
- #@TestSuitePurpose Cleanup for the snmp test suite.
- #@TestSuiteGroup cleanup
- #@TestScript snmp_cleanup.xml
- -->
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'snmp'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Test Case information
- #@TestMarker cleanup
- #@TestName cleanup: stop DS
- #@TestIssue none
- #@TestPurpose Stop DS.
- #@TestPreamble none
- #@TestStep Stop DS.
- #@TestPostamble none
- #@TestResult Success if StopDsWithScript returns 0.
- -->
- <testcase name="getTestCaseName('cleanup: stop DS')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'cleanup: stop DS running on port %s' \
- % (DIRECTORY_INSTANCE_PORT)
- </message>
-
- <call function="'StopDsWithScript'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
- 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker cleanup
- #@TestName cleanup: remove DS topology
- #@TestIssue none
- #@TestPurpose Remove the topology created for
- the test suite.
- #@TestPreamble none
- #@TestStep Remove the topology created for
- the test suite.
- #@TestPostamble none
- #@TestResult Success if removeTopology returns 0.
- -->
- <testcase name="getTestCaseName('cleanup: remove DS topology')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'cleanup: remove DS topology created for the test suite'
- </message>
-
- <call function="'removeTopology'"/>
-
- <call function="'checktestRC'">
- {
- 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
- </block>
-
- </sequence>
-
- </function>
-
-</stax>
diff --git a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_defaultproperties.xml b/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_defaultproperties.xml
deleted file mode 100644
index 6bdb797..0000000
--- a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_defaultproperties.xml
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
-<!--
- ! CDDL HEADER START
- !
- ! The contents of this file are subject to the terms of the
- ! Common Development and Distribution License, Version 1.0 only
- ! (the "License"). You may not use this file except in compliance
- ! with the License.
- !
- ! You can obtain a copy of the license at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
- ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- ! See the License for the specific language governing permissions
- ! and limitations under the License.
- !
- ! When distributing Covered Code, include this CDDL HEADER in each
- ! file and include the License file at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- ! add the following below this CDDL HEADER, with the fields enclosed
- ! by brackets "[]" replaced with your own identifying information:
- ! Portions Copyright [yyyy] [name of copyright owner]
- !
- ! CDDL HEADER END
- !
- ! Copyright 2008 Sun Microsystems, Inc.
- ! -->
-<stax>
-
- <defaultcall function="snmp_defaultproperties"/>
-
- <function name="snmp_defaultproperties">
-
- <sequence>
-
- <block name="'snmp_defaultproperties'">
-
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName SNMP Connection Handler default properties
- #@TestSuitePurpose Check SNMP Connection Handler default properties.
- #@TestSuiteGroup SNMP Connection Handler default properties
- #@TestScript snmp_defaultproperties.xml
- -->
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'snmp'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Construct a table containing the expected properties -->
- <script>
- EXPECTED_PROPERTIES = {}
- EXPECTED_PROPERTIES['allowed-client'] = ''
- EXPECTED_PROPERTIES['allowed-manager'] = '*'
- EXPECTED_PROPERTIES['allowed-user'] = '*'
- EXPECTED_PROPERTIES['community'] = 'OpenDS'
- EXPECTED_PROPERTIES['denied-client'] = ''
- EXPECTED_PROPERTIES['enabled'] = 'false'
- EXPECTED_PROPERTIES['listen-address'] = '0.0.0.0'
- EXPECTED_PROPERTIES['listen-port'] = '161'
- EXPECTED_PROPERTIES['opendmk-jarfile'] = ''
- EXPECTED_PROPERTIES['registered-mbean'] = 'false'
- file = 'config/snmp/security/opends-snmp.security'
- EXPECTED_PROPERTIES['security-agent-file'] = '%s' % file
- EXPECTED_PROPERTIES['security-level'] = 'authnopriv'
- EXPECTED_PROPERTIES['trap-port'] = '162'
- EXPECTED_PROPERTIES['traps-community'] = 'OpenDS'
- EXPECTED_PROPERTIES['traps-destination'] = ''
- </script>
-
- <!--- Test Case information
- #@TestMarker SNMP Connection Handler default properties
- #@TestName snmp_defaultproperties: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('snmp_defaultproperties: check the default properties')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'snmp_defaultproperties: check the default properties'
- </message>
-
- <script>
- result = compare_property_table(EXPECTED_PROPERTIES,
- DEFAULT_PROPERTIES)
- </script>
-
- <message>
- '%s' % result
- </message>
-
- <call function="'checktestStringNotPresent'">
- {
- 'returnString' : result ,
- 'testString' : 'ERROR'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
- </block>
-
- </sequence>
-
- </function>
-
-</stax>
diff --git a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_mibvalues.xml b/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_mibvalues.xml
deleted file mode 100644
index 9ec8f10..0000000
--- a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_mibvalues.xml
+++ /dev/null
@@ -1,995 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
-<!--
- ! CDDL HEADER START
- !
- ! The contents of this file are subject to the terms of the
- ! Common Development and Distribution License, Version 1.0 only
- ! (the "License"). You may not use this file except in compliance
- ! with the License.
- !
- ! You can obtain a copy of the license at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
- ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- ! See the License for the specific language governing permissions
- ! and limitations under the License.
- !
- ! When distributing Covered Code, include this CDDL HEADER in each
- ! file and include the License file at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- ! add the following below this CDDL HEADER, with the fields enclosed
- ! by brackets "[]" replaced with your own identifying information:
- ! Portions Copyright [yyyy] [name of copyright owner]
- !
- ! CDDL HEADER END
- !
- ! Copyright 2008-2010 Sun Microsystems, Inc.
- ! Portions Copyright 2011 ForgeRock AS
- ! -->
-<stax>
-
- <defaultcall function="snmp_mibvalues"/>
-
- <function name="snmp_mibvalues">
-
- <sequence>
-
- <block name="'snmp_mibvalues'">
-
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName SNMP MIB values
- #@TestSuitePurpose Check SNMP MIB values.
- #@TestSuiteGroup SNMP MIB values
- #@TestScript snmp_mibvalues.xml
- -->
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'snmp'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Desactivate the verbose mode -->
- <script>
- VERBOSE_MODE = 'false'
- </script>
-
- <!-- Default values -->
- <script>
- community = '%s@%s' \
- % (SNMP_PROPERTIES['community'], SNMP_PROPERTIES['community'])
- nbLoop = 10
- </script>
-
- <!--- Test Case information
- #@TestMarker SNMP MIB values
- #@TestName snmp_mibvalues: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('snmp_mibvalues: check the connection handlers')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'snmp_mibvalues: save the snmp values'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'snmpOIDs' : '' ,
- 'snmpStatus' : 'noError' ,
- 'snmpWalk' : 'True'
- }
- </call>
-
- <script>
- DEFAULT_VALUES = create_table_fromoutput(STAXResult[0][1])
- </script>
-
- <message>
- 'snmp_mibvalues: check the connection handlers'
- </message>
-
- <script>
- nbHandler = get_handler_count(DEFAULT_VALUES)
- indexSNMP = get_handler_index(DEFAULT_VALUES, '1.3.6.1.27.3.%s'\
- % SNMP_PORT)
- indexLDAP = get_handler_index(DEFAULT_VALUES, '1.3.6.1.27.3.%s'\
- % DIRECTORY_INSTANCE_PORT)
- </script>
-
- <if expr="nbHandler == 2 and indexSNMP != 0 and indexLDAP != 0">
- <sequence>
- <script>
- msg1 = 'The connection handlers info are correct.\n'
- msg2 = 'number of hanlder: %s\n' % nbHandler
- msg3 = 'index SNMP hanlder: %s\n' % indexSNMP
- msg4 = 'index LDAP hanlder: %s\n' % indexLDAP
- msg = '%s%s%s%s' % (msg1, msg2, msg3, msg4)
- </script>
- <message>
- '%s' % msg
- </message>
- <tcstatus result="'pass'"></tcstatus>
- </sequence>
- <else>
- <sequence>
- <script>
- msg1 = 'The connection handlers info are wrong.\n'
- msg2 = 'number of hanlder: %s/3\n' % nbHandler
- msg3 = 'index SNMP hanlder: %s\n' % indexSNMP
- msg4 = 'index LDAP hanlder: %s\n' % indexLDAP
- msg = '%s%s%s%s' % (msg1, msg2, msg3, msg4)
- </script>
- <message>
- '%s' % msg
- </message>
- <tcstatus result="'fail'"></tcstatus>
- </sequence>
- </else>
- </if>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP MIB values
- #@TestName snmp_mibvalues: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('snmp_mibvalues: check value of dsServerType entry')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'snmp_mibvalues: check value of dsServerType entry'
- </message>
-
- <!-- Get the information about the server -->
- <call function="'GetVar'">
- { 'location' : STAF_REMOTE_HOSTNAME,
- 'type' : 'shared',
- 'variable' : 'Job%s_ServerInfo' % STAXParentID
- }
- </call>
-
- <if expr="RC != 0">
- <script>
- STAFResult='{}'
- </script>
- </if>
-
- <script>
- jobInfo=eval(STAFResult)
-
- # In IPS mode, DIRECTORY_INSTANCE_BIN is used
- # for installation path
- if IPS_PKG == True:
- instPath = DIRECTORY_INSTANCE_BIN
- else:
- instPath = DIRECTORY_INSTANCE_DIR
-
- if jobInfo.has_key('%s/%s' % (instPath,OPENDSNAME)):
- serverInformation=jobInfo['%s/%s' % (instPath,OPENDSNAME)]
- dsVersion=serverInformation['server version']
- dsBuild=serverInformation['server buildid']
- else:
- dsVersion='unknown'
- dsBuild='unknown'
-
- dsServer = '%s %s - %s' \
- % (PRODUCTNAME, dsVersion.rstrip(), dsBuild)
-
- dsServerType = DEFAULT_VALUES['dsServerType.1']
- </script>
-
- <if expr="dsServerType == dsServer">
- <sequence>
- <script>
- msg1 = 'Value for dsServerType entry is correct.\n'
- msg2 = 'Current value: %s' % dsServerType
- msg = '%s%s' % (msg1, msg2)
- </script>
- <message>
- '%s' % msg
- </message>
- <tcstatus result="'pass'"></tcstatus>
- </sequence>
- <else>
- <sequence>
- <script>
- msg1 = 'Value for dsServerType entry is wrong.\n'
- msg2 = 'Expected value: %s\n' % dsServer
- msg3 = 'Current value: %s' % dsServerType
- msg = '%s%s%s' % (msg1, msg2, msg3)
- </script>
- <message>
- '%s' % msg
- </message>
- <tcstatus result="'fail'"></tcstatus>
- </sequence>
- </else>
- </if>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP MIB values
- #@TestName snmp_mibvalues: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('snmp_mibvalues: check value of dsServerDescription entry')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'snmp_mibvalues: check value of dsServerDescription entry'
- </message>
-
- <script>
- dsServerDescription = DEFAULT_VALUES['dsServerDescription.1']
- dsPath = '%s/%s' % (DIRECTORY_INSTANCE_BIN, OPENDSNAME)
- if is_windows_platform(DIRECTORY_INSTANCE_HOST):
- dsPath = dsPath.replace('/', '\\')
- </script>
-
- <if expr="dsServerDescription == dsPath">
- <sequence>
- <script>
- msg1 = 'Value for dsServerDescription entry is correct.\n'
- msg2 = 'Current value: %s' % dsServerDescription
- msg = '%s%s' % (msg1, msg2)
- </script>
- <message>
- '%s' % msg
- </message>
- <tcstatus result="'pass'"></tcstatus>
- </sequence>
- <else>
- <sequence>
- <script>
- msg1 = 'Value for dsServerDescription entry is wrong.\n'
- msg2 = 'Expected value: %s\n' % dsPath
- msg3 = 'Current value: %s' % dsServerDescription
- msg = '%s%s%s' % (msg1, msg2, msg3)
- </script>
- <message>
- '%s' % msg
- </message>
- <tcstatus result="'fail'"></tcstatus>
- </sequence>
- </else>
- </if>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP MIB values
- #@TestName snmp_mibvalues: TODO
- #@TestIssue 3862
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('snmp_mibvalues: check value of dsApplIfSearchOps entry')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'snmp_mibvalues: do %s search operation' % nbLoop
- </message>
-
- <loop var="loop" from="1" to="nbLoop">
- <sequence>
-
- <script>
- id = 700 + loop
- userDn = 'uid=user.%s,o=snmp tests,dc=example,dc=com' % id
- </script>
-
- <message>
- 'LOOP %s: %s' % (loop, userDn)
- </message>
-
- <call function="'ldapSearchWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsTypesOnly' : 'True' ,
- 'dsBaseDN' : 'dc=com' ,
- 'dsFilter' : userDn
- }
- </call>
-
- </sequence>
- </loop>
-
- <message>
- 'snmp_mibvalues: increment the snmp values'
- </message>
-
- <script>
- key = 'dsApplIfReadOps.%s' % indexLDAP
- DEFAULT_VALUES[key] = \
- str(int(DEFAULT_VALUES[key]) + nbLoop)
- key = 'dsApplIfSearchOps.%s' % indexLDAP
- DEFAULT_VALUES[key] = \
- str(int(DEFAULT_VALUES[key]) + nbLoop)
- </script>
-
- <message>
- 'snmp_mibvalues: check value of dsApplIfSearchOps entry'
- </message>
-
- <call function="'compareSNMPValues'">
- {
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'index' : indexLDAP ,
- 'knownIssue' : '3862'
- }
- </call>
-
- <message>
- 'snmp_mibvalues: save the snmp values'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'snmpOIDs' : '' ,
- 'snmpStatus' : 'noError' ,
- 'snmpWalk' : 'True'
- }
- </call>
-
- <script>
- DEFAULT_VALUES = {}
- DEFAULT_VALUES = create_table_fromoutput(STAXResult[0][1])
- </script>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP MIB values
- #@TestName snmp_mibvalues: TODO
- #@TestIssue 3862
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('snmp_mibvalues: check value of dsApplIfAddEntryOps entry')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'snmp_mibvalues: do %s add operations' % nbLoop
- </message>
-
- <loop var="loop" from="1" to="nbLoop">
- <sequence>
-
- <script>
- id = 1000 + loop
- userDn = 'uid=user.%s,o=snmp tests,dc=example,dc=com' % id
-
- listAttr = []
- listAttr.append('objectclass:top')
- listAttr.append('objectclass:organizationalperson')
- listAttr.append('objectclass:inetorgperson')
- listAttr.append('objectclass:person')
- listAttr.append('givenname:Izen.0')
- listAttr.append('sn:Abizen.0')
- listAttr.append('cn:Izen Abizen.0')
- listAttr.append('l:ICNC')
- </script>
-
- <message>
- 'LOOP %s: %s' % (loop, userDn)
- </message>
-
- <call function="'addAnEntry'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToAdd' : userDn,
- 'listAttributes' : listAttr
- }
- </call>
-
- </sequence>
- </loop>
-
- <message>
- 'snmp_mibvalues: increment the snmp values'
- </message>
-
- <script>
- key = 'dsApplIfReadOps.%s' % indexLDAP
- DEFAULT_VALUES[key] = \
- str(int(DEFAULT_VALUES[key]) + nbLoop)
- key = 'dsApplIfAddEntryOps.%s' % indexLDAP
- DEFAULT_VALUES[key] = \
- str(int(DEFAULT_VALUES[key]) + nbLoop)
- DEFAULT_VALUES['dsMasterEntries.1'] = \
- str(int(DEFAULT_VALUES['dsMasterEntries.1']) + nbLoop)
- </script>
-
- <message>
- 'snmp_mibvalues: check value of dsApplIfAddEntryOps entry'
- </message>
-
- <call function="'compareSNMPValues'">
- {
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'index' : indexLDAP ,
- 'knownIssue' : '3862'
- }
- </call>
-
- <message>
- 'snmp_mibvalues: save the snmp values'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'snmpOIDs' : '' ,
- 'snmpStatus' : 'noError' ,
- 'snmpWalk' : 'True'
- }
- </call>
-
- <script>
- DEFAULT_VALUES = {}
- DEFAULT_VALUES = create_table_fromoutput(STAXResult[0][1])
- </script>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP MIB values
- #@TestName snmp_mibvalues: TODO
- #@TestIssue 3862
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('snmp_mibvalues: check value of dsApplIfRemoveEntryOps entry')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'snmp_mibvalues: do %s remove operations' % nbLoop
- </message>
-
- <loop var="loop" from="1" to="nbLoop">
- <sequence>
-
- <script>
- id = 1000 + loop
- userDn = 'uid=user.%s,o=snmp tests,dc=example,dc=com' % id
- </script>
-
- <message>
- 'LOOP %s: %s' % (loop, userDn)
- </message>
-
- <call function="'ldapDeleteWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsDn' : ['%s' % userDn]
- }
- </call>
-
- </sequence>
- </loop>
-
- <message>
- 'snmp_mibvalues: increment the snmp values'
- </message>
-
- <script>
- key = 'dsApplIfReadOps.%s' % indexLDAP
- DEFAULT_VALUES[key] = \
- str(int(DEFAULT_VALUES[key]) + nbLoop)
- key = 'dsApplIfRemoveEntryOps.%s' % indexLDAP
- DEFAULT_VALUES[key] = \
- str(int(DEFAULT_VALUES[key]) + nbLoop)
- DEFAULT_VALUES['dsMasterEntries.1'] = \
- str(int(DEFAULT_VALUES['dsMasterEntries.1']) - nbLoop)
- </script>
-
- <message>
- 'snmp_mibvalues: check value of dsApplIfRemoveEntryOps entry'
- </message>
-
- <call function="'compareSNMPValues'">
- {
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'index' : indexLDAP ,
- 'knownIssue' : '3862'
- }
- </call>
-
- <message>
- 'snmp_mibvalues: save the snmp values'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'snmpOIDs' : '' ,
- 'snmpStatus' : 'noError' ,
- 'snmpWalk' : 'True'
- }
- </call>
-
- <script>
- DEFAULT_VALUES = {}
- DEFAULT_VALUES = create_table_fromoutput(STAXResult[0][1])
- </script>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP MIB values
- #@TestName snmp_mibvalues: TODO
- #@TestIssue 3862
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('snmp_mibvalues: check value of dsApplIfCompareOps entry')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'snmp_mibvalues: do %s compare operations' % nbLoop
- </message>
-
- <loop var="loop" from="1" to="nbLoop">
- <sequence>
-
- <script>
- id = 0 + loop
- userDn = 'uid=user.%s,o=snmp tests,dc=example,dc=com' % id
- </script>
-
- <message>
- 'LOOP %s: %s' % (loop, userDn)
- </message>
-
- <call function="'ldapCompareWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsDn' : ['postalCode:64447', '%s' % userDn] ,
- 'expectedRC' : 'noCheck'
- }
- </call>
-
- </sequence>
- </loop>
-
- <message>
- 'snmp_mibvalues: increment the snmp values'
- </message>
-
- <script>
- key = 'dsApplIfReadOps.%s' % indexLDAP
- DEFAULT_VALUES[key] = \
- str(int(DEFAULT_VALUES[key]) + nbLoop)
- key = 'dsApplIfCompareOps.%s' % indexLDAP
- DEFAULT_VALUES[key] = \
- str(int(DEFAULT_VALUES[key]) + nbLoop)
- </script>
-
- <message>
- 'snmp_mibvalues: check value of dsApplIfCompareOps entry'
- </message>
-
- <call function="'compareSNMPValues'">
- {
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'index' : indexLDAP ,
- 'knownIssue' : '3862'
- }
- </call>
-
- <message>
- 'snmp_mibvalues: save the snmp values'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'snmpOIDs' : '' ,
- 'snmpStatus' : 'noError' ,
- 'snmpWalk' : 'True'
- }
- </call>
-
- <script>
- DEFAULT_VALUES = {}
- DEFAULT_VALUES = create_table_fromoutput(STAXResult[0][1])
- </script>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP MIB values
- #@TestName snmp_mibvalues: TODO
- #@TestIssue 3862
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('snmp_mibvalues: check value of dsApplIfModifyEntryOps entry')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'snmp_mibvalues: do %s modify operations' % nbLoop
- </message>
-
- <loop var="loop" from="1" to="nbLoop">
- <sequence>
-
- <script>
- id = 400 + loop
- userDn = 'uid=user.%s,o=snmp tests,dc=example,dc=com' % id
- </script>
-
- <message>
- 'LOOP %s: %s' % (loop, userDn)
- </message>
-
- <call function="'modifyAnAttribute'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'DNToModify' : userDn ,
- 'attributeName' : 'postalCode' ,
- 'newAttributeValue' : '%s' % id ,
- 'changetype' : 'replace'
- }
- </call>
-
- </sequence>
- </loop>
-
- <message>
- 'snmp_mibvalues: increment the snmp values'
- </message>
-
- <script>
- key = 'dsApplIfReadOps.%s' % indexLDAP
- DEFAULT_VALUES[key] = \
- str(int(DEFAULT_VALUES[key]) + nbLoop)
- key = 'dsApplIfModifyEntryOps.%s' % indexLDAP
- DEFAULT_VALUES[key] = \
- str(int(DEFAULT_VALUES[key]) + nbLoop)
- </script>
-
- <message>
- 'snmp_mibvalues: check value of dsApplIfModifyEntryOps entry'
- </message>
-
- <call function="'compareSNMPValues'">
- {
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'index' : indexLDAP ,
- 'knownIssue' : '3862'
- }
- </call>
-
- <message>
- 'snmp_mibvalues: save the snmp values'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'snmpOIDs' : '' ,
- 'snmpStatus' : 'noError' ,
- 'snmpWalk' : 'True'
- }
- </call>
-
- <script>
- DEFAULT_VALUES = {}
- DEFAULT_VALUES = create_table_fromoutput(STAXResult[0][1])
- </script>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP MIB values
- #@TestName snmp_mibvalues: TODO
- #@TestIssue 3862
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('snmp_mibvalues: check value of dsApplIfModifyRDNOps entry')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'snmp_mibvalues: do %s modify RDN operations' % nbLoop
- </message>
-
- <loop var="loop" from="1" to="nbLoop">
- <sequence>
-
- <!--- Create a ldif file for moddn -->
- <script>
- id = 800 + loop
- userDn = 'uid=user.%s,o=snmp tests,dc=example,dc=com' % id
- newid = 2000 + loop
- newDn = 'uid=user.%s' % newid
-
- templateFile = 'template-%s.ldif' % loop
- templatePath = '%s/%s' % (remote.temp, templateFile)
- ldifFile = 'moddn-%s.ldif' % loop
- ldifPath = '%s/%s' % (DIRECTORY_INSTANCE_DIR, ldifFile)
- ldifLines = []
- ldifLines.append('dn: %s' % userDn)
- ldifLines.append('changetype: moddn')
- ldifLines.append('newRDN: %s' % newDn)
- ldifLines.append('deleteOldRDN: 1')
- outFile = open(templatePath, "w")
- for line in ldifLines:
- outFile.write("%s\n" % line)
- outFile.close()
- </script>
-
- <message>
- 'LOOP %s: %s => %s' % (loop, userDn, newDn)
- </message>
-
- <!--- Copy file to remote host -->
- <message>
- 'Copy %s to %s on %s' \
- % (templateFile,DIRECTORY_INSTANCE_DIR,STAF_REMOTE_HOSTNAME)
- </message>
- <call function="'copyFile'">
- {
- 'srcfile' : templatePath ,
- 'destfile' : ldifPath ,
- 'remotehost' : STAF_REMOTE_HOSTNAME
- }
- </call>
-
- <call function="'ldapModifyWithScript'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'dsFilename' : ldifPath
- }
- </call>
-
- <!--- Delete the ldif file used for moddn on remote host -->
- <message>
- 'Delete %s on %s' % (ldifPath, STAF_REMOTE_HOSTNAME)
- </message>
- <call function="'deleteFile'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'filename' : ldifPath
- }
- </call>
-
- <!--- Delete locally the ldif file used for moddn -->
- <message>
- 'Delete locally %s' % templatePath
- </message>
- <call function="'deleteFile'">
- {
- 'location' : STAXServiceMachine ,
- 'filename' : templatePath
- }
- </call>
- </sequence>
- </loop>
-
- <message>
- 'snmp_mibvalues: increment the snmp values'
- </message>
-
- <script>
- key = 'dsApplIfReadOps.%s' % indexLDAP
- DEFAULT_VALUES[key] = \
- str(int(DEFAULT_VALUES[key]) + nbLoop)
- key = 'dsApplIfModifyRDNOps.%s' % indexLDAP
- DEFAULT_VALUES[key] = \
- str(int(DEFAULT_VALUES[key]) + nbLoop)
- </script>
-
- <message>
- 'snmp_mibvalues: check value of dsApplIfModifyRDNOps entry'
- </message>
-
- <call function="'compareSNMPValues'">
- {
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'index' : indexLDAP ,
- 'knownIssue' : '3862'
- }
- </call>
-
- <message>
- 'snmp_mibvalues: save the snmp values'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'snmpOIDs' : '' ,
- 'snmpStatus' : 'noError' ,
- 'snmpWalk' : 'True'
- }
- </call>
-
- <script>
- DEFAULT_VALUES = {}
- DEFAULT_VALUES = create_table_fromoutput(STAXResult[0][1])
- </script>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Activate the verbose mode -->
- <script>
- VERBOSE_MODE = 'true'
- </script>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
- </block>
-
- </sequence>
-
- </function>
-
-</stax>
diff --git a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_registermbean.xml b/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_registermbean.xml
deleted file mode 100644
index f907a89..0000000
--- a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_registermbean.xml
+++ /dev/null
@@ -1,246 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
-<!--
- ! CDDL HEADER START
- !
- ! The contents of this file are subject to the terms of the
- ! Common Development and Distribution License, Version 1.0 only
- ! (the "License"). You may not use this file except in compliance
- ! with the License.
- !
- ! You can obtain a copy of the license at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
- ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- ! See the License for the specific language governing permissions
- ! and limitations under the License.
- !
- ! When distributing Covered Code, include this CDDL HEADER in each
- ! file and include the License file at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- ! add the following below this CDDL HEADER, with the fields enclosed
- ! by brackets "[]" replaced with your own identifying information:
- ! Portions Copyright [yyyy] [name of copyright owner]
- !
- ! CDDL HEADER END
- !
- ! Copyright 2008 Sun Microsystems, Inc.
- ! -->
-<stax>
-
- <defaultcall function="snmp_registermbean"/>
-
- <function name="snmp_registermbean">
-
- <sequence>
-
- <block name="'snmp_registermbean'">
-
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName SNMP Connection Handler register mbean
- #@TestSuitePurpose Check SNMP Connection Handler register mbean.
- #@TestSuiteGroup SNMP Connection Handler register mbean.
- #@TestScript snmp_registermbean.xml
- -->
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'snmp'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default values -->
- <script>
- refRegisteredMbeanProp = SNMP_PROPERTIES['registered-mbean']
- defCommunityProp = SNMP_PROPERTIES['community']
- defCommunity = '%s@%s' %(defCommunityProp, defCommunityProp)
- oid = 'dsServerType.1'
- </script>
-
- <!--- Test Case information
- #@TestMarker SNMP Connection Handler register mbean
- #@TestName registermbean: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('registermbean: check that there is no error at startup')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'registermbean: set the register-mbean property to true'
- </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 registered-mbean:true'
- }
- </call>
-
- <message>
- 'status: restart DS running on port %s' \
- % (DIRECTORY_INSTANCE_PORT)
- </message>
- <call function="'StopDsWithScript'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
- 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <!--- Check that DS started -->
- <call function="'isAlive'">
- {
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
-
- <call function="'checktestStringNotPresent'">
- {
- 'returnString' : returnString ,
- 'testString' : 'category=PROTOCOL severity=SEVERE_ERROR'
- }
- </call>
-
- <message>
- 'registermbean: get to check the SNMPConnection Handler'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : defCommunity ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError'
- }
- </call>
-
- <message>
- 'registermbean: restore the register-mbean property'
- </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 registered-mbean:%s' \
- % refRegisteredMbeanProp
- }
- </call>
-
- <message>
- 'registermbean: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP Connection Handler register mbean
- #@TestName registermbean: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('registermbean: set the register-mbean property to a wrong value')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'registermbean: set register-mbean property to a wrong value'
- </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 registered-mbean:myValue' ,
- 'expectedRC' : 1
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- msg1 = 'The value "myValue" is not a valid value for the'
- msg2 = 'SNMP Connection Handler\nproperty "registered-mbean"'
- msg3 = 'which has the following syntax: false | true'
- msg = '%s %s %s' % (msg1, msg2, msg3)
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
- </block>
-
- </sequence>
-
- </function>
-
-</stax>
diff --git a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_setup.xml b/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_setup.xml
deleted file mode 100644
index 575bd8d..0000000
--- a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_setup.xml
+++ /dev/null
@@ -1,482 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
-<!--
- ! CDDL HEADER START
- !
- ! The contents of this file are subject to the terms of the
- ! Common Development and Distribution License, Version 1.0 only
- ! (the "License"). You may not use this file except in compliance
- ! with the License.
- !
- ! You can obtain a copy of the license at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
- ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- ! See the License for the specific language governing permissions
- ! and limitations under the License.
- !
- ! When distributing Covered Code, include this CDDL HEADER in each
- ! file and include the License file at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- ! add the following below this CDDL HEADER, with the fields enclosed
- ! by brackets "[]" replaced with your own identifying information:
- ! Portions Copyright [yyyy] [name of copyright owner]
- !
- ! CDDL HEADER END
- !
- ! Copyright 2008-2010 Sun Microsystems, Inc.
- ! Portions Copyright 2011 ForgeRock AS
-! -->
-<stax>
-
- <defaultcall function="snmp_setup" />
-
- <function name="snmp_setup">
-
- <sequence>
-
- <block name="'snmp_setup'">
-
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName setup
- #@TestSuitePurpose Setup for the snmp test suite.
- #@TestSuiteGroup setup
- #@TestScript snmp_setup.xml
- -->
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'snmp'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default value for manager -->
- <script>
- snmpPath = '%s/snmp' % remote.java,
- opendmkPath = '%s/jdmkrt.jar' % snmpPath
- </script>
-
- <!--- Test Case information
- #@TestMarker setup
- #@TestName setup: create DS topology
- #@TestIssue none
- #@TestPurpose Create the topology necessary to the
- test suite.
- #@TestPreamble none
- #@TestStep Create DS topology as described in config.py.
- #@TestPostamble none
- #@TestResult Success if createTopology returns 0.
- -->
- <testcase name="getTestCaseName('setup: create DS tpology')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'setup: create DS topology as described in config.py'
- </message>
-
- <call function="'createTopology'">
- { 'initialiseInstance' : False }
- </call>
-
- <call function="'checktestRC'">
- {
- 'returncode' : RC ,
- 'result' : STAXResult
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!-- Check if 'opendmkPath' exists -->
- <call function="'GetEntry'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'entry' : opendmkPath ,
- 'attribute' : 'TYPE'
- }
- </call>
- <!-- 'opendmkPath' exists so we can continue -->
- <if expr="RC != 48 or not PRODUCTNAME.startswith('OpenDJ')">
- <sequence>
-
- <!--- Test Case information
- #@TestMarker setup
- #@TestName setup: start DS
- #@TestIssue none
- #@TestPurpose Start DS.
- #@TestPreamble none
- #@TestStep Start the server.
- #@TestStep Check that the server is alive.
- #@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>
diff --git a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_status.xml b/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_status.xml
deleted file mode 100644
index 2b0c084..0000000
--- a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_status.xml
+++ /dev/null
@@ -1,858 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
-<!--
- ! CDDL HEADER START
- !
- ! The contents of this file are subject to the terms of the
- ! Common Development and Distribution License, Version 1.0 only
- ! (the "License"). You may not use this file except in compliance
- ! with the License.
- !
- ! You can obtain a copy of the license at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
- ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- ! See the License for the specific language governing permissions
- ! and limitations under the License.
- !
- ! When distributing Covered Code, include this CDDL HEADER in each
- ! file and include the License file at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- ! add the following below this CDDL HEADER, with the fields enclosed
- ! by brackets "[]" replaced with your own identifying information:
- ! Portions Copyright [yyyy] [name of copyright owner]
- !
- ! CDDL HEADER END
- !
- ! Copyright 2008-2010 Sun Microsystems, Inc.
- ! -->
-<stax>
-
- <defaultcall function="snmp_status"/>
-
- <function name="snmp_status">
-
- <sequence>
-
- <block name="'snmp_status'">
-
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName SNMP Connection Handler status
- #@TestSuitePurpose Check SNMP Connection Handler status.
- #@TestSuiteGroup SNMP Connection Handler status
- #@TestScript snmp_status.xml
- -->
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'snmp'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default values -->
- <script>
- community = '%s@%s' \
- % (SNMP_PROPERTIES['community'], SNMP_PROPERTIES['community'])
- oid = 'dsServerType.1'
- serverLogFile = '%s/%s/logs/server.out' \
- % (DIRECTORY_INSTANCE_DIR, OPENDSNAME)
- </script>
-
- <!--- Test Case information
- #@TestMarker SNMP Connection Handler status
- #@TestName status: check status when the server is
- stopped/started
- #@TestIssue none
- #@TestPurpose Check status when the server is
- stopped/started.
- #@TestPreamble none
- #@TestStep stop the server
- #@TestStep check status using status command
- #@TestStep start the server
- #@TestStep check status using status command
- #@TestStep do a SNMP get request to check that the
- connection handler
- #@TestPostamble none
- #@TestResult Success if output of status is correct.
- -->
- <testcase name="getTestCaseName
- ('status: status when the server is stopped/started')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'status: stop DS running on port %s' \
- % (DIRECTORY_INSTANCE_PORT)
- </message>
-
- <call function="'StopDsWithScript'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
- 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <message>
- 'status: status when the server is stopped'
- </message>
-
- <call function="'StatusWithScript'">
- {
- 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchString'">
- {
- 'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
- % SNMP_PORT ,
- 'returnString' : returnString ,
- 'expectedRC' : 0
- }
- </call>
-
- <message>
- 'status: start DS to run on port %s' \
- % (DIRECTORY_INSTANCE_PORT)
- </message>
-
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
- <!--- Check that DS started -->
- <call function="'isAlive'">
- {
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
-
- <message>
- 'status: status when the server is started'
- </message>
-
- <call function="'StatusWithScript'">
- {
- 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchString'">
- {
- 'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
- % SNMP_PORT ,
- 'returnString' : returnString ,
- 'expectedRC' : 0
- }
- </call>
-
- <message>
- 'status: get request'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP Connection Handler status
- #@TestName status: check status when the connection
- handler is disabled/enabled
- #@TestIssue none
- #@TestPurpose Check status when the SNMP connection handler
- is disabled/enabled.
- #@TestPreamble none
- #@TestStep disable the SNMP connection handler
- #@TestStep check status using status command
- #@TestStep enable the SNMP connection handler
- #@TestStep check status using status command
- #@TestPostamble none
- #@TestResult Success if output of status is correct.
- -->
- <testcase name="getTestCaseName
- ('status: status when SNMP Connection Handler is disabled/enabled')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'status: disable the 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:false'
- }
- </call>
-
- <message>
- 'status: status when the 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="'searchString'">
- {
- 'expectedString' : '0.0.0.0:%s : SNMP : Disabled' \
- % SNMP_PORT ,
- 'returnString' : returnString ,
- 'expectedRC' : 0
- }
- </call>
-
- <message>
- 'status: get request'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'reqTimeout'
- }
- </call>
-
- <message>
- 'status: enable the 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'
- }
- </call>
-
- <message>
- 'status: status when the 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="'searchString'">
- {
- 'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
- % SNMP_PORT ,
- 'returnString' : returnString ,
- 'expectedRC' : 0
- }
- </call>
-
- <message>
- 'status: get request'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP Connection Handler status
- #@TestName status: check error message and status when
- the opendmk-jarfile property is set to a
- wrong value
- #@TestIssue 3943
- #@TestPurpose Check error message and status when
- the opendmk-jarfile property is set to a
- wrong value.
- #@TestPreamble none
- #@TestStep set opendmk-jarfile property to a wrong value
- #@TestStep restart the server
- #@TestStep check that an error message is displayed at
- startup
- #@TestStep check status using status command
- #@TestStep restore value for opendmk-jarfile property
- #@TestStep disable the SNMP connection handler
- #@TestStep enable the SNMP connection handler
- #@TestPostamble none
- #@TestResult Success if an error message is displayed and
- if the output of status is correct.
- -->
- <testcase name="getTestCaseName
- ('status: status with a wrong opendmk-jarfile value')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'status: set opendmk-jarfile property to a wrong value'
- </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 opendmk-jarfile:wrong_file'
- }
- </call>
-
- <message>
- 'status: restart DS running on port %s' \
- % (DIRECTORY_INSTANCE_PORT)
- </message>
- <call function="'StopDsWithScript'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
- 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
- <!--- Check that DS started -->
- <call function="'isAlive'">
- {
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
-
- <script>
- opendmkJarFile = '%s/%s/wrong_file' \
- % (DIRECTORY_INSTANCE_DIR, OPENDSNAME)
- if is_windows_platform(DIRECTORY_INSTANCE_HOST):
- opendmkJarFile = opendmkJarFile.replace('/', '\\')
-
- msg1 = 'The specified OpenDMK jar file'
- msg2 = '\'%s\' could not be found.' % opendmkJarFile
- msg3 = 'Verify that the value set in the opendmk-jarfile'
- msg4 = 'configuration parameter of the SNMP connection handler'
- msg5 = 'is the valid path to the jdmkrt.jar file and that the'
- msg6 = 'file is accessible'
- msg = '%s %s %s %s %s %s' % (msg1, msg2, msg3, msg4, msg5, msg6)
- </script>
-
- <call function="'grep'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'filename' : serverLogFile ,
- 'testString': msg
- }
- </call>
-
- <call function="'setKnownIssue'">
- { 'issueId' : '3943' }
- </call>
-
- <message>
- 'status: status when the server is started'
- </message>
-
- <call function="'StatusWithScript'">
- {
- 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchString'">
- {
- 'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
- % SNMP_PORT ,
- 'returnString' : returnString ,
- 'expectedRC' : 0
- }
- </call>
-
- <message>
- 'status: get request'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'reqTimeout'
- }
- </call>
-
- <message>
- 'status: restore value for opendmk-jarfile property'
- </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 opendmk-jarfile:%s' \
- % SNMP_PROPERTIES['opendmk-jarfile']
- }
- </call>
-
- <message>
- 'status: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP Connection Handler status
- #@TestName status: check error message and status when
- the security-agent-file property is set to a
- wrong value
- #@TestIssue none
- #@TestPurpose Check error message and status when
- the security-agent-file property is set to a
- wrong value.
- #@TestPreamble none
- #@TestStep set security-agent-file property to a wrong
- value
- #@TestStep restart the server
- #@TestStep check that an error message is displayed at
- startup
- #@TestStep check status using status command
- #@TestStep restore value for security-agent-file property
- #@TestStep disable the SNMP connection handler
- #@TestStep enable the SNMP connection handler
- #@TestPostamble none
- #@TestResult Success if an error message is displayed and
- if the output of status is correct.
- -->
- <testcase name="getTestCaseName
- ('status: status with a wrong security-agent-file value')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'status: set the security-agent-file to a wrong value'
- </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 security-agent-file:wrong_file'
- }
- </call>
-
- <message>
- 'status: restart DS running on port %s' \
- % (DIRECTORY_INSTANCE_PORT)
- </message>
- <call function="'StopDsWithScript'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
- 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
- <!--- Check that DS started -->
- <call function="'isAlive'">
- {
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
-
- <script>
- msg1 = 'Cannot initialize the SNMP Connection Handler.'
- msg2 = 'Please check the configuration attributes'
- msg = '%s %s' % (msg1, msg2)
- </script>
-
- <call function="'grep'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'filename' : serverLogFile ,
- 'testString': msg
- }
- </call>
-
- <script>
- msg1 = 'You do not have the appropriated OpenDMK jar files to'
- msg2 = 'enable the SNMP Connection Handler. Please go under'
- msg3 = 'http:\/\/opendmk.dev.java.net and set the'
- msg4 = 'ds-cfg-opendmk-jarfile configuration parameter to set'
- msg5 = 'the full path of the required jdmkrt.jar file.'
- msg6 = 'The SNMP connection Handler didn\'t started'
- msg = '%s %s %s %s %s %s' % (msg1, msg2, msg3, msg4, msg5, msg6)
- </script>
-
- <call function="'grep'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'filename' : serverLogFile ,
- 'testString' : msg ,
- 'expectedRC' : 1
- }
- </call>
-
- <message>
- 'status: status when the server is started'
- </message>
-
- <call function="'StatusWithScript'">
- {
- 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchString'">
- {
- 'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
- % SNMP_PORT ,
- 'returnString' : returnString ,
- 'expectedRC' : 0
- }
- </call>
-
- <message>
- 'status: get request'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'reqTimeout'
- }
- </call>
-
- <message>
- 'status: restore value for security-agent-file property'
- </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 security-agent-file:%s' \
- % SNMP_PROPERTIES['security-agent-file']
- }
- </call>
-
- <message>
- 'status: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP Connection Handler status
- #@TestName status: check error message and status when
- the listen-port property is set to a wrong
- value
- #@TestIssue none
- #@TestPurpose Check error message and status when
- the listen-port property is set to a wrong
- value.
- #@TestPreamble none
- #@TestStep set listen-port property to a wrong value
- #@TestStep restart the server
- #@TestStep check that an error message is displayed at
- startup
- #@TestStep check status using status command
- #@TestStep restore value for listen-port property
- #@TestStep disable the SNMP connection handler
- #@TestStep enable the SNMP connection handler
- #@TestPostamble none
- #@TestResult Success if an error message is displayed and
- if the output of status is correct.
- -->
- <testcase name="getTestCaseName
- ('status: status with a wrong listen-port value')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <!-- This testcase is not relevant on Windows and in IPS mode -->
- <script>
- if is_windows_platform(STAF_REMOTE_HOSTNAME) or IPS_PKG:
- skip=1
- else:
- skip=0
- </script>
-
- <if expr="skip == 0">
- <sequence>
- <message>
- 'status: set the listen-port to a wrong value'
- </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 listen-port:%s' \
- % DEFAULT_PROPERTIES['listen-port']
- }
- </call>
-
- <message>
- 'status: restart DS running on port %s' \
- % (DIRECTORY_INSTANCE_PORT)
- </message>
- <call function="'StopDsWithScript'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
- 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
- <!--- Check that DS started -->
- <call function="'isAlive'">
- {
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
-
- <script>
- msg1 = 'Cannot initialize the SNMP Connection Handler.'
- msg2 = 'Please check the configuration attributes'
- msg = '%s %s' % (msg1, msg2)
- </script>
-
- <call function="'grep'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'filename' : serverLogFile ,
- 'testString': msg
- }
- </call>
-
- <message>
- 'status: status when the server is started'
- </message>
-
- <call function="'StatusWithScript'">
- {
- 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- </script>
-
- <call function="'searchString'">
- {
- 'expectedString' : '0.0.0.0:%s : SNMP : Enabled' \
- % DEFAULT_PROPERTIES['listen-port'] ,
- 'returnString' : returnString ,
- 'expectedRC' : 0
- }
- </call>
-
- <message>
- 'status: get request'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'reqTimeout'
- }
- </call>
-
- <message>
- 'status: restore value for listen-port property'
- </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 listen-port:%s' \
- % SNMP_PROPERTIES['listen-port']
- }
- </call>
-
- <message>
- 'status: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
- </sequence>
- <else>
- <sequence>
- <message>'This testcase is not relevant on Windows'</message>
- <tcstatus result="'pass'"/>
- </sequence>
- </else>
- </if>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
- </block>
-
- </sequence>
-
- </function>
-
-</stax>
diff --git a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_trap_customconf.xml b/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_trap_customconf.xml
deleted file mode 100644
index 6bf1fe8..0000000
--- a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_trap_customconf.xml
+++ /dev/null
@@ -1,948 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
-<!--
- ! CDDL HEADER START
- !
- ! The contents of this file are subject to the terms of the
- ! Common Development and Distribution License, Version 1.0 only
- ! (the "License"). You may not use this file except in compliance
- ! with the License.
- !
- ! You can obtain a copy of the license at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
- ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- ! See the License for the specific language governing permissions
- ! and limitations under the License.
- !
- ! When distributing Covered Code, include this CDDL HEADER in each
- ! file and include the License file at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- ! add the following below this CDDL HEADER, with the fields enclosed
- ! by brackets "[]" replaced with your own identifying information:
- ! Portions Copyright [yyyy] [name of copyright owner]
- !
- ! CDDL HEADER END
- !
- ! Copyright 2008-2010 Sun Microsystems, Inc.
- ! -->
-<stax>
-
- <defaultcall function="snmp_trap_customconf"/>
-
- <function name="snmp_trap_customconf">
-
- <sequence>
-
- <block name="'snmp_trap_customconf'">
-
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName SNMP trap with custom configuration
- #@TestSuitePurpose Check SNMP trap with custom configuration.
- #@TestSuiteGroup SNMP trap with custom configuration
- #@TestScript snmp_trap_customconf.xml
- -->
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'snmp'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default values -->
- <script>
- defTrapsCommunityProp = '%s' % SNMP_PROPERTIES['traps-community']
- newTrapsCommunityProp = 'myCommunity'
- newTrapsDestProp = DIRECTORY_INSTANCE_HOST
- wrongTrapsDestProp = 'wrongtrapdestination'
- outputFile2 = '%s/timer.out' % DIRECTORY_INSTANCE_DIR
- timerDuration2 = '5m'
- serverLogFile = '%s/%s/logs/server.out' \
- % (DIRECTORY_INSTANCE_DIR, OPENDSNAME)
- </script>
-
- <!--- Test Case information
- #@TestMarker SNMP trap with custom configuration
- #@TestName trap_customconf: TODO
- #@TestIssue 3435
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('trap_customconf: change the community property')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'trap_customconf: change the community property'
- </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 traps-community:%s' \
- % newTrapsCommunityProp
- }
- </call>
-
- <message>
- 'trap_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <timer duration="timerDuration2">
- <sequence>
- <parallel>
- <sequence>
- <message>
- 'trap_customconf: run the trap listener'
- </message>
-
- <call function="'SNMPTrapListener'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpTrapPort' : SNMP_TRAP_PORT ,
- 'snmpTrapCommunity' : defTrapsCommunityProp ,
- 'snmpTrapNumber' : '0,2,0,0,0,0' ,
- 'outputFile' : outputFile2 ,
- 'knownIssue' : '3435'
- }
- </call>
- </sequence>
- <sequence>
- <message>
- 'trap_customconf: wait event from the trap listener'
- </message>
-
- <call function="'WaitEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SNMPTrapListener/Ready'
- }
- </call>
-
- <message>
- 'trap_customconf: delete event from the trap listener'
- </message>
- <call function="'DeleteEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SNMPTrapListener/Ready'
- }
- </call>
-
- <message>
- 'trap_defaultconf: restart the server'
- </message>
- <call function="'StopDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
- <!--- Check that DS started -->
- <call function="'isAlive'">
- {
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
-
- <message>
- 'trap_customconf: send event to the trap listener'
- </message>
-
- <call function="'SendEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SendTrap/Complete'
- }
- </call>
- </sequence>
- </parallel>
- </sequence>
- </timer>
-
- <script>timerRC2 = RC</script>
-
- <call function="'checkTimerResult'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'outputFile' : outputFile2 ,
- 'timerDuration' : timerDuration2 ,
- 'timerRC' : timerRC2
- }
- </call>
-
- <timer duration="timerDuration2">
- <sequence>
- <parallel>
- <sequence>
- <message>
- 'trap_customconf: run the trap listener'
- </message>
-
- <call function="'SNMPTrapListener'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpTrapPort' : SNMP_TRAP_PORT ,
- 'snmpTrapCommunity' : newTrapsCommunityProp ,
- 'snmpTrapNumber' : '2,0,0,0,0,0' ,
- 'outputFile' : outputFile2 ,
- 'knownIssue' : '3435'
- }
- </call>
- </sequence>
- <sequence>
- <message>
- 'trap_customconf: wait event from the trap listener'
- </message>
-
- <call function="'WaitEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SNMPTrapListener/Ready'
- }
- </call>
-
- <message>
- 'trap_customconf: delete event from the trap listener'
- </message>
- <call function="'DeleteEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SNMPTrapListener/Ready'
- }
- </call>
-
- <message>
- 'trap_defaultconf: restart the server'
- </message>
- <call function="'StopDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
- <!--- Check that DS started -->
- <call function="'isAlive'">
- {
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
-
- <message>
- 'trap_customconf: send event to the trap listener'
- </message>
-
- <call function="'SendEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SendTrap/Complete'
- }
- </call>
- </sequence>
- </parallel>
- </sequence>
- </timer>
-
- <script>timerRC2 = RC</script>
-
- <call function="'checkTimerResult'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'outputFile' : outputFile2 ,
- 'timerDuration' : timerDuration2 ,
- 'timerRC' : timerRC2
- }
- </call>
-
- <message>
- 'trap_customconf: restore the traps-community property'
- </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 traps-community:%s' \
- % defTrapsCommunityProp
- }
- </call>
-
- <message>
- 'trap_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP trap with custom configuration
- #@TestName trap_customconf: TODO
- #@TestIssue 3435
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('trap_customconf: set traps-destination property to correct value')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'trap_customconf: change the traps-destination property'
- </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 traps-destination:%s' \
- % newTrapsDestProp
- }
- </call>
-
- <message>
- 'trap_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <timer duration="timerDuration2">
- <sequence>
- <parallel>
- <sequence>
- <message>
- 'trap_customconf: run the trap listener'
- </message>
-
- <call function="'SNMPTrapListener'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpTrapPort' : SNMP_TRAP_PORT ,
- 'snmpTrapCommunity' : defTrapsCommunityProp ,
- 'snmpTrapNumber' : '2,0,0,0,0,0' ,
- 'outputFile' : outputFile2 ,
- 'knownIssue' : '3435'
- }
- </call>
- </sequence>
- <sequence>
- <message>
- 'trap_customconf: wait event from the trap listener'
- </message>
-
- <call function="'WaitEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SNMPTrapListener/Ready'
- }
- </call>
-
- <message>
- 'trap_customconf: delete event from the trap listener'
- </message>
- <call function="'DeleteEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SNMPTrapListener/Ready'
- }
- </call>
-
- <message>
- 'trap_defaultconf: restart the server'
- </message>
- <call function="'StopDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
- <!--- Check that DS started -->
- <call function="'isAlive'">
- {
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
-
- <message>
- 'trap_customconf: send event to the trap listener'
- </message>
-
- <call function="'SendEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SendTrap/Complete'
- }
- </call>
- </sequence>
- </parallel>
- </sequence>
- </timer>
-
- <script>timerRC2 = RC</script>
-
- <call function="'checkTimerResult'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'outputFile' : outputFile2 ,
- 'timerDuration' : timerDuration2 ,
- 'timerRC' : timerRC2
- }
- </call>
-
- <message>
- 'trap_customconf: restore the traps-destination property'
- </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' : '--reset traps-destination'
- }
- </call>
-
- <message>
- 'trap_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP trap with custom configuration
- #@TestName trap_customconf: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('trap_customconf: set traps-destination property to a wrong value')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'trap_customconf: change the traps-destination property'
- </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 traps-destination:%s' \
- % wrongTrapsDestProp
- }
- </call>
-
- <message>
- 'trap_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <timer duration="timerDuration2">
- <sequence>
- <parallel>
- <sequence>
- <message>
- 'trap_customconf: run the trap listener'
- </message>
-
- <call function="'SNMPTrapListener'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpTrapPort' : SNMP_TRAP_PORT ,
- 'snmpTrapCommunity' : defTrapsCommunityProp ,
- 'snmpTrapNumber' : '0,0,0,0,0,0' ,
- 'outputFile' : outputFile2
- }
- </call>
- </sequence>
- <sequence>
- <message>
- 'trap_customconf: wait event from the trap listener'
- </message>
-
- <call function="'WaitEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SNMPTrapListener/Ready'
- }
- </call>
-
- <message>
- 'trap_customconf: delete event from the trap listener'
- </message>
- <call function="'DeleteEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SNMPTrapListener/Ready'
- }
- </call>
-
- <message>
- 'trap_defaultconf: restart the server'
- </message>
- <call function="'StopDsWithScript'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
- 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
- <!--- Check that DS started -->
- <call function="'isAlive'">
- {
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
-
- <script>
- msg1 = 'Traps Destination %s is an unknown host.' \
- % wrongTrapsDestProp
- msg2 = 'Traps will not be sent to this destination'
- msg = '%s %s' % (msg1, msg2)
- </script>
-
- <call function="'grep'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'filename' : serverLogFile ,
- 'testString': msg
- }
- </call>
-
- <script>
- msg1 = 'No valid trap destinations has been found.'
- msg2 = 'No trap will be sent'
- msg = '%s %s' % (msg1, msg2)
- </script>
-
- <call function="'grep'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'filename' : serverLogFile ,
- 'testString': msg
- }
- </call>
-
- <message>
- 'trap_customconf: send event to the trap listener'
- </message>
-
- <call function="'SendEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SendTrap/Complete'
- }
- </call>
- </sequence>
- </parallel>
- </sequence>
- </timer>
-
- <script>timerRC2 = RC</script>
-
- <call function="'checkTimerResult'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'outputFile' : outputFile2 ,
- 'timerDuration' : timerDuration2 ,
- 'timerRC' : timerRC2
- }
- </call>
-
- <message>
- 'trap_customconf: restore the traps-destination property'
- </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' : '--reset traps-destination'
- }
- </call>
-
- <message>
- 'trap_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP trap with custom configuration
- #@TestName trap_customconf: TODO
- #@TestIssue 3435
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('trap_customconf: set traps-destination property to a list')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'trap_customconf: set traps-destination property to a list'
- </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 traps-destination:%s' \
- % wrongTrapsDestProp
- }
- </call>
- <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 traps-destination:%s' \
- % newTrapsDestProp
- }
- </call>
-
- <message>
- 'trap_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <timer duration="timerDuration2">
- <sequence>
- <parallel>
- <sequence>
- <message>
- 'trap_customconf: run the trap listener'
- </message>
-
- <call function="'SNMPTrapListener'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpTrapPort' : SNMP_TRAP_PORT ,
- 'snmpTrapCommunity' : defTrapsCommunityProp ,
- 'snmpTrapNumber' : '2,0,0,0,0,0' ,
- 'outputFile' : outputFile2 ,
- 'knownIssue' : '3435'
- }
- </call>
- </sequence>
- <sequence>
- <message>
- 'trap_customconf: wait event from the trap listener'
- </message>
-
- <call function="'WaitEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SNMPTrapListener/Ready'
- }
- </call>
-
- <message>
- 'trap_customconf: delete event from the trap listener'
- </message>
- <call function="'DeleteEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SNMPTrapListener/Ready'
- }
- </call>
-
- <message>
- 'trap_defaultconf: restart the server'
- </message>
- <call function="'StopDsWithScript'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'dsHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsAdminPort' : DIRECTORY_INSTANCE_ADMIN_PORT ,
- 'dsBindDN' : DIRECTORY_INSTANCE_DN ,
- 'dsBindPwd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
- <!--- Check that DS started -->
- <call function="'isAlive'">
- {
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
-
- <script>
- msg1 = 'Traps Destination %s is an unknown host.' \
- % wrongTrapsDestProp
- msg2 = 'Traps will not be sent to this destination'
- msg = '%s %s' % (msg1, msg2)
- </script>
-
- <call function="'grep'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'filename' : serverLogFile ,
- 'testString': msg
- }
- </call>
-
- <message>
- 'trap_customconf: send event to the trap listener'
- </message>
-
- <call function="'SendEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SendTrap/Complete'
- }
- </call>
- </sequence>
- </parallel>
- </sequence>
- </timer>
-
- <script>timerRC2 = RC</script>
-
- <call function="'checkTimerResult'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'outputFile' : outputFile2 ,
- 'timerDuration' : timerDuration2 ,
- 'timerRC' : timerRC2
- }
- </call>
-
- <message>
- 'trap_customconf: restore the traps-destination property'
- </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' : '--reset traps-destination'
- }
- </call>
-
- <message>
- 'trap_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP trap with custom configuration
- #@TestName trap_customconf: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('trap_customconf: set the traps-community property to a list')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'trap_customconf: set the traps-community property to a list'
- </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' : '--add traps-community:%s' \
- % newTrapsCommunityProp ,
- 'expectedRC' : 1
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
-
- returnString = STAXResult[0][1]
- msg1 = 'It is not possible to specify multiple values for the'
- msg2 = 'SNMP Connection Handler%sproperty "traps-community"' \
- % newLine
- msg3 = 'as it is single-valued'
- msg = '%s %s %s' % (msg1, msg2, msg3)
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
- </block>
-
- </sequence>
-
- </function>
-
-</stax>
diff --git a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_trap_defaultconf.xml b/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_trap_defaultconf.xml
deleted file mode 100644
index 85fe545..0000000
--- a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_trap_defaultconf.xml
+++ /dev/null
@@ -1,399 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
-<!--
- ! CDDL HEADER START
- !
- ! The contents of this file are subject to the terms of the
- ! Common Development and Distribution License, Version 1.0 only
- ! (the "License"). You may not use this file except in compliance
- ! with the License.
- !
- ! You can obtain a copy of the license at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
- ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- ! See the License for the specific language governing permissions
- ! and limitations under the License.
- !
- ! When distributing Covered Code, include this CDDL HEADER in each
- ! file and include the License file at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- ! add the following below this CDDL HEADER, with the fields enclosed
- ! by brackets "[]" replaced with your own identifying information:
- ! Portions Copyright [yyyy] [name of copyright owner]
- !
- ! CDDL HEADER END
- !
- ! Copyright 2008-2010 Sun Microsystems, Inc.
- ! -->
-<stax>
-
- <defaultcall function="snmp_trap_defaultconf"/>
-
- <function name="snmp_trap_defaultconf">
-
- <sequence>
-
- <block name="'snmp_trap_defaultconf'">
-
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName SNMP trap with default configuration
- #@TestSuitePurpose Check SNMP trap with default configuration.
- #@TestSuiteGroup SNMP trap with default configuration
- #@TestScript snmp_trap_defaultconf.xml
- -->
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'snmp'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default value for community -->
- <script>
- trapsCommunity = '%s' % SNMP_PROPERTIES['traps-community']
- outputFile = '%s/timer.out' % DIRECTORY_INSTANCE_DIR
- timerDuration = '5m'
- </script>
-
- <!--- Test Case information
- #@TestMarker SNMP trap with default configuration
- #@TestName trap_defaultconf: trap on stop-ds
- #@TestIssue 3435
- #@TestPurpose Check that a trap is sent on default trap
- community after stop-ds command.
- #@TestPreamble none
- #@TestStep Run the trap listener, it send an event to
- notify that it is ready.
- #@TestStep When this event is received, stop-ds command
- is executed and a another event is sent to
- notify that the command is completed.
- #@TestStep The trap listener catches this event and send
- a result.
- #@TestPostamble none
- #@TestResult Success if SNMPTrapListener returns 0.
- -->
- <testcase name="getTestCaseName('trap_defaultconf: trap on stop-ds')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <timer duration="timerDuration">
- <sequence>
- <parallel>
- <sequence>
- <message>
- 'trap_defaultconf: run the trap listener'
- </message>
-
- <call function="'SNMPTrapListener'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpTrapPort' : SNMP_TRAP_PORT ,
- 'snmpTrapCommunity' : trapsCommunity ,
- 'snmpTrapNumber' : '1,0,0,0,0,0' ,
- 'outputFile' : outputFile ,
- 'knownIssue' : '3435'
- }
- </call>
- </sequence>
- <sequence>
- <message>
- 'trap_defaultconf: wait event from the trap listener'
- </message>
-
- <call function="'WaitEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SNMPTrapListener/Ready'
- }
- </call>
-
- <message>
- 'trap_defaultconf: delete event from the trap listener'
- </message>
- <call function="'DeleteEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SNMPTrapListener/Ready'
- }
- </call>
-
- <message>
- 'trap_defaultconf: stop the server'
- </message>
- <call function="'StopDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
-
- <message>
- 'trap_defaultconf: send event to the trap listener'
- </message>
-
- <call function="'SendEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SendTrap/Complete'
- }
- </call>
- </sequence>
- </parallel>
- </sequence>
- </timer>
-
- <script>timerRC = RC</script>
-
- <call function="'checkTimerResult'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'outputFile' : outputFile ,
- 'timerDuration' : timerDuration ,
- 'timerRC' : timerRC
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP trap with default configuration
- #@TestName trap_defaultconf: trap on start-ds
- #@TestIssue none
- #@TestPurpose Check that a trap is sent on default trap
- community after start-ds command.
- #@TestPreamble none
- #@TestStep Run the trap listener, it send an event to
- notify that it is ready.
- #@TestStep When this event is received, start-ds command
- is executed and a another event is sent to
- notify that the command is completed.
- #@TestStep The trap listener catches this event and send
- a result.
- #@TestPostamble none
- #@TestResult Success if SNMPTrapListener returns 0.
- -->
- <testcase name="getTestCaseName
- ('trap_defaultconf: trap on start-ds')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <timer duration="timerDuration">
- <sequence>
- <parallel>
- <sequence>
- <message>
- 'trap_defaultconf: run the trap listener'
- </message>
-
- <call function="'SNMPTrapListener'">
- {
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpTrapPort' : SNMP_TRAP_PORT ,
- 'snmpTrapCommunity' : trapsCommunity ,
- 'snmpTrapNumber' : '1,0,0,0,0,0' ,
- 'outputFile' : outputFile
- }
- </call>
- </sequence>
- <sequence>
- <message>
- 'trap_defaultconf: wait event from the trap listener'
- </message>
-
- <call function="'WaitEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SNMPTrapListener/Ready'
- }
- </call>
-
- <message>
- 'trap_defaultconf: delete event from the trap listener'
- </message>
- <call function="'DeleteEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SNMPTrapListener/Ready'
- }
- </call>
-
- <message>
- 'trap_defaultconf: start the server'
- </message>
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
- <!--- Check that DS started -->
- <call function="'isAlive'">
- {
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
-
- <message>
- 'trap_defaultconf: send event to the trap listener'
- </message>
-
- <call function="'SendEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SendTrap/Complete'
- }
- </call>
- </sequence>
- </parallel>
- </sequence>
- </timer>
-
- <script>timerRC = RC</script>
-
- <call function="'checkTimerResult'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'outputFile' : outputFile ,
- 'timerDuration' : timerDuration ,
- 'timerRC' : timerRC
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP trap with default configuration
- #@TestName trap_defaultconf: trap on stop-ds -R
- #@TestIssue 3435
- #@TestPurpose Check that 2 traps are sent on default trap
- community after stop-ds -R command.
- #@TestPreamble none
- #@TestStep Run the trap listener, it send an event to
- notify that it is ready.
- #@TestStep When this event is received, stop-ds -R
- command is executed and a another event is
- sent to notify that the command is completed.
- #@TestStep The trap listener catches this event and send
- a result.
- #@TestPostamble none
- #@TestResult Success if SNMPTrapListener returns 0.
- -->
- <testcase name="getTestCaseName
- ('trap_defaultconf: trap on stop-ds -R')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <timer duration="timerDuration">
- <sequence>
- <parallel>
- <sequence>
- <message>
- 'trap_defaultconf: run the trap listener'
- </message>
-
- <call function="'SNMPTrapListener'">
- {
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpTrapPort' : SNMP_TRAP_PORT ,
- 'snmpTrapCommunity' : trapsCommunity ,
- 'snmpTrapNumber' : '2,0,0,0,0,0' ,
- 'outputFile' : outputFile ,
- 'knownIssue' : '3435'
- }
- </call>
- </sequence>
- <sequence>
- <message>
- 'trap_defaultconf: wait event from the trap listener'
- </message>
-
- <call function="'WaitEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SNMPTrapListener/Ready'
- }
- </call>
-
- <message>
- 'trap_defaultconf: delete event from the trap listener'
- </message>
- <call function="'DeleteEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SNMPTrapListener/Ready'
- }
- </call>
-
- <message>
- 'trap_defaultconf: restart the server'
- </message>
- <call function="'StopDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
- <call function="'StartDsWithScript'">
- { 'location' : STAF_REMOTE_HOSTNAME }
- </call>
- <!--- Check that DS started -->
- <call function="'isAlive'">
- {
- 'noOfLoops' : 10 ,
- 'noOfMilliSeconds' : 2000
- }
- </call>
-
- <message>
- 'trap_defaultconf: send event to the trap listener'
- </message>
-
- <call function="'SendEvent'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'name' : 'SendTrap/Complete'
- }
- </call>
- </sequence>
- </parallel>
- </sequence>
- </timer>
-
- <script>timerRC = RC</script>
-
- <call function="'checkTimerResult'">
- {
- 'location' : STAF_REMOTE_HOSTNAME ,
- 'outputFile' : outputFile ,
- 'timerDuration' : timerDuration ,
- 'timerRC' : timerRC
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
- </block>
-
- </sequence>
-
- </function>
-
-</stax>
diff --git a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v1_customconf.xml b/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v1_customconf.xml
deleted file mode 100644
index 9220091..0000000
--- a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v1_customconf.xml
+++ /dev/null
@@ -1,686 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
-<!--
- ! CDDL HEADER START
- !
- ! The contents of this file are subject to the terms of the
- ! Common Development and Distribution License, Version 1.0 only
- ! (the "License"). You may not use this file except in compliance
- ! with the License.
- !
- ! You can obtain a copy of the license at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
- ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- ! See the License for the specific language governing permissions
- ! and limitations under the License.
- !
- ! When distributing Covered Code, include this CDDL HEADER in each
- ! file and include the License file at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- ! add the following below this CDDL HEADER, with the fields enclosed
- ! by brackets "[]" replaced with your own identifying information:
- ! Portions Copyright [yyyy] [name of copyright owner]
- !
- ! CDDL HEADER END
- !
- ! Copyright 2008-2009 Sun Microsystems, Inc.
- ! -->
-<stax>
-
- <defaultcall function="snmp_v1_customconf"/>
-
- <function name="snmp_v1_customconf">
-
- <sequence>
-
- <block name="'snmp_v1_customconf'">
-
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName SNMP v1 with custom configuration
- #@TestSuitePurpose Check SNMP v1 with custom configuration.
- #@TestSuiteGroup SNMP v1 with custom configuration
- #@TestScript snmp_v1_customconf.xml
- -->
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'snmp'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default values -->
- <script>
- defCommunityProp = SNMP_PROPERTIES['community']
- defCommunity = '%s@%s' %(defCommunityProp, defCommunityProp)
- defManagerProp = SNMP_PROPERTIES['allowed-manager']
- newCommunityProp = 'myCommunity'
- newCommunity = '%s@%s' %(newCommunityProp, newCommunityProp)
- newManagerProp = DIRECTORY_INSTANCE_HOST
- wrongManagerProp = 'myManager'
- oid = 'dsServerType.1'
- </script>
-
- <!--- Test Case information
- #@TestMarker SNMP v1 with custom configuration
- #@TestName v1_customconf: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('v1_customconf: change the community property')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <!-- @Step1: Display default SNMP Connection Handler -->
- <call function="'testStep'">
- { 'stepMessage' : 'Display default SNMP Connection Handler.' }
- </call>
-
- <call function="'dsconfig'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'get-connection-handler-prop' ,
- 'objectType' : 'handler-name' ,
- 'objectName' : 'SNMP Connection Handler'
- }
- </call>
-
- <!-- @Step2: Change the community property -->
- <call function="'testStep'">
- { 'stepMessage' : 'Change the community property.' }
- </call>
-
- <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' % newCommunityProp
- }
- </call>
-
- <call function="'dsconfig'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'get-connection-handler-prop' ,
- 'objectType' : 'handler-name' ,
- 'objectName' : 'SNMP Connection Handler'
- }
- </call>
-
- <!-- @Step3: Restart the SNMP Connection Handler -->
- <call function="'testStep'">
- { 'stepMessage' : 'Restart the SNMP Connection Handler.' }
- </call>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <!-- @Step4: SNMPGet with the old community -->
- <call function="'testStep'">
- { 'stepMessage' : 'SNMPGet with the old community.' }
- </call>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : defCommunity ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'reqTimeout'
- }
- </call>
-
- <!-- @Step5: SNMPGet with the new community -->
- <call function="'testStep'">
- { 'stepMessage' : 'SNMPGet with the new community.' }
- </call>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : newCommunity ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError'
- }
- </call>
-
- <!-- @Step6: Restore the community property -->
- <call function="'testStep'">
- { 'stepMessage' : 'Restore the community property.' }
- </call>
-
- <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' % defCommunityProp
- }
- </call>
-
- <call function="'dsconfig'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'get-connection-handler-prop' ,
- 'objectType' : 'handler-name' ,
- 'objectName' : 'SNMP Connection Handler'
- }
- </call>
-
- <!-- @Step7: Restart the SNMP Connection Handler -->
- <call function="'testStep'">
- { 'stepMessage' : 'Restart the SNMP Connection Handler.' }
- </call>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v1 with custom configuration
- #@TestName v1_customconf: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('v1_customconf: set allowed-manager property to a correct value')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <!-- @Step1: Change the allowed-manager property -->
- <call function="'testStep'">
- { 'stepMessage' : 'Change the allowed-manager property.' }
- </call>
-
- <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-manager:%s' % newManagerProp
- }
- </call>
-
- <call function="'dsconfig'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'get-connection-handler-prop' ,
- 'objectType' : 'handler-name' ,
- 'objectName' : 'SNMP Connection Handler'
- }
- </call>
-
- <!-- @Step2: Restart the SNMP Connection Handler -->
- <call function="'testStep'">
- { 'stepMessage' : 'Restart the SNMP Connection Handler.' }
- </call>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <!-- @Step3: SNMPGet with the new community -->
- <call function="'testStep'">
- { 'stepMessage' : 'SNMPGet with the new community.' }
- </call>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : defCommunity ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError'
- }
- </call>
-
- <!-- @Step4: Restore the community property -->
- <call function="'testStep'">
- { 'stepMessage' : 'Restore the community property.' }
- </call>
-
- <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-manager:%s' % defManagerProp
- }
- </call>
-
- <call function="'dsconfig'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'get-connection-handler-prop' ,
- 'objectType' : 'handler-name' ,
- 'objectName' : 'SNMP Connection Handler'
- }
- </call>
-
- <!-- @Step5: Restart the SNMP Connection Handler -->
- <call function="'testStep'">
- { 'stepMessage' : 'Restart the SNMP Connection Handler.' }
- </call>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v1 with custom configuration
- #@TestName v1_customconf: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('v1_customconf: set allowed-manager property to a wrong value')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <!-- @Step1: Change the allowed-manager property -->
- <call function="'testStep'">
- { 'stepMessage' : 'Change the allowed-manager property.' }
- </call>
-
- <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-manager:%s' \
- % wrongManagerProp
- }
- </call>
-
- <call function="'dsconfig'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'get-connection-handler-prop' ,
- 'objectType' : 'handler-name' ,
- 'objectName' : 'SNMP Connection Handler'
- }
- </call>
-
- <!-- @Step2: Restart the SNMP Connection Handler -->
- <call function="'testStep'">
- { 'stepMessage' : 'Restart the SNMP Connection Handler.' }
- </call>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <!-- @Step3: SNMPGet with the old community -->
- <call function="'testStep'">
- { 'stepMessage' : 'SNMPGet with the old community.' }
- </call>
-
- <message>
- 'v1_customconf: '
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : defCommunity ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noSuchName'
- }
- </call>
-
- <!-- @Step4: Restore the community property -->
- <call function="'testStep'">
- { 'stepMessage' : 'Restore the community property.' }
- </call>
-
- <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-manager:%s' \
- % defManagerProp
- }
- </call>
-
- <call function="'dsconfig'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'get-connection-handler-prop' ,
- 'objectType' : 'handler-name' ,
- 'objectName' : 'SNMP Connection Handler'
- }
- </call>
-
- <!-- @Step5: Restart the SNMP Connection Handler -->
- <call function="'testStep'">
- { 'stepMessage' : 'Restart the SNMP Connection Handler.' }
- </call>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v1 with custom configuration
- #@TestName v1_customconf: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('v1_customconf: set allowed-manager property to a list')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <!-- @Step1: Set allowed-manager property to a list -->
- <call function="'testStep'">
- { 'stepMessage' : 'Set allowed-manager property to a list.' }
- </call>
-
- <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-manager:%s' \
- % wrongManagerProp
- }
- </call>
- <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-manager:%s' \
- % newManagerProp
- }
- </call>
-
- <call function="'dsconfig'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'get-connection-handler-prop' ,
- 'objectType' : 'handler-name' ,
- 'objectName' : 'SNMP Connection Handler'
- }
- </call>
-
- <!-- @Step2: Restart the SNMP Connection Handler -->
- <call function="'testStep'">
- { 'stepMessage' : 'Restart the SNMP Connection Handler.' }
- </call>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <!-- @Step3: SNMPGet from a not allowed manager -->
- <call function="'testStep'">
- { 'stepMessage' : 'SNMPGet from a not allowed manager.' }
- </call>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : defCommunity ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError'
- }
- </call>
-
- <!-- @Step4: Restore the community property -->
- <call function="'testStep'">
- { 'stepMessage' : 'Restore the community property.' }
- </call>
-
- <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-manager:%s' \
- % defManagerProp
- }
- </call>
-
- <call function="'dsconfig'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'get-connection-handler-prop' ,
- 'objectType' : 'handler-name' ,
- 'objectName' : 'SNMP Connection Handler'
- }
- </call>
-
- <!-- @Step5: Restart the SNMP Connection Handler -->
- <call function="'testStep'">
- { 'stepMessage' : 'Restart the SNMP Connection Handler.' }
- </call>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v1 with custom configuration
- #@TestName v1_customconf: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('v1_customconf: set the community property to a list')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <!-- @Step1: Set the community property to a list -->
- <call function="'testStep'">
- { 'stepMessage' : 'Set the community property to a list.' }
- </call>
-
- <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 community:%s' % newCommunityProp ,
- 'expectedRC' : 1
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
-
- msg1 = 'It is not possible to specify multiple values for the'
- msg2 = 'SNMP Connection Handler%sproperty "community" as it' \
- % newLine
- msg3 = 'is single-valued'
- msg = '%s %s %s' % (msg1, msg2, msg3)
- </script>
-
- <!-- @Step2: Check that the return string is correct -->
- <call function="'testStep'">
- { 'stepMessage' : 'Check that the return string is correct.' }
- </call>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg
- }
- </call>
-
- <call function="'dsconfig'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
- 'subcommand' : 'get-connection-handler-prop' ,
- 'objectType' : 'handler-name' ,
- 'objectName' : 'SNMP Connection Handler'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
- </block>
-
- </sequence>
-
- </function>
-
-</stax>
diff --git a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v1_defaultconf.xml b/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v1_defaultconf.xml
deleted file mode 100644
index 32e18de..0000000
--- a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v1_defaultconf.xml
+++ /dev/null
@@ -1,227 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
-<!--
- ! CDDL HEADER START
- !
- ! The contents of this file are subject to the terms of the
- ! Common Development and Distribution License, Version 1.0 only
- ! (the "License"). You may not use this file except in compliance
- ! with the License.
- !
- ! You can obtain a copy of the license at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
- ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- ! See the License for the specific language governing permissions
- ! and limitations under the License.
- !
- ! When distributing Covered Code, include this CDDL HEADER in each
- ! file and include the License file at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- ! add the following below this CDDL HEADER, with the fields enclosed
- ! by brackets "[]" replaced with your own identifying information:
- ! Portions Copyright [yyyy] [name of copyright owner]
- !
- ! CDDL HEADER END
- !
- ! Copyright 2008 Sun Microsystems, Inc.
- ! -->
-<stax>
-
- <defaultcall function="snmp_v1_defaultconf"/>
-
- <function name="snmp_v1_defaultconf">
-
- <sequence>
-
- <block name="'snmp_v1_defaultconf'">
-
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName SNMP v1 with default configuration
- #@TestSuitePurpose Check SNMP v1 with default configuration.
- #@TestSuiteGroup SNMP v1 with default configuration
- #@TestScript snmp_v1_defaultconf.xml
- -->
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'snmp'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default value for community and oid -->
- <script>
- community = '%s@%s' \
- % (SNMP_PROPERTIES['community'], SNMP_PROPERTIES['community'])
- oid = 'dsServerType.1'
- </script>
-
- <!--- Test Case information
- #@TestMarker SNMP v1 with default configuration
- #@TestName v1_defaultconf: get with default commnunity
- #@TestIssue none
- #@TestPurpose Check that a SNMP Get request with default
- community succeeds.
- #@TestPreamble none
- #@TestStep SNMP Get request.
- #@TestPostamble none
- #@TestResult Success if SNMPGet returns 0.
- -->
- <testcase name="getTestCaseName
- ('v1_defaultconf: get with default commnunity')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v1_defaultconf: get with default community'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v1 with default configuration
- #@TestName v1_defaultconf: get with wrong commnunity
- #@TestIssue none
- #@TestPurpose Check that a SNMP Get request with wrong
- community fails with noSuchName.
- #@TestPreamble none
- #@TestStep SNMP Get request.
- #@TestPostamble none
- #@TestResult Success if SNMPGet returns 0.
- -->
- <testcase name="getTestCaseName
- ('v1_defaultconf: get with wrong community')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v1_defaultconf: get with wrong community'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : 'OpenDS' ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noSuchName'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v1 with default configuration
- #@TestName v1_defaultconf: set with default commnunity
- #@TestIssue none
- #@TestPurpose Check that a SNMP Set request with default
- community fails with noSuchName.
- #@TestPreamble none
- #@TestStep SNMP Set request.
- #@TestPostamble none
- #@TestResult Success if SNMPSet returns 0.
- -->
- <testcase name="getTestCaseName
- ('v1_defaultconf: set with default community')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v1_defaultconf: set with default community'
- </message>
-
- <call function="'SNMPSet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noSuchName'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v1 with default configuration
- #@TestName v1_defaultconf: set with wrong commnunity
- #@TestIssue none
- #@TestPurpose Check that a SNMP Set request with wrong
- community fails with noSuchName.
- #@TestPreamble none
- #@TestStep SNMP Set request.
- #@TestPostamble none
- #@TestResult Success if SNMPSet returns 0.
- -->
- <testcase name="getTestCaseName
- ('v1_defaultconf: set with wrong community')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v1_defaultconf: set with wrong community'
- </message>
-
- <call function="'SNMPSet'">
- {
- 'snmpVersion' : '1',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : 'OpenDS' ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noSuchName'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
- </block>
-
- </sequence>
-
- </function>
-
-</stax>
diff --git a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v2c_customconf.xml b/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v2c_customconf.xml
deleted file mode 100644
index 1767d57..0000000
--- a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v2c_customconf.xml
+++ /dev/null
@@ -1,540 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
-<!--
- ! CDDL HEADER START
- !
- ! The contents of this file are subject to the terms of the
- ! Common Development and Distribution License, Version 1.0 only
- ! (the "License"). You may not use this file except in compliance
- ! with the License.
- !
- ! You can obtain a copy of the license at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
- ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- ! See the License for the specific language governing permissions
- ! and limitations under the License.
- !
- ! When distributing Covered Code, include this CDDL HEADER in each
- ! file and include the License file at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- ! add the following below this CDDL HEADER, with the fields enclosed
- ! by brackets "[]" replaced with your own identifying information:
- ! Portions Copyright [yyyy] [name of copyright owner]
- !
- ! CDDL HEADER END
- !
- ! Copyright 2008-2009 Sun Microsystems, Inc.
- ! -->
-<stax>
-
- <defaultcall function="snmp_v2c_customconf"/>
-
- <function name="snmp_v2c_customconf">
-
- <sequence>
-
- <block name="'snmp_v2c_customconf'">
-
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName SNMP v2c with custom configuration
- #@TestSuitePurpose Check SNMP v2c with custom configuration.
- #@TestSuiteGroup SNMP v2c with custom configuration
- #@TestScript snmp_v2c_customconf.xml
- -->
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'snmp'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default values -->
- <script>
- defCommunityProp = SNMP_PROPERTIES['community']
- defCommunity = '%s@%s' %(defCommunityProp, defCommunityProp)
- defManagerProp = SNMP_PROPERTIES['allowed-manager']
- newCommunityProp = 'myCommunity'
- newCommunity = '%s@%s' %(newCommunityProp, newCommunityProp)
- newManagerProp = DIRECTORY_INSTANCE_HOST
- wrongManagerProp = 'myManager'
- oid = 'dsServerType.1'
- </script>
-
- <!--- Test Case information
- #@TestMarker SNMP v2c with custom configuration
- #@TestName v2c_customconf: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('v2c_customconf: change the community property')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v2c_customconf: change the community property'
- </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 community:%s' % newCommunityProp
- }
- </call>
-
- <message>
- 'v2c_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <message>
- 'v2c_customconf: get with the old community'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '2',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : defCommunity ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'reqTimeout'
- }
- </call>
-
- <message>
- 'v2c_customconf: get with the new community'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '2',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : newCommunity ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError'
- }
- </call>
-
- <message>
- 'v2c_customconf: restore the community property'
- </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 community:%s' % defCommunityProp
- }
- </call>
-
- <message>
- 'v2c_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v2c with custom configuration
- #@TestName v2c_customconf: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('v2c_customconf: set allowed-manager property to a correct value')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v2c_customconf: change the allowed-manager property'
- </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 allowed-manager:%s' % newManagerProp
- }
- </call>
-
- <message>
- 'v2c_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <message>
- 'v2c_customconf: get form a allowed manager'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '2',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : defCommunity ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError'
- }
- </call>
-
- <message>
- 'v2c_customconf: restore the community property'
- </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 allowed-manager:%s' % defManagerProp
- }
- </call>
-
- <message>
- 'v2c_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v2c with custom configuration
- #@TestName v2c_customconf: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('v2c_customconf: set allowed-manager property to a wrong value')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v2c_customconf: set allowed-manager property to a wrong value'
- </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 allowed-manager:%s' \
- % wrongManagerProp
- }
- </call>
-
- <message>
- 'v2c_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <message>
- 'v2c_customconf: get from a not allowed manager'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '2',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : defCommunity ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'authorizationError'
- }
- </call>
-
- <message>
- 'v2c_customconf: restore the community property'
- </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 allowed-manager:%s' \
- % defManagerProp
- }
- </call>
-
- <message>
- 'v2c_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v2c with custom configuration
- #@TestName v2c_customconf: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('v2c_customconf: set allowed-manager property to a list')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v2c_customconf: set allowed-manager property to a list'
- </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 allowed-manager:%s' \
- % wrongManagerProp
- }
- </call>
- <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-manager:%s' \
- % newManagerProp
- }
- </call>
-
- <message>
- 'v2c_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <message>
- 'v2c_customconf: get from a not allowed manager'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '2',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : defCommunity ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError'
- }
- </call>
-
- <message>
- 'v2c_customconf: restore the community property'
- </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 allowed-manager:%s' \
- % defManagerProp
- }
- </call>
-
- <message>
- 'v2c_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v2c with custom configuration
- #@TestName v2c_customconf: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('v2c_customconf: set the community property to a list')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v2c_customconf: set the community property to a list'
- </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' : '--add community:%s' % newCommunityProp ,
- 'expectedRC' : 1
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
-
- msg1 = 'It is not possible to specify multiple values for the'
- msg2 = 'SNMP Connection Handler%sproperty "community" as it' \
- % newLine
- msg3 = 'is single-valued'
- msg = '%s %s %s' % (msg1, msg2, msg3)
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
- </block>
-
- </sequence>
-
- </function>
-
-</stax>
diff --git a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v2c_defaultconf.xml b/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v2c_defaultconf.xml
deleted file mode 100644
index c28b1bb..0000000
--- a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v2c_defaultconf.xml
+++ /dev/null
@@ -1,231 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
-<!--
- ! CDDL HEADER START
- !
- ! The contents of this file are subject to the terms of the
- ! Common Development and Distribution License, Version 1.0 only
- ! (the "License"). You may not use this file except in compliance
- ! with the License.
- !
- ! You can obtain a copy of the license at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
- ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- ! See the License for the specific language governing permissions
- ! and limitations under the License.
- !
- ! When distributing Covered Code, include this CDDL HEADER in each
- ! file and include the License file at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- ! add the following below this CDDL HEADER, with the fields enclosed
- ! by brackets "[]" replaced with your own identifying information:
- ! Portions Copyright [yyyy] [name of copyright owner]
- !
- ! CDDL HEADER END
- !
- ! Copyright 2008 Sun Microsystems, Inc.
- ! -->
-<stax>
-
- <defaultcall function="snmp_v2c_defaultconf"/>
-
- <function name="snmp_v2c_defaultconf">
-
- <sequence>
-
- <block name="'snmp_v2c_defaultconf'">
-
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName SNMP v2c with default configuration
- #@TestSuitePurpose Check SNMP v2c with default configuration.
- #@TestSuiteGroup SNMP v2c with default configuration
- #@TestScript snmp_v2c_defaultconf.xml
- -->
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'snmp'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default value for community and oid -->
- <script>
- community = '%s@%s' \
- % (SNMP_PROPERTIES['community'], SNMP_PROPERTIES['community'])
- oid = 'dsServerType.1'
- </script>
-
- <!--- Test Case information
- #@TestMarker SNMP v2c with default configuration
- #@TestName v2c_defaultconf: get with default commnunity
- #@TestIssue none
- #@TestPurpose Check that a SNMP Get request with default
- community succeeds.
- #@TestPreamble none
- #@TestStep SNMP Get request.
- #@TestPostamble none
- #@TestResult Success if SNMPGet returns 0.
- -->
- <testcase name="getTestCaseName
- ('v2c_defaultconf: get with default commnunity')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v2c_defaultconf: get with default community'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '2',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v2c with default configuration
- #@TestName v2c_defaultconf: get with wrong
- commnunity
- #@TestIssue none
- #@TestPurpose Check that a SNMP Get request with wrong
- community succeeds but the OIDs values are
- not correct.
- #@TestPreamble none
- #@TestStep SNMP Get request.
- #@TestPostamble none
- #@TestResult Success if SNMPGet returns 0.
- -->
- <testcase name="getTestCaseName
- ('v2c_defaultconf: get with wrong community')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v2c_defaultconf: get with wrong community'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '2',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : 'OpenDS' ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError' ,
- 'snmpValidOIDs' : 'False'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v2c with default configuration
- #@TestName v2c_defaultconf: set with default ommnunity
- #@TestIssue none
- #@TestPurpose Check that a SNMP Set request with default
- community fails with authorizationError.
- #@TestPreamble none
- #@TestStep SNMP Set request.
- #@TestPostamble none
- #@TestResult Success if SNMPSet returns 0.
- -->
- <testcase name="getTestCaseName
- ('v2c_defaultconf: set with default community')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v2c_defaultconf: set with default community'
- </message>
-
- <call function="'SNMPSet'">
- {
- 'snmpVersion' : '2',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : community ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'authorizationError'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v2c with default configuration
- #@TestName v2c_defaultconf: set with wrong
- commnunity
- #@TestIssue none
- #@TestPurpose Check that a SNMP Set request with wrong
- community fails with noAccess.
- #@TestPreamble none
- #@TestStep SNMP Set request.
- #@TestPostamble none
- #@TestResult Success if SNMPSet returns 0.
- -->
- <testcase name="getTestCaseName
- ('v2c_defaultconf: set with wrong community')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v2c_defaultconf: set with wrong community'
- </message>
-
- <call function="'SNMPSet'">
- {
- 'snmpVersion' : '2',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : 'OpenDS' ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noAccess'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
- </block>
-
- </sequence>
-
- </function>
-
-</stax>
diff --git a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v3_customconf.xml b/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v3_customconf.xml
deleted file mode 100644
index 06dda94..0000000
--- a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v3_customconf.xml
+++ /dev/null
@@ -1,948 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
-<!--
- ! CDDL HEADER START
- !
- ! The contents of this file are subject to the terms of the
- ! Common Development and Distribution License, Version 1.0 only
- ! (the "License"). You may not use this file except in compliance
- ! with the License.
- !
- ! You can obtain a copy of the license at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
- ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- ! See the License for the specific language governing permissions
- ! and limitations under the License.
- !
- ! When distributing Covered Code, include this CDDL HEADER in each
- ! file and include the License file at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- ! add the following below this CDDL HEADER, with the fields enclosed
- ! by brackets "[]" replaced with your own identifying information:
- ! Portions Copyright [yyyy] [name of copyright owner]
- !
- ! CDDL HEADER END
- !
- ! Copyright 2008 Sun Microsystems, Inc.
- ! -->
-<stax>
-
- <defaultcall function="snmp_v3_customconf"/>
-
- <function name="snmp_v3_customconf">
-
- <sequence>
-
- <block name="'snmp_v3_customconf'">
-
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName SNMP v3 with custom configuration
- #@TestSuitePurpose Check SNMP v3 with custom configuration.
- #@TestSuiteGroup SNMP v3 with custom configuration
- #@TestScript snmp_v3_customconf.xml
- -->
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'snmp'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default values -->
- <script>
- defContextProp = SNMP_PROPERTIES['community']
- defUserProp = SNMP_PROPERTIES['allowed-user']
- defSecurityFileProp = SNMP_PROPERTIES['security-agent-file']
- defSecurityLevelProp = SNMP_PROPERTIES['security-level']
- newContextProp = 'myContext'
- newSecurityFileProp = '%s/snmp/agent.security' % remote.data
- lowUser = 'myUser1'
- defUser = 'myUser2'
- highUser = 'myUser3'
- otherUser = 'myUser4'
- lowSecurityLevelProp = 'noauthnopriv'
- highSecurityLevelProp = 'authpriv'
- wrongSecurityLevelProp = 'mySecurityLevel'
- mySecurityFile = '%s/snmp/manager.security' % remote.data
- oid = 'dsServerType.1'
- </script>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with custom configuration
- #@TestName v3_customconf: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('v3_customconf: change the security-agent-file property')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v3_customconf: change the security-agent-file property'
- </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 security-agent-file:%s' \
- % newSecurityFileProp
- }
- </call>
-
- <message>
- 'v3_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with custom configuration
- #@TestName v3_customconf: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('v3_customconf: check the current security level (def)')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v3_customconf: get with the lowUser and low security level'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : lowUser ,
- 'snmpCommunity' : defContextProp ,
- 'snmpSecurityLevel' : lowSecurityLevelProp ,
- 'snmpSecurityFile' : mySecurityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'authorizationError'
- }
- </call>
-
- <message>
- 'v3_customconf: get with the defUser and def security level'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : defUser ,
- 'snmpCommunity' : defContextProp ,
- 'snmpSecurityLevel' : defSecurityLevelProp ,
- 'snmpSecurityFile' : mySecurityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError'
- }
- </call>
-
- <message>
- 'v3_customconf: get with the highUser and high security level'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : highUser ,
- 'snmpCommunity' : defContextProp ,
- 'snmpSecurityLevel' : highSecurityLevelProp ,
- 'snmpSecurityFile' : mySecurityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with custom configuration
- #@TestName v3_customconf: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('v3_customconf: change the context property')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v3_customconf: change the context property'
- </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 community:%s' % newContextProp
- }
- </call>
-
- <message>
- 'v3_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <message>
- 'v3_customconf: get with the old context'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : defUser ,
- 'snmpCommunity' : defContextProp ,
- 'snmpSecurityLevel' : defSecurityLevelProp ,
- 'snmpSecurityFile' : mySecurityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'reqTimeout'
- }
- </call>
-
- <message>
- 'v3_customconf: get with the context'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : otherUser ,
- 'snmpCommunity' : newContextProp ,
- 'snmpSecurityLevel' : defSecurityLevelProp ,
- 'snmpSecurityFile' : mySecurityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError'
- }
- </call>
-
- <message>
- 'v3_customconf: restore the context property'
- </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 community:%s' % defContextProp
- }
- </call>
-
- <message>
- 'v3_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with custom configuration
- #@TestName v3_customconf: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('v3_customconf: set the allowed-user property to a list')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v3_customconf: set the allowed-user property to a list'
- </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 allowed-user:%s' % defUser
- }
- </call>
- <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>
-
- <message>
- 'v3_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <message>
- 'v3_customconf: get with the myUser community'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : defUser ,
- 'snmpCommunity' : defContextProp ,
- 'snmpSecurityLevel' : defSecurityLevelProp ,
- 'snmpSecurityFile' : mySecurityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError'
- }
- </call>
-
- <message>
- 'v3_customconf: get with the myUser2 community'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : otherUser ,
- 'snmpCommunity' : defContextProp ,
- 'snmpSecurityLevel' : defSecurityLevelProp ,
- 'snmpSecurityFile' : mySecurityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError'
- }
- </call>
-
- <message>
- 'v3_customconf: restore the allowed-user property'
- </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 allowed-user:%s' % defUserProp
- }
- </call>
-
- <message>
- 'v3_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with custom configuration
- #@TestName v3_customconf: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('v3_customconf: set the allowed-user property to otherUser')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v3_customconf: set the allowed-user property to otherUser'
- </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 allowed-user:%s' % otherUser
- }
- </call>
-
- <message>
- 'v3_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <message>
- 'v3_customconf: get with the defUser'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : defUser ,
- 'snmpCommunity' : defContextProp ,
- 'snmpSecurityLevel' : defSecurityLevelProp ,
- 'snmpSecurityFile' : mySecurityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'authorizationError'
- }
- </call>
-
- <message>
- 'v3_customconf: get with the otherUser'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : otherUser ,
- 'snmpCommunity' : defContextProp ,
- 'snmpSecurityLevel' : defSecurityLevelProp ,
- 'snmpSecurityFile' : mySecurityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError'
- }
- </call>
-
- <message>
- 'v3_customconf: restore the security-agent-file property'
- </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 allowed-user:%s' % defUserProp
- }
- </call>
-
- <message>
- 'v3_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with custom configuration
- #@TestName v3_customconf: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('v3_customconf: set the security-level property to low')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v3_customconf: set the security-level property to low'
- </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 security-level:%s' \
- % lowSecurityLevelProp
- }
- </call>
-
- <message>
- 'v3_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <message>
- 'v3_customconf: get with the myUser1 and low security level'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : lowUser ,
- 'snmpCommunity' : defContextProp ,
- 'snmpSecurityLevel' : lowSecurityLevelProp ,
- 'snmpSecurityFile' : mySecurityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError'
- }
- </call>
-
- <message>
- 'v3_customconf: get with the myUser2 and med security level'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : defUser ,
- 'snmpCommunity' : defContextProp ,
- 'snmpSecurityLevel' : defSecurityLevelProp ,
- 'snmpSecurityFile' : mySecurityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError'
- }
- </call>
-
- <message>
- 'v3_customconf: get with the myUser3 and high security level'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : highUser ,
- 'snmpCommunity' : defContextProp ,
- 'snmpSecurityLevel' : highSecurityLevelProp ,
- 'snmpSecurityFile' : mySecurityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError'
- }
- </call>
-
- <message>
- 'v3_customconf: restore the security-level property'
- </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 security-level:%s' \
- % defSecurityLevelProp
- }
- </call>
-
- <message>
- 'v3_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with custom configuration
- #@TestName v3_customconf: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('v3_customconf: set the security-level property to high')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v3_customconf: set the security-level property to high'
- </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 security-level:%s' \
- % highSecurityLevelProp
- }
- </call>
-
- <message>
- 'v3_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <message>
- 'v3_customconf: get with the myUser1 and low security level'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : lowUser ,
- 'snmpCommunity' : defContextProp ,
- 'snmpSecurityLevel' : lowSecurityLevelProp ,
- 'snmpSecurityFile' : mySecurityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'authorizationError'
- }
- </call>
-
- <message>
- 'v3_customconf: get with the myUser2 and med security level'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : defUser ,
- 'snmpCommunity' : defContextProp ,
- 'snmpSecurityLevel' : defSecurityLevelProp ,
- 'snmpSecurityFile' : mySecurityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'authorizationError'
- }
- </call>
-
- <message>
- 'v3_customconf: get with the myUser3 and high security level'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : highUser ,
- 'snmpCommunity' : defContextProp ,
- 'snmpSecurityLevel' : highSecurityLevelProp ,
- 'snmpSecurityFile' : mySecurityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError'
- }
- </call>
-
- <message>
- 'v3_customconf: restore the security-level property'
- </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 security-level:%s' \
- % defSecurityLevelProp
- }
- </call>
-
- <message>
- 'v3_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with custom configuration
- #@TestName v3_customconf: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('v3_customconf: set the security-level property to wrong')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v3_customconf: set the security-level property to wrong'
- </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 security-level:%s' \
- % wrongSecurityLevelProp ,
- 'expectedRC' : 1
- }
- </call>
-
- <script>
- returnString = STAXResult[0][1]
- msg1 = 'The value "%s" is not a valid value for the' \
- % wrongSecurityLevelProp
- 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)
- </script>
-
- <call function="'checktestString'">
- {
- 'returnString' : returnString ,
- 'expectedString' : msg
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with custom configuration
- #@TestName v3_customconf: TODO
- #@TestIssue none
- #@TestPurpose TODO.
- #@TestPreamble none
- #@TestStep TODO.
- #@TestPostamble none
- #@TestResult TODO.
- -->
- <testcase name="getTestCaseName
- ('v3_customconf: restore the security-agent-file property')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v3_customconf: restore the security-agent-file property'
- </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 security-agent-file:%s' \
- % defSecurityFileProp
- }
- </call>
-
- <message>
- 'v3_customconf: restart the SNMP Connection Handler'
- </message>
-
- <call function="'restartSNMPConnectionHandler'">
- {
- 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
- 'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
- 'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
- </block>
-
- </sequence>
-
- </function>
-
-</stax>
diff --git a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v3_defaultconf.xml b/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v3_defaultconf.xml
deleted file mode 100644
index 61449df..0000000
--- a/opends/tests/staf-tests/functional-tests/testcases/snmp/snmp_v3_defaultconf.xml
+++ /dev/null
@@ -1,601 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE stax SYSTEM "../../../shared/stax.dtd">
-<!--
- ! CDDL HEADER START
- !
- ! The contents of this file are subject to the terms of the
- ! Common Development and Distribution License, Version 1.0 only
- ! (the "License"). You may not use this file except in compliance
- ! with the License.
- !
- ! You can obtain a copy of the license at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
- ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- ! See the License for the specific language governing permissions
- ! and limitations under the License.
- !
- ! When distributing Covered Code, include this CDDL HEADER in each
- ! file and include the License file at
- ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- ! add the following below this CDDL HEADER, with the fields enclosed
- ! by brackets "[]" replaced with your own identifying information:
- ! Portions Copyright [yyyy] [name of copyright owner]
- !
- ! CDDL HEADER END
- !
- ! Copyright 2008 Sun Microsystems, Inc.
- ! -->
-<stax>
-
- <defaultcall function="snmp_v3_defaultconf"/>
-
- <function name="snmp_v3_defaultconf">
-
- <sequence>
-
- <block name="'snmp_v3_defaultconf'">
-
- <sequence>
-
- <!--- Test Suite information
- #@TestSuiteName SNMP v3 with default configuration
- #@TestSuitePurpose Check SNMP v3 with default configuration.
- #@TestSuiteGroup SNMP v3 with default configuration
- #@TestScript snmp_v3_defaultconf.xml
- -->
- <script>
- if not CurrentTestPath.has_key('group'):
- CurrentTestPath['group'] = 'snmp'
- CurrentTestPath['suite'] = STAXCurrentBlock
- </script>
-
- <call function="'testSuite_Preamble'"/>
-
- <!--- Define default value for securityFile, securityLevel,
- context and oid -->
- <script>
- securityFile = '%s/snmp/manager.security' % remote.data
- securityLevel = SNMP_PROPERTIES['security-level']
- context = SNMP_PROPERTIES['community']
- oid = 'dsServerType.1'
- </script>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with default configuration
- #@TestName v3_defaultconf: get with snmpAdmin user
- and default context
- #@TestIssue none
- #@TestPurpose Check that a SNMP Get request with snmpAdmin
- user and default context fails with
- authorizationError.
- #@TestPreamble none
- #@TestStep SNMP Get request.
- #@TestPostamble none
- #@TestResult Success if SNMPGet returns 0.
- -->
- <testcase name="getTestCaseName
- ('v3_defaultconf: get with snmpAdmin and default context')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v3_defaultconf: get with snmpAdmin and default context'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : 'snmpAdmin' ,
- 'snmpCommunity' : context ,
- 'snmpSecurityLevel' : securityLevel ,
- 'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'authorizationError'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with default configuration
- #@TestName v3_defaultconf: get with snmpAdmin user
- and null context
- #@TestIssue none
- #@TestPurpose Check that a SNMP Get request with snmpAdmin
- user and null context succeeds but the OIDs
- values are not correct.
- #@TestPreamble none
- #@TestStep SNMP Get request.
- #@TestPostamble none
- #@TestResult Success if SNMPGet returns 0.
- -->
- <testcase name="getTestCaseName
- ('v3_defaultconf: get with snmpAdmin and null context')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v3_defaultconf: get with snmpAdmin and null context'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : 'snmpAdmin' ,
- 'snmpCommunity' : 'null' ,
- 'snmpSecurityLevel' : securityLevel ,
- 'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError' ,
- 'snmpValidOIDs' : 'False'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with default configuration
- #@TestName v3_defaultconf: det with snmpAdmin user
- and OpenDS context
- #@TestIssue none
- #@TestPurpose Check that a SNMP Set request with snmpAdmin
- user and default context fails with
- authorizationError.
- #@TestPreamble none
- #@TestStep SNMP Set request.
- #@TestPostamble none
- #@TestResult Success if SNMPSet returns 0.
- -->
- <testcase name="getTestCaseName
- ('v3_defaultconf: set with snmpAdmin and default context')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v3_defaultconf: set with snmpAdmin and default context'
- </message>
-
- <call function="'SNMPSet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : 'snmpAdmin' ,
- 'snmpCommunity' : context ,
- 'snmpSecurityLevel' : securityLevel ,
- 'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'authorizationError'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with default configuration
- #@TestName v3_defaultconf: set with snmpAdmin user
- and null context
- #@TestIssue none
- #@TestPurpose Check that a SNMP Set request with snmpAdmin
- user and null context fails with noAccess.
- #@TestPreamble none
- #@TestStep SNMP Set request.
- #@TestPostamble none
- #@TestResult Success if SNMPSet returns 0.
- -->
- <testcase name="getTestCaseName
- ('v3_defaultconf: set with snmpAdmin and null context')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v3_defaultconf: set with snmpAdmin and null context'
- </message>
-
- <call function="'SNMPSet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : 'snmpAdmin' ,
- 'snmpCommunity' : 'null' ,
- 'snmpSecurityLevel' : securityLevel ,
- 'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noAccess'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with default configuration
- #@TestName v3_defaultconf: get with defaultUser user
- and default context
- #@TestIssue none
- #@TestPurpose Check that a SNMP Get request with defaultUser
- user and default context fails with
- authorizationError.
- #@TestPreamble none
- #@TestStep SNMP Get request.
- #@TestPostamble none
- #@TestResult Success if SNMPGet returns 0.
- -->
- <testcase name="getTestCaseName
- ('v3_defaultconf: get with defaultUser and default context')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v3_defaultconf: get with defaultUser and default context'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : 'defaultUser' ,
- 'snmpCommunity' : context ,
- 'snmpSecurityLevel' : securityLevel ,
- 'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'authorizationError'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with default configuration
- #@TestName v3_defaultconf: get with defaultUser user
- and null context
- #@TestIssue none
- #@TestPurpose Check that a SNMP Get request with defaultUser
- user and null context succeeds but the OIDs
- values are not correct.
- #@TestPreamble none
- #@TestStep SNMP Get request.
- #@TestPostamble none
- #@TestResult Success if SNMPGet returns 0.
- -->
- <testcase name="getTestCaseName
- ('v3_defaultconf: get with defaultUser and null context')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v3_defaultconf: get with defaultUser and null context'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : 'defaultUser' ,
- 'snmpCommunity' : 'null' ,
- 'snmpSecurityLevel' : securityLevel ,
- 'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noError' ,
- 'snmpValidOIDs' : 'False'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with default configuration
- #@TestName v3_defaultconf: set with defaultUser user
- and default context
- #@TestIssue none
- #@TestPurpose Check that a SNMP Set request with defaultUser
- user and default context fails with
- authorizationError.
- #@TestPreamble none
- #@TestStep SNMP Set request.
- #@TestPostamble none
- #@TestResult Success if SNMPSet returns 0.
- -->
- <testcase name="getTestCaseName
- ('v3_defaultconf: set with defaultUser and default context')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v3_defaultconf: set with defaultUser and default context'
- </message>
-
- <call function="'SNMPSet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : 'defaultUser' ,
- 'snmpCommunity' : context ,
- 'snmpSecurityLevel' : securityLevel ,
- 'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'authorizationError'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with default configuration
- #@TestName v3_defaultconf: set with defaultUser user
- and null context
- #@TestIssue none
- #@TestPurpose Check that a SNMP Set request with defaultUser
- user and null context fails with noAccess.
- #@TestPreamble none
- #@TestStep SNMP Set request.
- #@TestPostamble none
- #@TestResult Success if SNMPSet returns 0.
- -->
- <testcase name="getTestCaseName
- ('v3_defaultconf: set with defaultUser and null context')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v3_defaultconf: set with defaultUser and null context'
- </message>
-
- <call function="'SNMPSet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : 'defaultUser' ,
- 'snmpCommunity' : 'null' ,
- 'snmpSecurityLevel' : securityLevel ,
- 'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'noAccess'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with default configuration
- #@TestName v3_defaultconf: get with unknown user
- and default context
- #@TestIssue none
- #@TestPurpose Check that a SNMP Get request with unknown
- user and default context fails with
- SnmpStatusException.
- #@TestPreamble none
- #@TestStep SNMP Get request.
- #@TestPostamble none
- #@TestResult Success if SNMPGet returns 0.
- -->
- <testcase name="getTestCaseName
- ('v3_defaultconf: get with unknown user and default context')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v3_defaultconf: get with unknown user and default context'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : 'myUser' ,
- 'snmpCommunity' : context ,
- 'snmpSecurityLevel' : securityLevel ,
- 'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'SnmpStatusException'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with default configuration
- #@TestName v3_defaultconf: get with unknown user
- and null context
- #@TestIssue none
- #@TestPurpose Check that a SNMP Get request with unknown
- user and null context fails with
- SnmpStatusException.
- #@TestPreamble none
- #@TestStep SNMP Get request.
- #@TestPostamble none
- #@TestResult Success if SNMPGet returns 0.
- -->
- <testcase name="getTestCaseName
- ('v3_defaultconf: get with unknown user and default context')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v3_defaultconf: get with unknown user and default context'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : 'myUser' ,
- 'snmpCommunity' : 'null' ,
- 'snmpSecurityLevel' : securityLevel ,
- 'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'SnmpStatusException'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with default configuration
- #@TestName v3_defaultconf: set with unknown user
- and default context
- #@TestIssue none
- #@TestPurpose Check that a SNMP Set request with unknown
- user and default context fails with
- SnmpStatusException.
- #@TestPreamble none
- #@TestStep SNMP Set request.
- #@TestPostamble none
- #@TestResult Success if SNMPSet returns 0.
- -->
- <testcase name="getTestCaseName
- ('v3_defaultconf: set with unknown user and default context')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v3_defaultconf: set with unknown user and OpenDS context'
- </message>
-
- <call function="'SNMPSet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : 'myUser' ,
- 'snmpCommunity' : context ,
- 'snmpSecurityLevel' : securityLevel ,
- 'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'SnmpStatusException'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with default configuration
- #@TestName v3_defaultconf: set with unknown user
- and null context
- #@TestIssue none
- #@TestPurpose Check that a SNMP Set request with unknown
- user and default context fails with
- SnmpStatusException.
- #@TestPreamble none
- #@TestStep SNMP Set request.
- #@TestPostamble none
- #@TestResult Success if SNMPSet returns 0.
- -->
- <testcase name="getTestCaseName
- ('v3_defaultconf: set with unknown user and null context')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'v3_defaultconf: set with unknown user and null context'
- </message>
-
- <call function="'SNMPSet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : 'myUser' ,
- 'snmpCommunity' : 'null' ,
- 'snmpSecurityLevel' : securityLevel ,
- 'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : oid ,
- 'snmpStatus' : 'SnmpStatusException'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <call function="'testSuite_Postamble'"/>
-
- </sequence>
-
- </block>
-
- </sequence>
-
- </function>
-
-</stax>
--
Gitblit v1.10.0