Enable the SNMP tests in the default build#705
Open
vharseko wants to merge 5 commits into
Open
Conversation
The org.opends.quicksetup tests were dead three times over: every test method was annotated enabled=false, the classes were in the "slow" group excluded from CI, and the whole package was excluded from the failsafe run. Once enabled, the suite turned out to be almost entirely functional - it extracts the packaged server, runs a real setup and exercises the installation. Four failures remained: - ConfigurationTest and ServerControllerTest lacked the sequential=true annotation required by the test listener; - Configuration.getDatabasePaths() was empty because TestUtilities ran setup without creating any backend; pass -b dc=example,dc=com; - Installation.getBaseConfigurationFile() pointed at config/upgrade/config.ldif.<revision>, a snapshot which modern packages no longer ship: return the pristine configuration from template/config/config.ldif instead, which also repairs Installer.revertToBaseConfiguration(). Also make TestUtilities.getInstallPackageFile() skip the -slim archive instead of picking whichever zip the filesystem lists first. Enable all quicksetup test methods (except one Windows-only case), move the classes out of the "slow" group and drop the quicksetup exclusion from the failsafe configuration so that the suite (68 tests, ~1.5 minutes plus one server install per suite) runs in the default build.
InstallationTest.testGetOpenDSJarFile, revived by this branch, fails on Linux CI while passing on Windows: the assembly packages the server jar as lib/opendj.jar, but Installation.getOpenDSJarFile() looked up the ForgeRock-era mixed-case OpenDJ.jar, which only matched on case-insensitive file systems. The stale path also leaked into production code through Uninstaller.
The SNMP tests were excluded twice - from test compilation and from the failsafe run - even though the OpenDMK jars they need are checked into the repository (opendj-server-legacy/opendmk) and the snmp profile is therefore always active. Enabling them uncovered a broken leftover from the ant-to-Maven conversion: the failsafe configuration contained <jvmarg value="-Dorg.opends.server.snmp.opendmk=..."/> inside systemPropertyVariables, which defines a useless system property named "jvmarg" instead of passing org.opends.server.snmp.opendmk. The tests configure the SNMP connection handler with ds-cfg-opendmk-jarfile = <property>/jdmkrt.jar, so the handler never loaded OpenDMK and could not start. Pass the property properly. With that fixed, SNMPTrapManagerTest passes. SNMPSyncManagerV2AccessTest (previously fully disabled with enabled=false) is enabled as well and its SNMP manager now talks to the agent, but its eight attribute GET checks still time out on macOS; the SNMP peers are switched from the canonical host name to localhost, which is more reliable in CI environments. If the attribute checks turn out to fail on Linux as well, they can be disabled again with a pointer to the analysis.
…enDJ The test still used the pre-rebranding community/context string. The SNMP connection handler registers DIRECTORY_SERVER_MIB under context name = configured community (default "OpenDJ" since the OpenDS->OpenDJ rename), and the adaptor silently drops v2 requests addressed to the unknown "OpenDS" context, so all seven attribute GETs and the valid-community check failed with reqTimeout on every platform. With the correct community string all 12 tests pass in ~18s.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
The SNMP tests were excluded twice — from test compilation (
testExcludes) and from the failsafe run — even though the OpenDMK jars they need are checked into the repository (opendj-server-legacy/opendmk, updated in #572) and thesnmpprofile is therefore always active. The code still compiles cleanly.Real bug #1: OpenDMK property lost in the ant-to-Maven conversion
Enabling the tests uncovered a broken leftover from the ant-to-Maven conversion: the failsafe configuration contained
inside
systemPropertyVariables, which defines a useless system property literally namedjvmarginstead of passingorg.opends.server.snmp.opendmk. The tests configure the SNMP connection handler withds-cfg-opendmk-jarfile = <property>/jdmkrt.jar, so the handler receivednull/jdmkrt.jar, never loaded OpenDMK and could not start. The property is now passed properly.Real bug #2: the test still spoke to the pre-2011 "OpenDS" SNMP context
The first CI round confirmed the eight remaining
SNMPSyncManagerV2AccessTestfailures (Error status = reqTimeout) were identical on every Linux JDK job — not a macOS quirk. Root cause: the test still used the community/context stringOpenDS@OpenDSfrom before the OpenDS→OpenDJ rebranding. The SNMP connection handler registersDIRECTORY_SERVER_MIBunder context name = configured community (SNMPClassLoaderProvider:contextName = getCommunity()), whose default has long beenOpenDJ, and the JDMK adaptor silently drops v2 requests addressed to the unknownOpenDScontext — hence the timeouts on all seven attribute GETs and on the valid-community check. Plain communities (public,dummy, …) land in the default context and get a noError response with an invalid value, which is why theexpectedResult=falserows always passed.Fixed by switching the two strings to
OpenDJ@OpenDJ.State
SNMPTrapManagerTest: 1/1 green (three consecutive local runs) — was failing insetUpbefore the property fix.SNMPSyncManagerV2AccessTest(previously fullyenabled = false): enabled and 12/12 green locally in ~18s (previously 80s+ of timeouts). The SNMP peers are switched tolocalhost, which is also more reliable in CI containers.Notes
<excludes>block) — merge after it.slowgroup audit follow-up ([#697] Fix global idle-time-limit having no effect on client connections #684-Include *TestSuite classes in the failsafe run #703).