| | |
| | | </additionalClasspathElements> |
| | | <testSourceDirectory>src/test/java</testSourceDirectory> |
| | | <!-- <enableProcessChecker>all</enableProcessChecker>--> |
| | | <forkedProcessTimeoutInSeconds>900</forkedProcessTimeoutInSeconds> |
| | | <forkedProcessTimeoutInSeconds>2400</forkedProcessTimeoutInSeconds> |
| | | <forkedProcessExitTimeoutInSeconds>120</forkedProcessExitTimeoutInSeconds> |
| | | <excludes> |
| | | <exclude>org/opends/server/snmp/**</exclude> |
| | |
| | | <value>org.opends.server.TestListener</value> |
| | | </property> |
| | | <property> |
| | | <name>excludegroups</name> |
| | | <value>slow</value> |
| | | </property> |
| | | <property> |
| | | <name>configfailurepolicy</name> |
| | | <value>skip</value> |
| | | </property> |
| | |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * Indicates whether this handler is served from the in-memory message |
| | | * queue, i.e. it is done catching up with the changelog DB. |
| | | * <p> |
| | | * Package private: allows tests to wait until a freshly connected peer |
| | | * will receive published updates through the in-memory queue path rather |
| | | * than re-read from the changelog DB. |
| | | * |
| | | * @return true when this handler follows the in-memory message queue |
| | | */ |
| | | boolean isFollowing() |
| | | { |
| | | synchronized (msgQueue) |
| | | { |
| | | return following; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Retrieves the name of this monitor provider. It should be unique among all |
| | | * monitor providers, including all instances of the same monitor provider. |
| | | * |
| | |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.core; |
| | | |
| | |
| | | * |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test(groups = { "slow" }) |
| | | @Test |
| | | public void testDisconnectInPreParse() |
| | | throws Exception |
| | | { |
| | |
| | | * |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test(groups = { "slow" }) |
| | | @Test |
| | | public void testNoSuchOperation() |
| | | throws Exception |
| | | { |
| | |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.core; |
| | | |
| | |
| | | * |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test(groups = "slow") |
| | | @Test |
| | | public void testCannotLockEntry() throws Exception |
| | | { |
| | | TestCaseUtils.initializeTestBackend(true); |
| | |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.core; |
| | | |
| | |
| | | * |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test(groups = "slow") |
| | | @Test |
| | | public void testSubtreeDeleteClearsAuthInfo() |
| | | throws Exception |
| | | { |
| | |
| | | * |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test(groups = "slow") |
| | | @Test |
| | | public void testSubtreeModifyUpdatesAuthInfo() |
| | | throws Exception |
| | | { |
| | |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.core; |
| | | |
| | |
| | | * |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test(groups = { "slow" }) |
| | | @Test |
| | | public void testCannotLockEntry() throws Exception |
| | | { |
| | | TestCaseUtils.initializeTestBackend(true); |
| | |
| | | * |
| | | * Copyright 2006-2011 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.core; |
| | | |
| | |
| | | * |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test(dataProvider = "baseDNs", groups = { "slow" }) |
| | | @Test(dataProvider = "baseDNs") |
| | | public void testCannotLockEntry(String baseDN) |
| | | throws Exception |
| | | { |
| | |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.core; |
| | | |
| | |
| | | * |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test(groups = "slow") |
| | | @Test |
| | | public void testPasswordHistoryUsingDuration() |
| | | throws Exception |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | @Test(groups = "slow") |
| | | @Test |
| | | public void testWriteLockModify() throws Exception |
| | | { |
| | | // We need the operation to be run in a separate thread because we are going |
| | |
| | | * |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test(dataProvider = "validConfigs", groups= { "slow" }) |
| | | @Test(dataProvider = "validConfigs") |
| | | public void testInitializeWithValidConfigs(Entry e) |
| | | throws Exception |
| | | { |
| | |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | * |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test(dataProvider = "validConfigs", groups = "slow") |
| | | @Test(dataProvider = "validConfigs") |
| | | public void testInitializeWithValidConfigs(Entry e) |
| | | throws Exception |
| | | { |
| | |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Test(groups = { "slow", "testDefaultCacheConcurrency" }, |
| | | @Test(groups = { "testDefaultCacheConcurrency" }, |
| | | threadPoolSize = 10, |
| | | invocationCount = 10, |
| | | timeOut = 60000) |
| | |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Test(groups = { "slow", "testFIFOCacheConcurrency" }, |
| | | @Test(groups = { "testFIFOCacheConcurrency" }, |
| | | threadPoolSize = 10, |
| | | invocationCount = 10, |
| | | timeOut = 60000) |
| | |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Test(groups = { "slow", "testSoftRefCacheConcurrency" }, |
| | | @Test(groups = { "testSoftRefCacheConcurrency" }, |
| | | threadPoolSize = 10, |
| | | invocationCount = 10, |
| | | timeOut = 60000) |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2012-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | import org.w3c.dom.NodeList; |
| | | |
| | | /** Tests for {@link TLSByteChannel} class. */ |
| | | @Test(groups = "slow", sequential = true) |
| | | @Test(sequential = true) |
| | | public class TLSByteChannelTestCase extends DirectoryServerTestCase |
| | | { |
| | | /** Cipher suite hardcoded from the IANA registry on internet. */ |
| | |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.protocols; |
| | | |
| | |
| | | * |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test(groups = "slow") |
| | | @Test |
| | | public void testValidUserLDIF() |
| | | throws Exception |
| | | { |
| | |
| | | * |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test(groups = "slow") |
| | | @Test |
| | | public void testValidConfigLDIF() |
| | | throws Exception |
| | | { |
| | |
| | | * |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test(groups = "slow") |
| | | @Test |
| | | public void testUnparseableLDIF() |
| | | throws Exception |
| | | { |
| | |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.protocols.jmx; |
| | | |
| | |
| | | * Perform a simple connect. |
| | | * @throws Exception If something wrong occurs. |
| | | */ |
| | | @Test(enabled = false, groups = "slow") |
| | | @Test |
| | | public void checkPostConnectDisconnectPlugin() throws Exception |
| | | { |
| | | // Before the test, how many time postconnect and postdisconnect |
| | |
| | | * |
| | | * Copyright 2007-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.replication; |
| | | |
| | |
| | | * Then test that the sequence of Delete necessary to remove |
| | | * all those entries is also correctly ordered. |
| | | */ |
| | | @Test(enabled=true, groups="slow") |
| | | @Test(enabled=true) |
| | | public void addModDelDependencyTest() throws Exception |
| | | { |
| | | ReplicationServer replServer = null; |
| | |
| | | * has been added. |
| | | * To increase the risks of failures a loop of add/del/add is done. |
| | | */ |
| | | @Test(enabled=true, groups="slow") |
| | | @Test(enabled=true) |
| | | public void addDelAddDependencyTest() throws Exception |
| | | { |
| | | ReplicationServer replServer = null; |
| | |
| | | * Check that the dependency of moddn operation are working by |
| | | * issuing a set of Add operation followed by a modrdn of the added entry. |
| | | */ |
| | | @Test(enabled=true, groups="slow") |
| | | @Test(enabled=true) |
| | | public void addModdnDependencyTest() throws Exception |
| | | { |
| | | ReplicationServer replServer = null; |
| | |
| | | * Test generationID saving when the root entry does not exist |
| | | * at the moment when the replication is enabled. |
| | | */ |
| | | @Test(dependsOnMethods = { "testMultiRS" }, groups = "slow") |
| | | @Test(dependsOnMethods = { "testMultiRS" }) |
| | | public void testServerStop() throws Exception |
| | | { |
| | | String testCase = "testServerStop"; |
| | |
| | | * Loop opening sessions to the Replication Server |
| | | * to check that it handle correctly disconnection and reconnection. |
| | | */ |
| | | @Test(dependsOnMethods = { "testServerStop" }, groups = "slow") |
| | | @Test(dependsOnMethods = { "testServerStop" }) |
| | | public void testLoop() throws Exception |
| | | { |
| | | String testCase = "testLoop"; |
| | |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.replication; |
| | | |
| | |
| | | * and test that, on S1 side, the task ends with an error. |
| | | * State of the backend on S1 partially initialized: ? |
| | | */ |
| | | @Test(enabled=true, groups="slow") |
| | | @Test(enabled=true) |
| | | public void initializeImport() throws Exception |
| | | { |
| | | String testCase = "initializeImport "; |
| | |
| | | * - test that S1 has successfully exported the entries (by receiving them |
| | | * on S2 side). |
| | | */ |
| | | @Test(enabled=true, groups="slow") |
| | | @Test(enabled=true) |
| | | public void initializeExport() throws Exception |
| | | { |
| | | String testCase = "initializeExport"; |
| | |
| | | * - wait task completed |
| | | * - test that S2 has successfully received the entries |
| | | */ |
| | | @Test(enabled=true, groups="slow") |
| | | @Test(enabled=true) |
| | | public void initializeTargetExport() throws Exception |
| | | { |
| | | String testCase = "initializeTargetExport"; |
| | |
| | | * |
| | | * TODO: Error case: make S2 crash in the middle of the import and test what?? |
| | | */ |
| | | @Test(enabled=true, groups="slow") |
| | | @Test(enabled=true) |
| | | public void initializeTargetExportAll() throws Exception |
| | | { |
| | | String testCase = "initializeTargetExportAll"; |
| | |
| | | /** |
| | | * Tests the import side of the InitializeTarget task. |
| | | */ |
| | | @Test(enabled=true, groups="slow") |
| | | @Test(enabled=true) |
| | | public void initializeTargetImport() throws Exception |
| | | { |
| | | String testCase = "initializeTargetImport"; |
| | |
| | | * connected to each replication server of the topology, thanks to the |
| | | * ReplServerInfoMessage(s) exchanged by the replication servers. |
| | | */ |
| | | @Test(enabled=true, groups="slow") |
| | | @Test(enabled=true) |
| | | public void testReplServerInfos() throws Exception |
| | | { |
| | | String testCase = "testReplServerInfos"; |
| | |
| | | return domain.getConnectedDSs().keySet(); |
| | | } |
| | | |
| | | @Test(enabled=true, groups="slow") |
| | | @Test(enabled=true) |
| | | public void initializeTargetExportMultiSS() throws Exception |
| | | { |
| | | String testCase = "initializeTargetExportMultiSS"; |
| | |
| | | Assertions.assertThat(msgrcv).isInstanceOf(InitializeTargetMsg.class); |
| | | } |
| | | |
| | | @Test(enabled=true, groups="slow") |
| | | @Test(enabled=true) |
| | | public void initializeExportMultiSS() throws Exception |
| | | { |
| | | String testCase = "initializeExportMultiSS"; |
| | |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.replication; |
| | | |
| | |
| | | * - receive all messages from the ReplicationBroker, check that |
| | | * the client receives the correct number of operations. |
| | | */ |
| | | @Test(enabled=true, groups="slow") |
| | | @Test(enabled=true) |
| | | public void saturateQueueAndRestart() throws Exception |
| | | { |
| | | logger.error(LocalizableMessage.raw("Starting Replication ProtocolWindowTest : saturateAndRestart")); |
| | |
| | | * |
| | | * Copyright 2007-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.replication; |
| | | |
| | |
| | | * <li>Check that entry has been added again in the LDAP server.</li> |
| | | * </ol> |
| | | */ |
| | | @Test(enabled=true, groups="slow") |
| | | @Test(enabled=true) |
| | | public void testResyncAfterRestore() throws Exception |
| | | { |
| | | // Delete the entry we are going to use to make sure that we do test something. |
| | |
| | | * <li>Check that entry has been added again in the LDAP server.</li> |
| | | * </ol> |
| | | */ |
| | | @Test(enabled=true, groups="slow") |
| | | @Test(enabled=true) |
| | | public void testResyncAfterImport() throws Exception |
| | | { |
| | | // delete the entry we are going to use to make sure that we do test something. |
| | |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.replication.plugin; |
| | | |
| | |
| | | * Tests that a DS receiving an update from a RS in safe read mode effectively |
| | | * sends an ack back (with or without error). |
| | | */ |
| | | @Test(dataProvider = "rsGroupIdProvider", groups = "slow") |
| | | @Test(dataProvider = "rsGroupIdProvider") |
| | | public void testSafeReadModeReply(byte rsGroupId) throws Exception |
| | | { |
| | | int TIMEOUT = 5000; |
| | |
| | | * Tests that a DS receiving an update from a RS in safe data mode does not |
| | | * send back and ack (only safe read is taken into account in DS replay). |
| | | */ |
| | | @Test(dataProvider = "rsGroupIdProvider", groups = "slow") |
| | | @Test(dataProvider = "rsGroupIdProvider") |
| | | public void testSafeDataModeReply(byte rsGroupId) throws Exception |
| | | { |
| | | int TIMEOUT = 5000; |
| | |
| | | * DS performs many successive modifications in safe data mode and receives RS |
| | | * acks with various errors. Check for monitoring right errors |
| | | */ |
| | | @Test(groups = "slow") |
| | | @Test |
| | | public void testSafeDataManyErrors() throws Exception |
| | | { |
| | | int TIMEOUT = 5000; |
| | |
| | | * DS performs many successive modifications in safe read mode and receives RS |
| | | * acks with various errors. Check for monitoring right errors |
| | | */ |
| | | @Test(groups = "slow") |
| | | @Test |
| | | public void testSafeReadManyErrors() throws Exception |
| | | { |
| | | int TIMEOUT = 5000; |
| | |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.replication.plugin; |
| | | |
| | |
| | | * Calls the testExclude test with a larger set of data, for nightly tests |
| | | * purpose |
| | | */ |
| | | @Test(dataProvider = "testExcludeNightlyProvider", groups = "slow") |
| | | @Test(dataProvider = "testExcludeNightlyProvider") |
| | | public void testExcludeNightly(int testProviderLineId, |
| | | String... fractionalConf) throws Exception |
| | | { |
| | |
| | | * Calls the testInclude test with a larger set of data, for nightly tests |
| | | * purpose |
| | | */ |
| | | @Test(dataProvider = "testIncludeNightlyProvider", groups = "slow") |
| | | @Test(dataProvider = "testIncludeNightlyProvider") |
| | | public void testIncludeNightly(int testProviderLineId, |
| | | String... fractionalConf) throws Exception |
| | | { |
| | |
| | | * Calls the testInitWithFullUpdateExclude test with a larger set of data, for nightly tests |
| | | * purpose |
| | | */ |
| | | @Test(dataProvider = "testInitWithFullUpdateExcludeNightlyProvider", groups = "slow") |
| | | @Test(dataProvider = "testInitWithFullUpdateExcludeNightlyProvider") |
| | | public void testInitWithFullUpdateExcludeNightly(int testProviderLineId, |
| | | boolean importedDomainIsFractional, String... fractionalConf) throws Exception |
| | | { |
| | |
| | | * Calls the testInitWithFullUpdateExclude test with a larger set of data, for nightly tests |
| | | * purpose |
| | | */ |
| | | @Test(dataProvider = "testInitWithFullUpdateIncludeNightlyProvider", groups = "slow") |
| | | @Test(dataProvider = "testInitWithFullUpdateIncludeNightlyProvider") |
| | | public void testInitWithFullUpdateIncludeNightly(int testProviderLineId, |
| | | boolean importedDomainIsFractional, String... fractionalConf) throws Exception |
| | | { |
| | |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.replication.plugin; |
| | | |
| | |
| | | * - Change group id of DS1 and DS2 to 3 : they should reconnect to RS1 |
| | | * @throws Exception If a problem occurred |
| | | */ |
| | | @Test (groups = "slow") |
| | | @Test |
| | | public void testRSWithManyGroupIds() throws Exception |
| | | { |
| | | String testCase = "testRSWithManyGroupIds"; |
| | |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.replication.plugin; |
| | | |
| | |
| | | * |
| | | * @throws Exception If a problem occurred |
| | | */ |
| | | @Test(groups="slow") |
| | | @Test |
| | | public void testFailOverMulti() throws Exception |
| | | { |
| | | String testCase = "testFailOverMulti"; |
| | |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.replication.plugin; |
| | | |
| | |
| | | * Execute a full scenario with some RSs failovers and dynamic weight changes. |
| | | * @throws Exception If a problem occurred |
| | | */ |
| | | @Test (groups = "slow") |
| | | @Test |
| | | public void testFailoversAndWeightChanges() throws Exception |
| | | { |
| | | String testCase = "testFailoversAndWeightChanges"; |
| | |
| | | * disconnections/reconnections after the very first connections. |
| | | * @throws Exception If a problem occurred |
| | | */ |
| | | @Test (enabled=true,groups = "slow") |
| | | @Test (enabled=true) |
| | | public void testNoYoyo1() throws Exception |
| | | { |
| | | String testCase = "testNoYoyo1"; |
| | |
| | | * disconnections/reconnections after the very first connections. |
| | | * @throws Exception If a problem occurred |
| | | */ |
| | | @Test (enabled=true, groups = "slow") |
| | | @Test (enabled=true) |
| | | public void testNoYoyo2() throws Exception |
| | | { |
| | | String testCase = "testNoYoyo2"; |
| | |
| | | * disconnections/reconnections after the very first connections. |
| | | * @throws Exception If a problem occurred |
| | | */ |
| | | @Test (enabled=true, groups = "slow") |
| | | @Test (enabled=true) |
| | | public void testNoYoyo3() throws Exception |
| | | { |
| | | String testCase = "testNoYoyo3"; |
| | |
| | | * ->NC->N->D->N->NC |
| | | * @throws Exception If a problem occurred |
| | | */ |
| | | @Test(enabled=true, groups="slow", dataProvider="stateMachineStatusAnalyzerTestProvider") |
| | | @Test(enabled=true, dataProvider="stateMachineStatusAnalyzerTestProvider") |
| | | public void testStateMachineStatusAnalyzer(int thresholdValue) throws Throwable |
| | | { |
| | | String testCase = "testStateMachineStatusAnalyzer with threhold " + thresholdValue; |
| | |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | |
| | |
| | | * See testSafeDataLevelOne comment. |
| | | * This is a facility to run the testSafeDataLevelOne in precommit in simplest |
| | | * case, so that precommit run test something and is not long. |
| | | * testSafeDataLevelOne will run in nightly tests (groups = "slow") |
| | | * testSafeDataLevelOne will run in nightly tests () |
| | | */ |
| | | @Test(enabled = true) |
| | | public void testSafeDataLevelOnePrecommit() throws Exception |
| | |
| | | * All possible combinations tested thanks to the provider |
| | | */ |
| | | @Test(dataProvider = "testSafeDataLevelOneProvider", |
| | | groups = { "slow", "opendj-256" }, |
| | | groups = { "opendj-256" }, |
| | | enabled = true) |
| | | public void testSafeDataLevelOne( |
| | | int mainDsGid, boolean otherFakeDS, boolean fakeRS, |
| | |
| | | false, AssuredMode.SAFE_DATA_MODE, 1, TIMEOUT_RS_SCENARIO); |
| | | } |
| | | |
| | | // Send update from DS 1 |
| | | // Wait for connections to be finished |
| | | // DS must see expected numbers of fake DSs and RSs |
| | | final FakeReplicationDomain fakeRd1 = fakeRDs[1]; |
| | | waitForStableTopo(fakeRd1, otherFakeDS ? 1 : 0, fakeRS ? 2 : 1); |
| | | |
| | | // Send update from DS 1 |
| | | long startTime = System.currentTimeMillis(); |
| | | fakeRd1.sendNewFakeUpdate(); |
| | | |
| | |
| | | /** |
| | | * See testSafeDataLevelHigh comment. |
| | | */ |
| | | @Test(dataProvider = "testSafeDataLevelHighPrecommitProvider", groups = "slow", enabled = true) |
| | | @Test(dataProvider = "testSafeDataLevelHighPrecommitProvider", enabled = true) |
| | | public void testSafeDataLevelHighPrecommit(int sdLevel, |
| | | boolean otherFakeDS, int otherFakeDsGid, long otherFakeDsGenId, |
| | | int fakeRs1Gid, long fakeRs1GenId, int fakeRs1Scen, |
| | |
| | | /** |
| | | * See testSafeDataLevelHigh comment. |
| | | */ |
| | | @Test(dataProvider = "testSafeDataLevelHighNightlyProvider", groups = "slow", enabled = true) |
| | | @Test(dataProvider = "testSafeDataLevelHighNightlyProvider", enabled = true) |
| | | public void testSafeDataLevelHighNightly(int sdLevel, |
| | | boolean otherFakeDS, int otherFakeDsGid, long otherFakeDsGenId, |
| | | int fakeRs1Gid, long fakeRs1GenId, int fakeRs1Scen, |
| | |
| | | if (dsInfo.size() == expectedDs && rsInfo.size() == expectedRs) |
| | | { |
| | | debugInfo("waitForStableTopo: expected topo obtained after " + nSec + " second(s)."); |
| | | waitForAllConnectedPeersFollowing(); |
| | | return; |
| | | } |
| | | Thread.sleep(100); |
| | |
| | | } |
| | | |
| | | /** |
| | | * Wait until every peer connected to the real RS is served from the RS |
| | | * in-memory message queue ("following") rather than catching up from the |
| | | * changelog DB. A freshly connected peer always starts in catch-up mode: |
| | | * until its server writer has checked there is nothing to recover from the |
| | | * changelog DB, updates are re-read from the DB and keep the assured flag |
| | | * of the original sender, while the NotAssuredUpdateMsg substitution |
| | | * performed by ReplicationServerDomain only applies to the in-memory queue |
| | | * path. An update sent by the test while a peer is still catching up may |
| | | * thus reach it with unexpected assured parameters and break |
| | | * checkUpdateAssuredParameters(). This regularly happens on slow (CI) |
| | | * machines. |
| | | */ |
| | | private void waitForAllConnectedPeersFollowing() throws Exception |
| | | { |
| | | final ReplicationServerDomain domain = |
| | | rs1.getReplicationServerDomain(DN.valueOf(TEST_ROOT_DN_STRING)); |
| | | assertNotNull(domain); |
| | | long nSec = 0; |
| | | long startTime = System.currentTimeMillis(); |
| | | do |
| | | { |
| | | boolean allFollowing = true; |
| | | for (ServerHandler handler : domain.getConnectedDSs().values()) |
| | | { |
| | | allFollowing &= handler.isFollowing(); |
| | | } |
| | | for (ServerHandler handler : domain.getConnectedRSs().values()) |
| | | { |
| | | allFollowing &= handler.isFollowing(); |
| | | } |
| | | if (allFollowing) |
| | | { |
| | | debugInfo("waitForAllConnectedPeersFollowing: all peers following after " + nSec + " second(s)."); |
| | | return; |
| | | } |
| | | Thread.sleep(100); |
| | | nSec = (System.currentTimeMillis() - startTime) / 1000; |
| | | } |
| | | while (nSec < 30); |
| | | Assert.fail("Some peers connected to the real RS did not catch up with the changelog DB in time"); |
| | | } |
| | | |
| | | /** |
| | | * Compute the list of servers that are eligible for receiving a safe data assured update |
| | | * according to their group id and generation id. |
| | | * <p> |
| | |
| | | * Test that the RS is acking or not acking a safe data update sent from another |
| | | * (fake) RS according to passed parameters. |
| | | */ |
| | | @Test(dataProvider = "testSafeDataFromRSProvider", groups = "slow", enabled = true) |
| | | @Test(dataProvider = "testSafeDataFromRSProvider", enabled = true) |
| | | public void testSafeDataFromRS(int sdLevel, int fakeRsGid, long fakeRsGenId, boolean sendInAssured) throws Exception |
| | | { |
| | | String testCase = "testSafeDataFromRS"; |
| | |
| | | /** |
| | | * See testSafeReadOneRSComplex comment. |
| | | */ |
| | | @Test(dataProvider = "testSafeReadOneRSComplexPrecommitProvider", groups = "slow", enabled = true) |
| | | @Test(dataProvider = "testSafeReadOneRSComplexPrecommitProvider", enabled = true) |
| | | public void testSafeReadOneRSComplexPrecommit(int otherFakeDsGid, long otherFakeDsGenId, int otherFakeDsScen, |
| | | int otherFakeRsGid, long otherFakeRsGenId, int otherFakeRsScen) throws Exception |
| | | { |
| | |
| | | * <ul> |
| | | * All possible combinations tested thanks to the provider. |
| | | * <p> |
| | | * Note: it is working but disabled as 17.5 minutes to run |
| | | * Note: takes several minutes to run (240 combinations). |
| | | */ |
| | | @Test(dataProvider = "testSafeReadOneRSComplexProvider", groups = "slow", enabled = false) |
| | | @Test(dataProvider = "testSafeReadOneRSComplexProvider", enabled = true) |
| | | public void testSafeReadOneRSComplex(int otherFakeDsGid, long otherFakeDsGenId, int otherFakeDsScen, |
| | | int otherFakeRsGid, long otherFakeRsGenId, int otherFakeRsScen) throws Exception |
| | | { |
| | |
| | | * Topology: |
| | | * DS1---RS1---RS2---DS2 (DS2 with changing configuration) |
| | | */ |
| | | @Test(dataProvider = "testSafeReadTwoRSsProvider", groups = "slow", enabled = true) |
| | | @Test(dataProvider = "testSafeReadTwoRSsProvider", enabled = true) |
| | | public void testSafeReadTwoRSs(int fakeDsGid, long fakeDsGenId, int fakeDsScen) throws Exception |
| | | { |
| | | String testCase = "testSafeReadTwoRSs"; |
| | |
| | | * Topology: |
| | | * DS1---RS1---DS2 (DS2 going degraded) |
| | | */ |
| | | @Test(groups = "slow", enabled = true) |
| | | @Test(enabled = true) |
| | | public void testSafeReadWrongStatus() throws Exception |
| | | { |
| | | String testCase = "testSafeReadWrongStatus"; |
| | |
| | | * |
| | | * Copyright 2007-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.types; |
| | | |
| | |
| | | * |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test(dataProvider = "testdata", groups = { "slow" }) |
| | | @Test(dataProvider = "testdata") |
| | | public void testBackupBackend(InternalClientConnection conn, |
| | | boolean hasPrivilege) |
| | | throws Exception |
| | |
| | | * |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test(dataProvider = "testdata", groups = { "slow" }, |
| | | dependsOnMethods = { "testBackupBackend" }) |
| | | @Test(dataProvider = "testdata", dependsOnMethods = { "testBackupBackend" }) |
| | | public void testRestoreBackend(InternalClientConnection conn, |
| | | boolean hasPrivilege) |
| | | throws Exception |
| | |
| | | * |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test(dataProvider = "testdata", groups = { "slow" }) |
| | | @Test(dataProvider = "testdata") |
| | | public void testLDIFExport(InternalClientConnection conn, |
| | | boolean hasPrivilege) |
| | | throws Exception |
| | |
| | | * |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test(dataProvider = "testdata", groups = { "slow" }) |
| | | @Test(dataProvider = "testdata") |
| | | public void testLDIFImport(InternalClientConnection conn, |
| | | boolean hasPrivilege) |
| | | throws Exception |
| | |
| | | * and therefore the rebuild should succeed. |
| | | * @throws Exception if an unexpected problem occurs. |
| | | */ |
| | | @Test(dataProvider = "testdata", groups = { "slow" }) |
| | | @Test(dataProvider = "testdata") |
| | | public void testRebuildIndex(InternalClientConnection conn, |
| | | boolean hasPrivilege) |
| | | throws Exception |
| | |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.util; |
| | | |
| | |
| | | * |
| | | * @throws Exception If a problem occurs. |
| | | */ |
| | | @Test(groups="slow", dataProvider="keyTypes") |
| | | @Test(dataProvider="keyTypes") |
| | | public void testGenerateSelfSignedCertificatePKCS12(KeyType keyType) |
| | | throws Exception |
| | | { |
| | |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2007 Brighton Consulting, Inc. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC |
| | | */ |
| | | package org.opends.server.util; |
| | | |
| | |
| | | /** |
| | | * This class defines a set of tests for the {@link org.opends.server.util.Crypt} class. |
| | | * <p> |
| | | * In the "slow" group, since they are unlikely to break and since there are 4K+ they can take a |
| | | * Historically in the "slow" group, since they are unlikely to break and since there are 4K+ they can take a |
| | | * while |
| | | */ |
| | | @Test(groups = { "slow" }, sequential = true) |
| | | @Test(sequential = true) |
| | | public final class TestCrypt extends UtilTestCase { |
| | | private Crypt crypt = new Crypt(); |
| | | |