diff --git a/opendj-server-legacy/pom.xml b/opendj-server-legacy/pom.xml index 0bce01ffc4..bff905ec08 100644 --- a/opendj-server-legacy/pom.xml +++ b/opendj-server-legacy/pom.xml @@ -648,9 +648,6 @@ false false -nowarn - - **/org/opends/server/snmp/** - @@ -1260,9 +1257,6 @@ 2400 120 - - org/opends/server/snmp/** - **/Test*.java **/*Test.java @@ -1289,7 +1283,7 @@ ${basedir} ${project.build.directory} LOG - + ${opendmk.lib.dir} true true false diff --git a/opendj-server-legacy/src/test/java/org/opends/server/snmp/SNMPConnectionManager.java b/opendj-server-legacy/src/test/java/org/opends/server/snmp/SNMPConnectionManager.java index 9932f6948d..4aedf8cbf0 100644 --- a/opendj-server-legacy/src/test/java/org/opends/server/snmp/SNMPConnectionManager.java +++ b/opendj-server-legacy/src/test/java/org/opends/server/snmp/SNMPConnectionManager.java @@ -13,6 +13,7 @@ * * Copyright 2008 Sun Microsystems, Inc. * Portions copyright 2014-2016 ForgeRock AS. + * Portions copyright 2026 3A Systems, LLC */ package org.opends.server.snmp; @@ -139,7 +140,7 @@ protected SnmpUsmPeer getSnmpV3Peer(int port) try { - String host = InetAddress.getLocalHost().getCanonicalHostName(); + String host = "localhost"; SnmpOidTableSupport oidTable = new DIRECTORY_SERVER_MIBOidTable(); SnmpOid.setSnmpOidTable(oidTable); @@ -166,7 +167,7 @@ protected SnmpPeer getSnmpV2Peer(int port) try { - String host = InetAddress.getLocalHost().getCanonicalHostName(); + String host = "localhost"; SnmpOidTableSupport oidTable = new DIRECTORY_SERVER_MIBOidTable(); SnmpOid.setSnmpOidTable(oidTable); return new SnmpPeer(host, port); diff --git a/opendj-server-legacy/src/test/java/org/opends/server/snmp/SNMPSyncManagerV2AccessTest.java b/opendj-server-legacy/src/test/java/org/opends/server/snmp/SNMPSyncManagerV2AccessTest.java index 44999ad217..85192d68cf 100644 --- a/opendj-server-legacy/src/test/java/org/opends/server/snmp/SNMPSyncManagerV2AccessTest.java +++ b/opendj-server-legacy/src/test/java/org/opends/server/snmp/SNMPSyncManagerV2AccessTest.java @@ -13,6 +13,7 @@ * * Copyright 2008 Sun Microsystems, Inc. * Portions Copyright 2014-2016 ForgeRock AS. + * Portions Copyright 2024-2026 3A Systems, LLC */ package org.opends.server.snmp; @@ -34,7 +35,7 @@ /** * SNMP tests. */ -@Test(enabled=false, groups = {"precommit", "snmp"}, sequential = true) +@Test(groups = {"precommit", "snmp"}, sequential = true) public class SNMPSyncManagerV2AccessTest extends SNMPConnectionManager { @BeforeClass @@ -60,7 +61,7 @@ Object[][] listAttributes() { {"dsSlaveHits"}}; } - @Test(enabled=false,dataProvider = "listAttributes") + @Test(dataProvider = "listAttributes") public void checkAttribute(String attributeName) { // get the SNMP peer agent @@ -76,7 +77,7 @@ public void checkAttribute(String attributeName) { new SnmpParameters(); // Set to the allowed the community string - params.setRdCommunity("OpenDS@OpenDS"); + params.setRdCommunity("OpenDJ@OpenDJ"); // The newly created parameter must be associated to the agent. // @@ -163,17 +164,17 @@ Object[][] listCommunities() { return new Object[][]{ {"public", false}, {"private", false}, - {"OpenDS@OpenDS", true}, + {"OpenDJ@OpenDJ", true}, {"dummy", false}, {"", false}}; } - @Test(enabled = false,dataProvider = "listCommunities") + @Test(dataProvider = "listCommunities") public void checkCommunity(String community, boolean expectedResult) { try { - String host = InetAddress.getLocalHost().getCanonicalHostName(); + String host = "localhost"; // Initialize the SNMP Manager API. // Specify the OidTable containing all the MIB II knowledge. // Use the OidTable generated by mibgen when compiling MIB II.