Skip to content

Enable the SNMP tests in the default build#705

Open
vharseko wants to merge 5 commits into
OpenIdentityPlatform:masterfrom
vharseko:features/enable-snmp-tests
Open

Enable the SNMP tests in the default build#705
vharseko wants to merge 5 commits into
OpenIdentityPlatform:masterfrom
vharseko:features/enable-snmp-tests

Conversation

@vharseko

@vharseko vharseko commented Jul 5, 2026

Copy link
Copy Markdown
Member

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 the snmp profile 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

<jvmarg value="-Dorg.opends.server.snmp.opendmk=${opendmk.lib.dir}" />

inside systemPropertyVariables, which defines a useless system property literally 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 received null/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 SNMPSyncManagerV2AccessTest failures (Error status = reqTimeout) were identical on every Linux JDK job — not a macOS quirk. Root cause: the test still used the community/context string OpenDS@OpenDS from before the OpenDS→OpenDJ rebranding. The SNMP connection handler registers DIRECTORY_SERVER_MIB under context name = configured community (SNMPClassLoaderProvider: contextName = getCommunity()), whose default has long been OpenDJ, and the JDMK adaptor silently drops v2 requests addressed to the unknown OpenDS context — 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 the expectedResult=false rows always passed.

Fixed by switching the two strings to OpenDJ@OpenDJ.

State

  • SNMPTrapManagerTest: 1/1 green (three consecutive local runs) — was failing in setUp before the property fix.
  • SNMPSyncManagerV2AccessTest (previously fully enabled = false): enabled and 12/12 green locally in ~18s (previously 80s+ of timeouts). The SNMP peers are switched to localhost, which is also more reliable in CI containers.

Notes

vharseko added 3 commits July 4, 2026 18:21
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.
@vharseko vharseko added the tests Test suites: fixing, enabling, un-disabling label Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build CI tests Test suites: fixing, enabling, un-disabling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant