From 47dcedd4450ff2c30e88c72861d18ef1f8d8b964 Mon Sep 17 00:00:00 2001
From: Christophe Sovant <christophe.sovant@forgerock.com>
Date: Tue, 27 May 2008 17:30:28 +0000
Subject: [PATCH] Remove hardcoded values for community, context and securityLevel parameters
---
opendj-sdk/opends/tests/functional-tests/shared/data/snmp/manager.security | 2
opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp_v3_defaultconf.xml | 268 +++++++++++++++++----------------
opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp_setup.xml | 47 +++++
opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp_v2c_defaultconf.xml | 56 +++---
opendj-sdk/opends/tests/shared/java/snmp/SNMPSet.java | 8
opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp_v1_defaultconf.xml | 53 +++---
opendj-sdk/opends/tests/shared/java/snmp/SNMPGet.java | 8
opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp.xml | 3
8 files changed, 252 insertions(+), 193 deletions(-)
diff --git a/opendj-sdk/opends/tests/functional-tests/shared/data/snmp/manager.security b/opendj-sdk/opends/tests/functional-tests/shared/data/snmp/manager.security
index f267c17..9760790 100644
--- a/opendj-sdk/opends/tests/functional-tests/shared/data/snmp/manager.security
+++ b/opendj-sdk/opends/tests/functional-tests/shared/data/snmp/manager.security
@@ -33,4 +33,4 @@
userEntry=0x8000002a017f000001000000a1,snmpAdmin,null,usmHMACMD5AuthProtocol,passadmin
userEntry=0x8000002a017f000001000000a1,defaultUser,,usmHMACMD5AuthProtocol,password
userEntry=0x8000002a017f000001000000a1,myUser,,usmHMACMD5AuthProtocol,mypasswd
-userEntry=0x8000002a017f000001000000a1,myUser2,,usmHMACMD5AuthProtocol,mypasswd2
\ No newline at end of file
+userEntry=0x8000002a017f000001000000a1,myUser2,,usmHMACMD5AuthProtocol,mypasswd2
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp.xml b/opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp.xml
index 07c3f1e..1ecc6e9 100644
--- a/opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp.xml
@@ -54,7 +54,8 @@
<script>
STOP_RUN = 'False'
-
+ SNMP_PROPERTIES = {}
+
testList = []
testList.append(['.','snmp_setup'])
testList.append(['.','snmp_v1_defaultconf'])
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp_setup.xml b/opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp_setup.xml
index 0f6e4b5..208d76e 100644
--- a/opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp_setup.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp_setup.xml
@@ -95,7 +95,7 @@
</testcase>
- <!-- Check if 'opendmkPath' already created -->
+ <!-- Check if 'opendmkPath' exists -->
<call function="'GetEntry'">
{
'location' : STAF_REMOTE_HOSTNAME ,
@@ -225,7 +225,52 @@
</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 ,
+ 'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
+ '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>
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp_v1_defaultconf.xml b/opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp_v1_defaultconf.xml
index 97b499e..32e18de 100644
--- a/opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp_v1_defaultconf.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp_v1_defaultconf.xml
@@ -50,28 +50,34 @@
</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 snmp_v1_defaultconf: get with OpenDS@OpenDS
- commnunity
+ #@TestName v1_defaultconf: get with default commnunity
#@TestIssue none
- #@TestPurpose Check that a SNMP Get request with
- OpenDS@OpenDS community succeeds.
+ #@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
- ('snmp_v1_defaultconf: get with OpenDS@OpenDS commnunity')">
+ ('v1_defaultconf: get with default commnunity')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
- 'snmp_v1_defaultconf: get with OpenDS@OpenDS community'
+ 'v1_defaultconf: get with default community'
</message>
<call function="'SNMPGet'">
@@ -79,8 +85,8 @@
'snmpVersion' : '1',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : 'OpenDS@OpenDS' ,
- 'snmpOIDs' : 'dsServerType.1' ,
+ 'snmpCommunity' : community ,
+ 'snmpOIDs' : oid ,
'snmpStatus' : 'noError'
}
</call>
@@ -93,7 +99,7 @@
<!--- Test Case information
#@TestMarker SNMP v1 with default configuration
- #@TestName snmp_v1_defaultconf: get with wrong commnunity
+ #@TestName v1_defaultconf: get with wrong commnunity
#@TestIssue none
#@TestPurpose Check that a SNMP Get request with wrong
community fails with noSuchName.
@@ -103,14 +109,14 @@
#@TestResult Success if SNMPGet returns 0.
-->
<testcase name="getTestCaseName
- ('snmp_v1_defaultconf: get with wrong community')">
+ ('v1_defaultconf: get with wrong community')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
- 'snmp_v1_defaultconf: get with wrong community'
+ 'v1_defaultconf: get with wrong community'
</message>
<call function="'SNMPGet'">
@@ -119,7 +125,7 @@
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpCommunity' : 'OpenDS' ,
- 'snmpOIDs' : 'dsServerType.1' ,
+ 'snmpOIDs' : oid ,
'snmpStatus' : 'noSuchName'
}
</call>
@@ -132,25 +138,24 @@
<!--- Test Case information
#@TestMarker SNMP v1 with default configuration
- #@TestName snmp_v1_defaultconf: set with OpenDS@OpenDS
- commnunity
+ #@TestName v1_defaultconf: set with default commnunity
#@TestIssue none
- #@TestPurpose Check that a SNMP Set request with
- OpenDS@OpenDS community fails with noSuchName.
+ #@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
- ('snmp_v1_defaultconf: set with OpenDS@OpenDS community')">
+ ('v1_defaultconf: set with default community')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
- 'snmp_v1_defaultconf: set with OpenDS@OpenDS community'
+ 'v1_defaultconf: set with default community'
</message>
<call function="'SNMPSet'">
@@ -158,8 +163,8 @@
'snmpVersion' : '1',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : 'OpenDS@OpenDS' ,
- 'snmpOIDs' : 'dsServerType.1' ,
+ 'snmpCommunity' : community ,
+ 'snmpOIDs' : oid ,
'snmpStatus' : 'noSuchName'
}
</call>
@@ -172,7 +177,7 @@
<!--- Test Case information
#@TestMarker SNMP v1 with default configuration
- #@TestName snmp_v1_defaultconf: set with wrong commnunity
+ #@TestName v1_defaultconf: set with wrong commnunity
#@TestIssue none
#@TestPurpose Check that a SNMP Set request with wrong
community fails with noSuchName.
@@ -182,14 +187,14 @@
#@TestResult Success if SNMPSet returns 0.
-->
<testcase name="getTestCaseName
- ('snmp_v1_defaultconf: set with wrong community')">
+ ('v1_defaultconf: set with wrong community')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
- 'snmp_v1_defaultconf: set with wrong community'
+ 'v1_defaultconf: set with wrong community'
</message>
<call function="'SNMPSet'">
@@ -198,7 +203,7 @@
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpCommunity' : 'OpenDS' ,
- 'snmpOIDs' : 'dsServerType.1' ,
+ 'snmpOIDs' : oid ,
'snmpStatus' : 'noSuchName'
}
</call>
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp_v2c_defaultconf.xml b/opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp_v2c_defaultconf.xml
index fb84770..c28b1bb 100644
--- a/opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp_v2c_defaultconf.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp_v2c_defaultconf.xml
@@ -50,28 +50,34 @@
</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 snmp_v2c_defaultconf: get with OpenDS@OpenDS
- commnunity
+ #@TestName v2c_defaultconf: get with default commnunity
#@TestIssue none
- #@TestPurpose Check that a SNMP Get request with
- OpenDS@OpenDS community succeeds.
+ #@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
- ('snmp_v2c_defaultconf: get with default commnunity')">
+ ('v2c_defaultconf: get with default commnunity')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
- 'snmp_v2c_defaultconf: get with OpenDS@OpenDS community'
+ 'v2c_defaultconf: get with default community'
</message>
<call function="'SNMPGet'">
@@ -79,8 +85,8 @@
'snmpVersion' : '2',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : 'OpenDS@OpenDS' ,
- 'snmpOIDs' : 'dsServerType.1' ,
+ 'snmpCommunity' : community ,
+ 'snmpOIDs' : oid ,
'snmpStatus' : 'noError'
}
</call>
@@ -93,7 +99,7 @@
<!--- Test Case information
#@TestMarker SNMP v2c with default configuration
- #@TestName snmp_v2c_defaultconf: get with wrong
+ #@TestName v2c_defaultconf: get with wrong
commnunity
#@TestIssue none
#@TestPurpose Check that a SNMP Get request with wrong
@@ -105,14 +111,14 @@
#@TestResult Success if SNMPGet returns 0.
-->
<testcase name="getTestCaseName
- ('snmp_v2c_defaultconf: get with wrong community')">
+ ('v2c_defaultconf: get with wrong community')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
- 'snmp_v2c_defaultconf: get with wrong community'
+ 'v2c_defaultconf: get with wrong community'
</message>
<call function="'SNMPGet'">
@@ -121,7 +127,7 @@
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpCommunity' : 'OpenDS' ,
- 'snmpOIDs' : 'dsServerType.1' ,
+ 'snmpOIDs' : oid ,
'snmpStatus' : 'noError' ,
'snmpValidOIDs' : 'False'
}
@@ -135,26 +141,24 @@
<!--- Test Case information
#@TestMarker SNMP v2c with default configuration
- #@TestName snmp_v2c_defaultconf: set with OpenDS@OpenDS
- commnunity
+ #@TestName v2c_defaultconf: set with default ommnunity
#@TestIssue none
- #@TestPurpose Check that a SNMP Set request with
- OpenDS@OpenDS community fails with
- authorizationError.
+ #@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
- ('snmp_v2c_defaultconf: set with OpenDS@OpenDS community')">
+ ('v2c_defaultconf: set with default community')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
- 'snmp_v2c_defaultconf: set with OpenDS@OpenDS community'
+ 'v2c_defaultconf: set with default community'
</message>
<call function="'SNMPSet'">
@@ -162,8 +166,8 @@
'snmpVersion' : '2',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
- 'snmpCommunity' : 'OpenDS@OpenDS' ,
- 'snmpOIDs' : 'dsServerType.1' ,
+ 'snmpCommunity' : community ,
+ 'snmpOIDs' : oid ,
'snmpStatus' : 'authorizationError'
}
</call>
@@ -176,7 +180,7 @@
<!--- Test Case information
#@TestMarker SNMP v2c with default configuration
- #@TestName snmp_v2c_defaultconf: set with wrong
+ #@TestName v2c_defaultconf: set with wrong
commnunity
#@TestIssue none
#@TestPurpose Check that a SNMP Set request with wrong
@@ -187,14 +191,14 @@
#@TestResult Success if SNMPSet returns 0.
-->
<testcase name="getTestCaseName
- ('snmp_v2c_defaultconf: set with wrong community')">
+ ('v2c_defaultconf: set with wrong community')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
- 'snmp_v2c_defaultconf: set with wrong community'
+ 'v2c_defaultconf: set with wrong community'
</message>
<call function="'SNMPSet'">
@@ -203,7 +207,7 @@
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpCommunity' : 'OpenDS' ,
- 'snmpOIDs' : 'dsServerType.1' ,
+ 'snmpOIDs' : oid ,
'snmpStatus' : 'noAccess'
}
</call>
diff --git a/opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp_v3_defaultconf.xml b/opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp_v3_defaultconf.xml
index 3e138fe..89f82dd 100644
--- a/opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp_v3_defaultconf.xml
+++ b/opendj-sdk/opends/tests/functional-tests/testcases/snmp/snmp_v3_defaultconf.xml
@@ -51,18 +51,22 @@
<call function="'testSuite_Preamble'"/>
- <!--- Define default value for securityFile -->
+ <!--- Define default value for securityFile, securityLevel,
+ context and oid -->
<script>
securityFile = '%s/snmp/manager.security' % logsRemoteDataDir
+ securityLevel = SNMP_PROPERTIES['security-level']
+ context = SNMP_PROPERTIES['community']
+ oid = 'dsServerType.1'
</script>
<!--- Test Case information
#@TestMarker SNMP v3 with default configuration
- #@TestName snmp_v3_defaultconf: get with snmpAdmin user
- and OpenDS context
+ #@TestName v3_defaultconf: get with snmpAdmin user
+ and default context
#@TestIssue none
#@TestPurpose Check that a SNMP Get request with snmpAdmin
- user and OpenDS context fails with
+ user and default context fails with
authorizationError.
#@TestPreamble none
#@TestStep SNMP Get request.
@@ -70,14 +74,14 @@
#@TestResult Success if SNMPGet returns 0.
-->
<testcase name="getTestCaseName
- ('snmp_v3_defaultconf: get with snmpAdmin and OpenDS context')">
+ ('v3_defaultconf: get with snmpAdmin and default context')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
- 'snmp_v3_defaultconf: get with snmpAdmin and OpenDS context'
+ 'v3_defaultconf: get with snmpAdmin and default context'
</message>
<call function="'SNMPGet'">
@@ -86,10 +90,10 @@
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpUser' : 'snmpAdmin' ,
- 'snmpCommunity' : 'OpenDS' ,
- 'snmpSecurityLevel' : 'AuthNoPriv' ,
+ 'snmpCommunity' : context ,
+ 'snmpSecurityLevel' : securityLevel ,
'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : 'dsServerType.1' ,
+ 'snmpOIDs' : oid ,
'snmpStatus' : 'authorizationError'
}
</call>
@@ -102,11 +106,11 @@
<!--- Test Case information
#@TestMarker SNMP v3 with default configuration
- #@TestName snmp_v3_defaultconf: get with snmpAdmin user
- and default context
+ #@TestName v3_defaultconf: get with snmpAdmin user
+ and null context
#@TestIssue none
#@TestPurpose Check that a SNMP Get request with snmpAdmin
- user and default context succeeds but the OIDs
+ user and null context succeeds but the OIDs
values are not correct.
#@TestPreamble none
#@TestStep SNMP Get request.
@@ -114,14 +118,14 @@
#@TestResult Success if SNMPGet returns 0.
-->
<testcase name="getTestCaseName
- ('snmp_v3_defaultconf: get with snmpAdmin and default context')">
+ ('v3_defaultconf: get with snmpAdmin and null context')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
- 'snmp_v3_defaultconf: get with snmpAdmin and default context'
+ 'v3_defaultconf: get with snmpAdmin and null context'
</message>
<call function="'SNMPGet'">
@@ -130,10 +134,10 @@
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpUser' : 'snmpAdmin' ,
- 'snmpCommunity' : 'default' ,
- 'snmpSecurityLevel' : 'AuthNoPriv' ,
+ 'snmpCommunity' : 'null' ,
+ 'snmpSecurityLevel' : securityLevel ,
'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : 'dsServerType.1' ,
+ 'snmpOIDs' : oid ,
'snmpStatus' : 'noError' ,
'snmpValidOIDs' : 'False'
}
@@ -147,11 +151,11 @@
<!--- Test Case information
#@TestMarker SNMP v3 with default configuration
- #@TestName snmp_v3_defaultconf: det with snmpAdmin user
+ #@TestName v3_defaultconf: det with snmpAdmin user
and OpenDS context
#@TestIssue none
#@TestPurpose Check that a SNMP Set request with snmpAdmin
- user and OpenDS context fails with
+ user and default context fails with
authorizationError.
#@TestPreamble none
#@TestStep SNMP Set request.
@@ -159,14 +163,14 @@
#@TestResult Success if SNMPSet returns 0.
-->
<testcase name="getTestCaseName
- ('snmp_v3_defaultconf: set with snmpAdmin and OpenDS context')">
+ ('v3_defaultconf: set with snmpAdmin and default context')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
- 'snmp_v3_defaultconf: set with snmpAdmin and OpenDS context'
+ 'v3_defaultconf: set with snmpAdmin and default context'
</message>
<call function="'SNMPSet'">
@@ -175,10 +179,10 @@
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpUser' : 'snmpAdmin' ,
- 'snmpCommunity' : 'OpenDS' ,
- 'snmpSecurityLevel' : 'AuthNoPriv' ,
+ 'snmpCommunity' : context ,
+ 'snmpSecurityLevel' : securityLevel ,
'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : 'dsServerType.1' ,
+ 'snmpOIDs' : oid ,
'snmpStatus' : 'authorizationError'
}
</call>
@@ -191,25 +195,25 @@
<!--- Test Case information
#@TestMarker SNMP v3 with default configuration
- #@TestName snmp_v3_defaultconf: set with snmpAdmin user
- and default context
+ #@TestName v3_defaultconf: set with snmpAdmin user
+ and null context
#@TestIssue none
#@TestPurpose Check that a SNMP Set request with snmpAdmin
- user and default context fails with noAccess.
+ user and null context fails with noAccess.
#@TestPreamble none
#@TestStep SNMP Set request.
#@TestPostamble none
#@TestResult Success if SNMPSet returns 0.
-->
<testcase name="getTestCaseName
- ('snmp_v3_defaultconf: set with snmpAdmin and default context')">
+ ('v3_defaultconf: set with snmpAdmin and null context')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
- 'snmp_v3_defaultconf: set with snmpAdmin and default context'
+ 'v3_defaultconf: set with snmpAdmin and null context'
</message>
<call function="'SNMPSet'">
@@ -218,10 +222,10 @@
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpUser' : 'snmpAdmin' ,
- 'snmpCommunity' : 'default' ,
- 'snmpSecurityLevel' : 'AuthNoPriv' ,
+ 'snmpCommunity' : 'null' ,
+ 'snmpSecurityLevel' : securityLevel ,
'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : 'dsServerType.1' ,
+ 'snmpOIDs' : oid ,
'snmpStatus' : 'noAccess'
}
</call>
@@ -234,11 +238,11 @@
<!--- Test Case information
#@TestMarker SNMP v3 with default configuration
- #@TestName snmp_v3_defaultconf: get with defaultUser user
- and OpenDS context
+ #@TestName v3_defaultconf: get with defaultUser user
+ and default context
#@TestIssue none
#@TestPurpose Check that a SNMP Get request with defaultUser
- user and OpenDS context fails with
+ user and default context fails with
authorizationError.
#@TestPreamble none
#@TestStep SNMP Get request.
@@ -246,14 +250,14 @@
#@TestResult Success if SNMPGet returns 0.
-->
<testcase name="getTestCaseName
- ('snmp_v3_defaultconf: get with defaultUser and OpenDS context')">
+ ('v3_defaultconf: get with defaultUser and default context')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
- 'snmp_v3_defaultconf: get with defaultUser and OpenDS context'
+ 'v3_defaultconf: get with defaultUser and default context'
</message>
<call function="'SNMPGet'">
@@ -262,10 +266,10 @@
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpUser' : 'defaultUser' ,
- 'snmpCommunity' : 'OpenDS' ,
- 'snmpSecurityLevel' : 'AuthNoPriv' ,
+ 'snmpCommunity' : context ,
+ 'snmpSecurityLevel' : securityLevel ,
'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : 'dsServerType.1' ,
+ 'snmpOIDs' : oid ,
'snmpStatus' : 'authorizationError'
}
</call>
@@ -278,11 +282,11 @@
<!--- Test Case information
#@TestMarker SNMP v3 with default configuration
- #@TestName snmp_v3_defaultconf: get with defaultUser user
- and default context
+ #@TestName v3_defaultconf: get with defaultUser user
+ and null context
#@TestIssue none
#@TestPurpose Check that a SNMP Get request with defaultUser
- user and default context succeeds but the OIDs
+ user and null context succeeds but the OIDs
values are not correct.
#@TestPreamble none
#@TestStep SNMP Get request.
@@ -290,14 +294,14 @@
#@TestResult Success if SNMPGet returns 0.
-->
<testcase name="getTestCaseName
- ('snmp_v3_defaultconf: get with defaultUser and default context')">
+ ('v3_defaultconf: get with defaultUser and null context')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
- 'snmp_v3_defaultconf: get with defaultUser and default context'
+ 'v3_defaultconf: get with defaultUser and null context'
</message>
<call function="'SNMPGet'">
@@ -306,10 +310,10 @@
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpUser' : 'defaultUser' ,
- 'snmpCommunity' : 'default' ,
- 'snmpSecurityLevel' : 'AuthNoPriv' ,
+ 'snmpCommunity' : 'null' ,
+ 'snmpSecurityLevel' : securityLevel ,
'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : 'dsServerType.1' ,
+ 'snmpOIDs' : oid ,
'snmpStatus' : 'noError' ,
'snmpValidOIDs' : 'False'
}
@@ -323,11 +327,11 @@
<!--- Test Case information
#@TestMarker SNMP v3 with default configuration
- #@TestName snmp_v3_defaultconf: set with defaultUser user
- and OpenDS context
+ #@TestName v3_defaultconf: set with defaultUser user
+ and default context
#@TestIssue none
#@TestPurpose Check that a SNMP Set request with defaultUser
- user and OpenDS context fails with
+ user and default context fails with
authorizationError.
#@TestPreamble none
#@TestStep SNMP Set request.
@@ -335,14 +339,14 @@
#@TestResult Success if SNMPSet returns 0.
-->
<testcase name="getTestCaseName
- ('snmp_v3_defaultconf: set with defaultUser and OpenDS context')">
+ ('v3_defaultconf: set with defaultUser and default context')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
- 'snmp_v3_defaultconf: set with defaultUser and OpenDS context'
+ 'v3_defaultconf: set with defaultUser and default context'
</message>
<call function="'SNMPSet'">
@@ -351,10 +355,10 @@
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpUser' : 'defaultUser' ,
- 'snmpCommunity' : 'OpenDS' ,
- 'snmpSecurityLevel' : 'AuthNoPriv' ,
+ 'snmpCommunity' : context ,
+ 'snmpSecurityLevel' : securityLevel ,
'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : 'dsServerType.1' ,
+ 'snmpOIDs' : oid ,
'snmpStatus' : 'authorizationError'
}
</call>
@@ -367,25 +371,25 @@
<!--- Test Case information
#@TestMarker SNMP v3 with default configuration
- #@TestName snmp_v3_defaultconf: set with defaultUser user
- and default context
+ #@TestName v3_defaultconf: set with defaultUser user
+ and null context
#@TestIssue none
#@TestPurpose Check that a SNMP Set request with defaultUser
- user and default context fails with noAccess.
+ user and null context fails with noAccess.
#@TestPreamble none
#@TestStep SNMP Set request.
#@TestPostamble none
#@TestResult Success if SNMPSet returns 0.
-->
<testcase name="getTestCaseName
- ('snmp_v3_defaultconf: set with defaultUser and default context')">
+ ('v3_defaultconf: set with defaultUser and null context')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
- 'snmp_v3_defaultconf: set with defaultUser and default context'
+ 'v3_defaultconf: set with defaultUser and null context'
</message>
<call function="'SNMPSet'">
@@ -394,10 +398,10 @@
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpUser' : 'defaultUser' ,
- 'snmpCommunity' : 'default' ,
- 'snmpSecurityLevel' : 'AuthNoPriv' ,
+ 'snmpCommunity' : 'null' ,
+ 'snmpSecurityLevel' : securityLevel ,
'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : 'dsServerType.1' ,
+ 'snmpOIDs' : oid ,
'snmpStatus' : 'noAccess'
}
</call>
@@ -410,51 +414,7 @@
<!--- Test Case information
#@TestMarker SNMP v3 with default configuration
- #@TestName snmp_v3_defaultconf: get with unknown user
- and OpenDS context
- #@TestIssue none
- #@TestPurpose Check that a SNMP Get request with unknown
- user and OpenDS context fails with
- SnmpStatusException.
- #@TestPreamble none
- #@TestStep SNMP Get request.
- #@TestPostamble none
- #@TestResult Success if SNMPGet returns 0.
- -->
- <testcase name="getTestCaseName
- ('snmp_v3_defaultconf: get with unknown user and OpenDS context')">
-
- <sequence>
-
- <call function="'testCase_Preamble'"/>
-
- <message>
- 'snmp_v3_defaultconf: get with unknown user and OpenDS context'
- </message>
-
- <call function="'SNMPGet'">
- {
- 'snmpVersion' : '3',
- 'snmpHost' : DIRECTORY_INSTANCE_HOST ,
- 'snmpPort' : SNMP_PORT ,
- 'snmpUser' : 'myUser' ,
- 'snmpCommunity' : 'OpenDS' ,
- 'snmpSecurityLevel' : 'AuthNoPriv' ,
- 'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : 'dsServerType.1' ,
- 'snmpStatus' : 'SnmpStatusException'
- }
- </call>
-
- <call function="'testCase_Postamble'"/>
-
- </sequence>
-
- </testcase>
-
- <!--- Test Case information
- #@TestMarker SNMP v3 with default configuration
- #@TestName snmp_v3_defaultconf: get with unknown user
+ #@TestName v3_defaultconf: get with unknown user
and default context
#@TestIssue none
#@TestPurpose Check that a SNMP Get request with unknown
@@ -466,14 +426,14 @@
#@TestResult Success if SNMPGet returns 0.
-->
<testcase name="getTestCaseName
- ('snmp_v3_defaultconf: get with unknown user and default context')">
+ ('v3_defaultconf: get with unknown user and default context')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
- 'snmp_v3_defaultconf: get with unknown user and default context'
+ 'v3_defaultconf: get with unknown user and default context'
</message>
<call function="'SNMPGet'">
@@ -482,10 +442,10 @@
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpUser' : 'myUser' ,
- 'snmpCommunity' : 'default' ,
- 'snmpSecurityLevel' : 'AuthNoPriv' ,
+ 'snmpCommunity' : context ,
+ 'snmpSecurityLevel' : securityLevel ,
'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : 'dsServerType.1' ,
+ 'snmpOIDs' : oid ,
'snmpStatus' : 'SnmpStatusException'
}
</call>
@@ -498,38 +458,38 @@
<!--- Test Case information
#@TestMarker SNMP v3 with default configuration
- #@TestName snmp_v3_defaultconf: set with unknown user
- and OpenDS context
+ #@TestName v3_defaultconf: get with unknown user
+ and null context
#@TestIssue none
- #@TestPurpose Check that a SNMP Set request with unknown
- user and OpenDS context fails with
+ #@TestPurpose Check that a SNMP Get request with unknown
+ user and null context fails with
SnmpStatusException.
#@TestPreamble none
- #@TestStep SNMP Set request.
+ #@TestStep SNMP Get request.
#@TestPostamble none
- #@TestResult Success if SNMPSet returns 0.
+ #@TestResult Success if SNMPGet returns 0.
-->
<testcase name="getTestCaseName
- ('snmp_v3_defaultconf: set with unknown user and OpenDS context')">
+ ('v3_defaultconf: get with unknown user and default context')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
- 'snmp_v3_defaultconf: set with unknown user and OpenDS context'
+ 'v3_defaultconf: get with unknown user and default context'
</message>
- <call function="'SNMPSet'">
+ <call function="'SNMPGet'">
{
'snmpVersion' : '3',
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpUser' : 'myUser' ,
- 'snmpCommunity' : 'OpenDS' ,
- 'snmpSecurityLevel' : 'AuthNoPriv' ,
+ 'snmpCommunity' : 'null' ,
+ 'snmpSecurityLevel' : securityLevel ,
'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : 'dsServerType.1' ,
+ 'snmpOIDs' : oid ,
'snmpStatus' : 'SnmpStatusException'
}
</call>
@@ -542,7 +502,7 @@
<!--- Test Case information
#@TestMarker SNMP v3 with default configuration
- #@TestName snmp_v3_defaultconf: set with unknown user
+ #@TestName v3_defaultconf: set with unknown user
and default context
#@TestIssue none
#@TestPurpose Check that a SNMP Set request with unknown
@@ -554,14 +514,14 @@
#@TestResult Success if SNMPSet returns 0.
-->
<testcase name="getTestCaseName
- ('snmp_v3_defaultconf: set with unknown user and default context')">
+ ('v3_defaultconf: set with unknown user and default context')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
- 'snmp_v3_defaultconf: set with unknown user and default context'
+ 'v3_defaultconf: set with unknown user and OpenDS context'
</message>
<call function="'SNMPSet'">
@@ -570,10 +530,54 @@
'snmpHost' : DIRECTORY_INSTANCE_HOST ,
'snmpPort' : SNMP_PORT ,
'snmpUser' : 'myUser' ,
- 'snmpCommunity' : 'default' ,
- 'snmpSecurityLevel' : 'AuthNoPriv' ,
+ 'snmpCommunity' : context ,
+ 'snmpSecurityLevel' : securityLevel ,
'snmpSecurityFile' : securityFile ,
- 'snmpOIDs' : 'dsServerType.1' ,
+ '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>
diff --git a/opendj-sdk/opends/tests/shared/java/snmp/SNMPGet.java b/opendj-sdk/opends/tests/shared/java/snmp/SNMPGet.java
index 3a27b67..6f29ccf 100644
--- a/opendj-sdk/opends/tests/shared/java/snmp/SNMPGet.java
+++ b/opendj-sdk/opends/tests/shared/java/snmp/SNMPGet.java
@@ -100,11 +100,11 @@
user = val;
break;
case 'l':
- if (val.compareTo("NoAuthNoPriv") == 0) {
+ if (val.compareTo("noauthnopriv") == 0) {
securityLevel = SnmpDefinitions.noAuthNoPriv;
- } else if (val.compareTo("AuthNoPriv") == 0) {
+ } else if (val.compareTo("authnopriv") == 0) {
securityLevel = SnmpDefinitions.authNoPriv;
- } else if (val.compareTo("AuthPriv") == 0) {
+ } else if (val.compareTo("authpriv") == 0) {
securityLevel = SnmpDefinitions.authPriv;
} else {
System.out.println(
@@ -242,7 +242,7 @@
// Set the context name
//
- if (community.compareTo("default") != 0) {
+ if (community.compareTo("null") != 0) {
paramsV3.setContextName(community.getBytes());
}
diff --git a/opendj-sdk/opends/tests/shared/java/snmp/SNMPSet.java b/opendj-sdk/opends/tests/shared/java/snmp/SNMPSet.java
index 4707bf2..aa0325e 100644
--- a/opendj-sdk/opends/tests/shared/java/snmp/SNMPSet.java
+++ b/opendj-sdk/opends/tests/shared/java/snmp/SNMPSet.java
@@ -102,11 +102,11 @@
user = val;
break;
case 'l':
- if (val.compareTo("NoAuthNoPriv") == 0) {
+ if (val.compareTo("noauthnopriv") == 0) {
securityLevel = SnmpDefinitions.noAuthNoPriv;
- } else if (val.compareTo("AuthNoPriv") == 0) {
+ } else if (val.compareTo("authnopriv") == 0) {
securityLevel = SnmpDefinitions.authNoPriv;
- } else if (val.compareTo("AuthPriv") == 0) {
+ } else if (val.compareTo("authpriv") == 0) {
securityLevel = SnmpDefinitions.authPriv;
} else {
System.out.println(
@@ -242,7 +242,7 @@
// Set the context name
//
- if (community.compareTo("default") != 0) {
+ if (community.compareTo("null") != 0) {
paramsV3.setContextName(community.getBytes());
}
--
Gitblit v1.10.0