This is an automated email from the ASF dual-hosted git repository.
apkhmv pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new 604840c711 IGNITE-20512 Remove port range from HTTP server (#2673)
604840c711 is described below
commit 604840c71157fbe287f9093ab636a4802c7ca557
Author: Aleksandr Pakhomov <[email protected]>
AuthorDate: Mon Oct 16 19:36:44 2023 +0400
IGNITE-20512 Remove port range from HTTP server (#2673)
* Remove port range from HTTP server configuration
* Update junit5 version to avoid jar hell.
---
gradle/libs.versions.toml | 2 +-
.../org/apache/ignite/internal/NodeConfig.java | 8 ++-
.../internal/cli/CliIntegrationTestBase.java | 4 ++
.../internal/rest/ItGeneratedRestClientTest.java | 3 +-
.../resources/hardcoded-ports-config.json | 3 +-
.../testframework/IntegrationTestBase.java | 30 +++++++----
.../apache/ignite/internal/rest/RestComponent.java | 60 +++++++++-------------
.../configuration/RestConfigurationSchema.java | 5 --
.../configuration/RestSslConfigurationSchema.java | 5 --
.../ignite/internal/BaseIgniteRestartTest.java | 14 ++++-
.../internal/ClusterPerTestIntegrationTest.java | 12 ++---
.../cluster/management/ItClusterInitTest.java | 3 +-
.../internal/compute/ItLogicalTopologyTest.java | 3 +-
.../zones/ItDistributionZonesFilterTest.java | 3 +-
.../raftsnapshot/ItTableRaftSnapshotsTest.java | 3 +-
.../ignite/internal/rest/AbstractRestTestBase.java | 40 ++++++++++-----
.../{ItPortRangeTest.java => ItRestPortsTest.java} | 10 ++--
.../runner/app/AbstractSchemaChangeTest.java | 9 ++--
.../internal/runner/app/ItDataSchemaSyncTest.java | 9 ++--
.../runner/app/ItIgniteNodeRestartTest.java | 4 +-
.../ignite/internal/runner/app/ItIgnitionTest.java | 9 ++--
.../internal/runner/app/ItTablesApiTest.java | 9 ++--
.../runner/app/PlatformTestNodeRunner.java | 12 +++--
.../app/client/ItAbstractThinClientTest.java | 6 ++-
.../sql/engine/ClusterPerClassIntegrationTest.java | 11 +++-
.../ignite/internal/sqllogic/ItSqlLogicTest.java | 9 +++-
.../org/apache/ignite/internal/ssl/ItSslTest.java | 54 ++++++++++++-------
.../ignite-config-rest-port-not-default.json | 3 +-
.../java/org/apache/ignite/internal/Cluster.java | 13 ++++-
29 files changed, 222 insertions(+), 134 deletions(-)
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 320789e57e..c3408b096f 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -30,7 +30,7 @@ javax = "1.3.2"
jetbrainsAnnotations = "20.1.0"
jline = "3.21.0"
jmh = "1.35"
-junit5 = "5.9.1"
+junit5 = "5.9.3"
junitPioneer = "2.0.1"
jsr305 = "3.0.2"
okhttp = "4.9.1"
diff --git
a/modules/cli/src/integrationTest/java/org/apache/ignite/internal/NodeConfig.java
b/modules/cli/src/integrationTest/java/org/apache/ignite/internal/NodeConfig.java
index cd533dd407..798233bc45 100644
---
a/modules/cli/src/integrationTest/java/org/apache/ignite/internal/NodeConfig.java
+++
b/modules/cli/src/integrationTest/java/org/apache/ignite/internal/NodeConfig.java
@@ -40,8 +40,10 @@ public class NodeConfig {
+ " },\n"
+ " },\n"
+ " clientConnector.port: {} ,\n"
- + " rest: {"
+ + " rest: {\n"
+ + " port: {}\n"
+ " ssl: {\n"
+ + " port: {},\n"
+ " enabled: true,\n"
+ " keyStore: {\n"
+ " path: \"" + escapeWindowsPath(resolvedKeystorePath) +
"\",\n"
@@ -77,6 +79,10 @@ public class NodeConfig {
+ " password: " + trustStorePassword + "\n"
+ " }\n"
+ " }\n"
+ + " },\n"
+ + " rest: {\n"
+ + " port: {},\n"
+ + " ssl.port: {}\n"
+ " }\n"
+ "}";
}
diff --git
a/modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/CliIntegrationTestBase.java
b/modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/CliIntegrationTestBase.java
index 8d822429cf..b9bd5b99dd 100644
---
a/modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/CliIntegrationTestBase.java
+++
b/modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/CliIntegrationTestBase.java
@@ -55,6 +55,10 @@ public abstract class CliIntegrationTestBase extends
IntegrationTestBase {
+ " }\n"
+ " },\n"
+ " clientConnector: { port:{} }\n"
+ + " rest: {\n"
+ + " port: {}\n"
+ + " ssl.port: {}\n"
+ + " }\n"
+ "}";
diff --git
a/modules/cli/src/integrationTest/java/org/apache/ignite/internal/rest/ItGeneratedRestClientTest.java
b/modules/cli/src/integrationTest/java/org/apache/ignite/internal/rest/ItGeneratedRestClientTest.java
index 56646af6ae..44d314ef4d 100644
---
a/modules/cli/src/integrationTest/java/org/apache/ignite/internal/rest/ItGeneratedRestClientTest.java
+++
b/modules/cli/src/integrationTest/java/org/apache/ignite/internal/rest/ItGeneratedRestClientTest.java
@@ -138,7 +138,8 @@ public class ItGeneratedRestClientTest {
+ " netClusterNodes: [ \"localhost:3344\",
\"localhost:3345\", \"localhost:3346\" ] \n"
+ " }\n"
+ " },\n"
- + " clientConnector.port: " + (BASE_CLIENT_PORT + nodeIdx) +
"\n"
+ + " clientConnector.port: " + (BASE_CLIENT_PORT + nodeIdx) +
",\n"
+ + " rest.port: " + (BASE_REST_PORT + nodeIdx) + "\n"
+ "}";
}
diff --git
a/modules/cli/src/integrationTest/resources/hardcoded-ports-config.json
b/modules/cli/src/integrationTest/resources/hardcoded-ports-config.json
index c2d5d7c48f..5af4d412a9 100644
--- a/modules/cli/src/integrationTest/resources/hardcoded-ports-config.json
+++ b/modules/cli/src/integrationTest/resources/hardcoded-ports-config.json
@@ -7,8 +7,7 @@
}
},
"rest": {
- "port": <REST_PORT>,
- "portRange": 0
+ "port": <REST_PORT>
},
"clientConnector": {
"port": <CLIENT_PORT>
diff --git
a/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/IntegrationTestBase.java
b/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/IntegrationTestBase.java
index 7eecc39544..af828dafc4 100644
---
a/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/IntegrationTestBase.java
+++
b/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/IntegrationTestBase.java
@@ -49,8 +49,20 @@ import org.junit.jupiter.api.extension.ExtendWith;
@MicronautTest(rebuildContext = true)
@ExtendWith(WorkDirectoryExtension.class)
public class IntegrationTestBase extends BaseIgniteAbstractTest {
+ /** Base port network number. */
+ private static final int BASE_PORT = 3344;
+
+ /** Base client port. */
+ private static final int BASE_CLIENT_PORT = 10800;
+
+ /** Base HTTP port. */
+ private static final int BASE_HTTP_PORT = 10300;
+
+ /** Base HTTPS port. */
+ private static final int BASE_HTTPS_PORT = 10400;
+
/** Correct ignite cluster url. */
- protected static final String NODE_URL = "http://localhost:10300";
+ protected static final String NODE_URL = "http://localhost:" +
BASE_HTTP_PORT;
/** Cluster nodes. */
protected static final List<Ignite> CLUSTER_NODES = new ArrayList<>();
@@ -65,12 +77,6 @@ public class IntegrationTestBase extends
BaseIgniteAbstractTest {
private static final IgniteLogger LOG =
Loggers.forClass(IntegrationTestBase.class);
- /** Base port number. */
-
- private static final int BASE_PORT = 3344;
-
- private static final int BASE_CLIENT_PORT = 10800;
-
/** Nodes bootstrap configuration pattern. */
private static final String NODE_BOOTSTRAP_CFG = "{\n"
+ " network: {\n"
@@ -80,7 +86,11 @@ public class IntegrationTestBase extends
BaseIgniteAbstractTest {
+ " netClusterNodes: [ {} ]\n"
+ " }\n"
+ " },\n"
- + " clientConnector: { port:{} }\n"
+ + " clientConnector: { port: {} }\n"
+ + " rest: {\n"
+ + " port:{},\n"
+ + " ssl: { port: {} }\n"
+ + " }\n"
+ "}";
/** Futures that are going to be completed when all nodes are started and
the cluster is initialized. */
@@ -107,7 +117,9 @@ public class IntegrationTestBase extends
BaseIgniteAbstractTest {
nodeBootstrapConfigTemplate(),
BASE_PORT + i,
connectNodeAddr,
- BASE_CLIENT_PORT + i);
+ BASE_CLIENT_PORT + i,
+ BASE_HTTP_PORT + i,
+ BASE_HTTPS_PORT + i);
NODE_CONFIGS.put(nodeName, config);
diff --git
a/modules/rest/src/main/java/org/apache/ignite/internal/rest/RestComponent.java
b/modules/rest/src/main/java/org/apache/ignite/internal/rest/RestComponent.java
index fc7174079a..866ef432a8 100644
---
a/modules/rest/src/main/java/org/apache/ignite/internal/rest/RestComponent.java
+++
b/modules/rest/src/main/java/org/apache/ignite/internal/rest/RestComponent.java
@@ -91,44 +91,17 @@ public class RestComponent implements IgniteComponent {
boolean sslEnabled = sslConfigurationView.enabled();
boolean dualProtocol = restConfiguration.dualProtocol().value();
- int desiredHttpPort = restConfigurationView.port();
- int portRange = restConfigurationView.portRange();
- int desiredHttpsPort = sslConfigurationView.port();
- int httpsPortRange = sslConfigurationView.portRange();
- int httpPortCandidate = desiredHttpPort;
- int httpsPortCandidate = desiredHttpsPort;
-
- while (httpPortCandidate <= desiredHttpPort + portRange
- && httpsPortCandidate <= desiredHttpsPort + httpsPortRange) {
- if (startServer(httpPortCandidate, httpsPortCandidate)) {
- return;
- }
- LOG.debug("Got exception during node start, going to try again
[httpPort={}, httpsPort={}]",
- httpPortCandidate,
- httpsPortCandidate);
-
- if (sslEnabled && dualProtocol) {
- httpPortCandidate++;
- httpsPortCandidate++;
- } else if (sslEnabled) {
- httpsPortCandidate++;
- } else {
- httpPortCandidate++;
- }
+ if (startServer(restConfigurationView.port(),
sslConfigurationView.port(), sslEnabled, dualProtocol)) {
+ return;
}
- LOG.debug("Unable to start REST endpoint."
- + " Couldn't find available port for HTTP or HTTPS"
- + " [HTTP ports=[{}, {}]],"
- + " [HTTPS ports=[{}, {}]]",
- desiredHttpPort, (desiredHttpPort + portRange),
- desiredHttpsPort, (desiredHttpsPort + httpsPortRange));
-
String msg = "Cannot start REST endpoint."
+ " Couldn't find available port for HTTP or HTTPS"
- + " [HTTP ports=[" + desiredHttpPort + ", " + desiredHttpPort
+ portRange + "]],"
- + " [HTTPS ports=[" + desiredHttpsPort + ", " +
desiredHttpsPort + httpsPortRange + "]]";
+ + " [HTTP port=" + httpPort + "],"
+ + " [HTTPS port=" + httpsPort + "]";
+
+ LOG.error(msg);
throw new IgniteException(Common.COMPONENT_NOT_STARTED_ERR, msg);
}
@@ -137,9 +110,11 @@ public class RestComponent implements IgniteComponent {
*
* @param httpPortCandidate HTTP port candidate.
* @param httpsPortCandidate HTTPS port candidate.
+ * @param sslEnabled SSL enabled flag.
+ * @param dualProtocol Dual protocol flag.
* @return {@code True} if server was started successfully, {@code False}
if couldn't bind one of the ports.
*/
- private boolean startServer(int httpPortCandidate, int httpsPortCandidate)
{
+ private synchronized boolean startServer(int httpPortCandidate, int
httpsPortCandidate, boolean sslEnabled, boolean dualProtocol) {
try {
httpPort = httpPortCandidate;
httpsPort = httpsPortCandidate;
@@ -147,7 +122,8 @@ public class RestComponent implements IgniteComponent {
.deduceEnvironment(false)
.environments(BARE_METAL)
.start();
- LOG.info("REST protocol started successfully");
+
+ logSuccessRestStart(sslEnabled, dualProtocol);
return true;
} catch (ApplicationStartupException e) {
BindException bindException = findBindException(e);
@@ -158,6 +134,20 @@ public class RestComponent implements IgniteComponent {
}
}
+ private void logSuccessRestStart(boolean sslEnabled, boolean dualProtocol)
{
+ String successReportMsg = null;
+
+ if (sslEnabled && dualProtocol) {
+ successReportMsg = "[httpPort=" + httpPort + "], [httpsPort=" +
httpsPort + "]";
+ } else if (sslEnabled) {
+ successReportMsg = "[httpsPort=" + httpsPort + "]";
+ } else {
+ successReportMsg = "[httpPort=" + httpPort + "]";
+ }
+
+ LOG.info("REST server started successfully: " + successReportMsg);
+ }
+
@Nullable
private BindException findBindException(ApplicationStartupException e) {
var throwable = e.getCause();
diff --git
a/modules/rest/src/main/java/org/apache/ignite/internal/rest/configuration/RestConfigurationSchema.java
b/modules/rest/src/main/java/org/apache/ignite/internal/rest/configuration/RestConfigurationSchema.java
index 7f144dac26..1ef8615f36 100644
---
a/modules/rest/src/main/java/org/apache/ignite/internal/rest/configuration/RestConfigurationSchema.java
+++
b/modules/rest/src/main/java/org/apache/ignite/internal/rest/configuration/RestConfigurationSchema.java
@@ -35,11 +35,6 @@ public class RestConfigurationSchema {
@Value(hasDefault = true)
public final int port = 10300;
- /** TCP port range. */
- @Range(min = 0)
- @Value(hasDefault = true)
- public final int portRange = 100;
-
/** The dual protocol (http/https) configuration. */
@Value(hasDefault = true)
public final boolean dualProtocol = false;
diff --git
a/modules/rest/src/main/java/org/apache/ignite/internal/rest/configuration/RestSslConfigurationSchema.java
b/modules/rest/src/main/java/org/apache/ignite/internal/rest/configuration/RestSslConfigurationSchema.java
index dbd2908d41..503f4e9fd8 100644
---
a/modules/rest/src/main/java/org/apache/ignite/internal/rest/configuration/RestSslConfigurationSchema.java
+++
b/modules/rest/src/main/java/org/apache/ignite/internal/rest/configuration/RestSslConfigurationSchema.java
@@ -30,9 +30,4 @@ public class RestSslConfigurationSchema extends
AbstractSslConfigurationSchema {
@Range(min = 1024, max = 0xFFFF)
@Value(hasDefault = true)
public final int port = 10400;
-
- /** SSL port range. */
- @Range(min = 0)
- @Value(hasDefault = true)
- public final int portRange = 100;
}
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/BaseIgniteRestartTest.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/BaseIgniteRestartTest.java
index 26c110b3a1..2d65f6f0a4 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/BaseIgniteRestartTest.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/BaseIgniteRestartTest.java
@@ -67,6 +67,10 @@ public abstract class BaseIgniteRestartTest extends
IgniteAbstractTest {
protected static final int DEFAULT_CLIENT_PORT = 10800;
+ protected static final int DEFAULT_HTTP_PORT = 10300;
+
+ protected static final int DEFAULT_HTTPS_PORT = 10400;
+
@Language("HOCON")
protected static final String RAFT_CFG = "{\n"
+ " fsync: false,\n"
@@ -87,7 +91,11 @@ public abstract class BaseIgniteRestartTest extends
IgniteAbstractTest {
+ " },\n"
+ " },\n"
+ " raft: " + RAFT_CFG + ",\n"
- + " clientConnector.port: {}\n"
+ + " clientConnector.port: {},\n"
+ + " rest: {\n"
+ + " port: {}, \n"
+ + " ssl.port: {} \n"
+ + " }\n"
+ "}";
public TestInfo testInfo;
@@ -203,11 +211,13 @@ public abstract class BaseIgniteRestartTest extends
IgniteAbstractTest {
protected static String configurationString(int idx) {
int port = DEFAULT_NODE_PORT + idx;
int clientPort = DEFAULT_CLIENT_PORT + idx;
+ int httpPort = DEFAULT_HTTP_PORT + idx;
+ int httpsPort = DEFAULT_HTTPS_PORT + idx;
// The address of the first node.
@Language("HOCON") String connectAddr = "[localhost\":\"" +
DEFAULT_NODE_PORT + "]";
- return IgniteStringFormatter.format(NODE_BOOTSTRAP_CFG, port,
connectAddr, clientPort);
+ return IgniteStringFormatter.format(NODE_BOOTSTRAP_CFG, port,
connectAddr, clientPort, httpPort, httpsPort);
}
/**
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/ClusterPerTestIntegrationTest.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/ClusterPerTestIntegrationTest.java
index df0d863f02..bf8032fe28 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/ClusterPerTestIntegrationTest.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/ClusterPerTestIntegrationTest.java
@@ -37,9 +37,6 @@ import org.junit.jupiter.api.Timeout;
public abstract class ClusterPerTestIntegrationTest extends
IgniteIntegrationTest {
private static final IgniteLogger LOG =
Loggers.forClass(ClusterPerTestIntegrationTest.class);
- /** Base port number. */
- private static final int BASE_PORT = 3344;
-
/** Nodes bootstrap configuration pattern. */
private static final String NODE_BOOTSTRAP_CFG_TEMPLATE = "{\n"
+ " network: {\n"
@@ -48,7 +45,8 @@ public abstract class ClusterPerTestIntegrationTest extends
IgniteIntegrationTes
+ " netClusterNodes: [ {} ]\n"
+ " }\n"
+ " },\n"
- + " clientConnector: { port:{} }\n"
+ + " clientConnector: { port:{} },\n"
+ + " rest.port: {}\n"
+ "}";
/** Template for node bootstrap config with Scalecube settings for fast
failure detection. */
@@ -68,7 +66,8 @@ public abstract class ClusterPerTestIntegrationTest extends
IgniteIntegrationTes
+ " },\n"
+ " }\n"
+ " },\n"
- + " clientConnector: { port:{} }\n"
+ + " clientConnector: { port:{} }, \n"
+ + " rest.port: {}\n"
+ "}";
/** Template for node bootstrap config with Scalecube settings for a
disabled failure detection. */
@@ -82,7 +81,8 @@ public abstract class ClusterPerTestIntegrationTest extends
IgniteIntegrationTes
+ " failurePingInterval: 1000000000\n"
+ " }\n"
+ " },\n"
- + " clientConnector: { port:{} }\n"
+ + " clientConnector: { port:{} },\n"
+ + " rest.port: {}\n"
+ "}";
protected Cluster cluster;
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/cluster/management/ItClusterInitTest.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/cluster/management/ItClusterInitTest.java
index 0c5eac07c2..3f1886c5ef 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/cluster/management/ItClusterInitTest.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/cluster/management/ItClusterInitTest.java
@@ -108,7 +108,8 @@ public class ItClusterInitTest extends IgniteAbstractTest {
String config = "{"
+ " network.port: " + port + ","
+ " clientConnector.port: " + (port + 8000) + ","
- + " network.nodeFinder.netClusterNodes: " +
nodeFinderConfig
+ + " network.nodeFinder.netClusterNodes: " +
nodeFinderConfig + ","
+ + " rest.port: " + (port + 10000)
+ "}";
String nodeName = testNodeName(testInfo, port);
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/compute/ItLogicalTopologyTest.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/compute/ItLogicalTopologyTest.java
index 4a5dc99c0d..bc665b234c 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/compute/ItLogicalTopologyTest.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/compute/ItLogicalTopologyTest.java
@@ -71,7 +71,8 @@ class ItLogicalTopologyTest extends
ClusterPerTestIntegrationTest {
+ " nodeAttributes: {\n"
+ " nodeAttributes: " + NODE_ATTRIBUTES
+ " },\n"
- + " clientConnector: { port:{} }\n"
+ + " clientConnector: { port:{} },\n"
+ + " rest.port: {}\n"
+ "}";
private final LogicalTopologyEventListener listener = new
LogicalTopologyEventListener() {
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/distribution/zones/ItDistributionZonesFilterTest.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/distribution/zones/ItDistributionZonesFilterTest.java
index 5b98facf86..136bb01ee6 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/distribution/zones/ItDistributionZonesFilterTest.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/distribution/zones/ItDistributionZonesFilterTest.java
@@ -82,7 +82,8 @@ public class ItDistributionZonesFilterTest extends
ClusterPerTestIntegrationTest
+ " nodeAttributes: {\n"
+ " nodeAttributes: " + nodeAttributes
+ " },\n"
- + " clientConnector: { port:{} }\n"
+ + " clientConnector: { port:{} },\n"
+ + " rest.port: {}\n"
+ "}";
}
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/raftsnapshot/ItTableRaftSnapshotsTest.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/raftsnapshot/ItTableRaftSnapshotsTest.java
index 71ae733343..2c97b2b7b4 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/raftsnapshot/ItTableRaftSnapshotsTest.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/raftsnapshot/ItTableRaftSnapshotsTest.java
@@ -131,7 +131,8 @@ class ItTableRaftSnapshotsTest extends
IgniteIntegrationTest {
+ " }\n"
+ " },\n"
+ " raft.rpcInstallSnapshotTimeout: 10000,\n"
- + " clientConnector.port: {}\n"
+ + " clientConnector.port: {},\n"
+ + " rest.port: {}\n"
+ "}";
/**
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/rest/AbstractRestTestBase.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/rest/AbstractRestTestBase.java
index 48c0581432..c8d51b1a43 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/rest/AbstractRestTestBase.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/rest/AbstractRestTestBase.java
@@ -49,10 +49,16 @@ import org.junit.jupiter.api.TestInfo;
*/
abstract class AbstractRestTestBase extends IgniteIntegrationTest {
/** Network ports of the test nodes. */
- static final int[] PORTS = {3344, 3345, 3346};
+ static final int[] NETWORK_PORTS = {3344, 3345, 3346};
+
+ /** Client ports of the test nodes. */
+ static final int[] CLIENT_PORTS = {10800, 10801, 10802};
+
+ /** HTTP ports of the test nodes. */
+ static final int[] HTTP_PORTS = {10300, 10301, 10302};
/** HTTP host and port url part. */
- static final String HTTP_HOST_PORT = "http://localhost:10300";
+ static final String HTTP_HOST_PORT = "http://localhost:" + HTTP_PORTS[0];
/** Nodes bootstrap configuration. */
final Map<String, String> nodesBootstrapCfg = new LinkedHashMap<>();
@@ -101,20 +107,22 @@ abstract class AbstractRestTestBase extends
IgniteIntegrationTest {
}
private void startAllNodesWithoutInit(TestInfo testInfo) {
- String node0Name = testNodeName(testInfo, PORTS[0]);
- String node1Name = testNodeName(testInfo, PORTS[1]);
- String node2Name = testNodeName(testInfo, PORTS[2]);
+ String node0Name = testNodeName(testInfo, NETWORK_PORTS[0]);
+ String node1Name = testNodeName(testInfo, NETWORK_PORTS[1]);
+ String node2Name = testNodeName(testInfo, NETWORK_PORTS[2]);
nodesBootstrapCfg.put(
node0Name,
"{\n"
+ " network: {\n"
- + " port: " + PORTS[0] + ",\n"
+ + " port: " + NETWORK_PORTS[0] + ",\n"
+ " nodeFinder: {\n"
- + " netClusterNodes: [ \"localhost:3344\",
\"localhost:3345\", \"localhost:3346\" ]\n"
+ + " netClusterNodes: [ \"localhost:" +
NETWORK_PORTS[0] + "\", \"localhost:" + NETWORK_PORTS[1]
+ + "\", \"localhost:" + NETWORK_PORTS[2] + "\" ]\n"
+ " }\n"
+ " },\n"
- + " clientConnector.port: 10800"
+ + " clientConnector.port: " + CLIENT_PORTS[0] + ", \n"
+ + " rest.port: " + HTTP_PORTS[0]
+ "}"
);
@@ -122,12 +130,14 @@ abstract class AbstractRestTestBase extends
IgniteIntegrationTest {
node1Name,
"{\n"
+ " network: {\n"
- + " port: " + PORTS[1] + ",\n"
+ + " port: " + NETWORK_PORTS[1] + ",\n"
+ " nodeFinder: {\n"
- + " netClusterNodes: [ \"localhost:3344\",
\"localhost:3345\", \"localhost:3346\" ]\n"
+ + " netClusterNodes: [ \"localhost:" +
NETWORK_PORTS[0] + "\", \"localhost:" + NETWORK_PORTS[1]
+ + "\", \"localhost:" + NETWORK_PORTS[2] + "\" ]\n"
+ " }\n"
+ " },\n"
- + " clientConnector.port: 10801"
+ + " clientConnector.port: " + CLIENT_PORTS[1] + ",
\n"
+ + " rest.port: " + HTTP_PORTS[1]
+ "}"
);
@@ -135,12 +145,14 @@ abstract class AbstractRestTestBase extends
IgniteIntegrationTest {
node2Name,
"{\n"
+ " network: {\n"
- + " port: " + PORTS[2] + ",\n"
+ + " port: " + NETWORK_PORTS[2] + ",\n"
+ " nodeFinder: {\n"
- + " netClusterNodes: [ \"localhost:3344\",
\"localhost:3345\", \"localhost:3346\" ]\n"
+ + " netClusterNodes: [ \"localhost:" +
NETWORK_PORTS[0] + "\", \"localhost:" + NETWORK_PORTS[1]
+ + "\", \"localhost:" + NETWORK_PORTS[2] + "\" ]\n"
+ " }\n"
+ " },\n"
- + " clientConnector.port: 10802"
+ + " clientConnector.port: " + CLIENT_PORTS[2] + ",
\n"
+ + " rest.port: " + HTTP_PORTS[2]
+ "}"
);
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/rest/ItPortRangeTest.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/rest/ItRestPortsTest.java
similarity index 95%
rename from
modules/runner/src/integrationTest/java/org/apache/ignite/internal/rest/ItPortRangeTest.java
rename to
modules/runner/src/integrationTest/java/org/apache/ignite/internal/rest/ItRestPortsTest.java
index 1bcb4f9f9f..5bd261d697 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/rest/ItPortRangeTest.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/rest/ItRestPortsTest.java
@@ -50,8 +50,8 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
-/** Tests for the REST port range configuration. */
-public class ItPortRangeTest extends IgniteIntegrationTest {
+/** Tests for the REST ports configuration. */
+public class ItRestPortsTest extends IgniteIntegrationTest {
/** Trust store path. */
private static final String trustStorePath = "ssl/truststore.jks";
@@ -85,7 +85,7 @@ public class ItPortRangeTest extends IgniteIntegrationTest {
}
@ParameterizedTest
- @DisplayName("Port range works in all configurations")
+ @DisplayName("Ports are configured in all configurations")
@MethodSource("sslConfigurationProperties")
void portRange(boolean sslEnabled, boolean dualProtocol, TestInfo
testInfo) throws IOException, InterruptedException {
List<RestNode> nodes = IntStream.range(0, 3)
@@ -94,8 +94,8 @@ public class ItPortRangeTest extends IgniteIntegrationTest {
.workDir(workDir)
.name(testNodeName(testInfo, id))
.networkPort(3344 + id)
- .httpPort(10300)
- .httpsPort(10400)
+ .httpPort(10300 + id)
+ .httpsPort(10400 + id)
.sslEnabled(sslEnabled)
.dualProtocol(dualProtocol)
.build();
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/AbstractSchemaChangeTest.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/AbstractSchemaChangeTest.java
index b0db4e95c7..49170e4c49 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/AbstractSchemaChangeTest.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/AbstractSchemaChangeTest.java
@@ -78,7 +78,8 @@ abstract class AbstractSchemaChangeTest extends
IgniteIntegrationTest {
+ " netClusterNodes: [ \"localhost:3344\",
\"localhost:3345\", \"localhost:3346\" ]\n"
+ " }\n"
+ " },\n"
- + " clientConnector: { port:10901 }\n"
+ + " clientConnector: { port:10901 },\n"
+ + " rest.port: 10300\n"
+ "}"
);
@@ -91,7 +92,8 @@ abstract class AbstractSchemaChangeTest extends
IgniteIntegrationTest {
+ " netClusterNodes: [ \"localhost:3344\",
\"localhost:3345\", \"localhost:3346\" ]\n"
+ " }\n"
+ " },\n"
- + " clientConnector: { port:10902 }\n"
+ + " clientConnector: { port:10902 },\n"
+ + " rest.port: 10301\n"
+ "}"
);
@@ -104,7 +106,8 @@ abstract class AbstractSchemaChangeTest extends
IgniteIntegrationTest {
+ " netClusterNodes: [ \"localhost:3344\",
\"localhost:3345\", \"localhost:3346\" ]\n"
+ " }\n"
+ " },\n"
- + " clientConnector: { port:10903 }\n"
+ + " clientConnector: { port:10903 },\n"
+ + " rest.port: 10302\n"
+ "}"
);
}
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItDataSchemaSyncTest.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItDataSchemaSyncTest.java
index 1bb5399021..b2a3891f90 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItDataSchemaSyncTest.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItDataSchemaSyncTest.java
@@ -70,7 +70,8 @@ public class ItDataSchemaSyncTest extends IgniteAbstractTest {
+ " \"nodeFinder\": {\n"
+ " \"netClusterNodes\":[ \"localhost:3344\",
\"localhost:3345\", \"localhost:3346\" ]\n"
+ " }\n"
- + " }\n"
+ + " },\n"
+ + " rest.port: 10300\n"
+ "}",
"node1", "{\n"
@@ -80,7 +81,8 @@ public class ItDataSchemaSyncTest extends IgniteAbstractTest {
+ " \"netClusterNodes\":[ \"localhost:3344\",
\"localhost:3345\", \"localhost:3346\" ]\n"
+ " }\n"
+ " },\n"
- + " clientConnector: { port:10801 }\n"
+ + " clientConnector: { port:10801 },\n"
+ + " rest.port: 10301\n"
+ "}",
"node2", "{\n"
@@ -90,7 +92,8 @@ public class ItDataSchemaSyncTest extends IgniteAbstractTest {
+ " \"netClusterNodes\":[ \"localhost:3344\",
\"localhost:3345\", \"localhost:3346\" ]\n"
+ " }\n"
+ " },\n"
- + " clientConnector: { port:10802 }\n"
+ + " clientConnector: { port:10802 },\n"
+ + " rest.port: 10302\n"
+ "}"
);
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java
index 3344d97704..946067cb40 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java
@@ -1026,7 +1026,9 @@ public class ItIgniteNodeRestartTest extends
BaseIgniteRestartTest {
@Language("HOCON") String cfgString =
IgniteStringFormatter.format(NODE_BOOTSTRAP_CFG,
DEFAULT_NODE_PORT + 11,
"[\"localhost:" + DEFAULT_NODE_PORT + "\"]",
- DEFAULT_CLIENT_PORT + 11
+ DEFAULT_CLIENT_PORT + 11,
+ DEFAULT_HTTP_PORT + 11,
+ DEFAULT_HTTPS_PORT + 11
);
IgniteImpl node1 = startNode(1, cfgString);
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgnitionTest.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgnitionTest.java
index 77715c6f5f..5f7347ac02 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgnitionTest.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgnitionTest.java
@@ -83,7 +83,8 @@ class ItIgnitionTest extends IgniteIntegrationTest {
+ " netClusterNodes: [ \"localhost:3344\",
\"localhost:3345\", \"localhost:3346\" ]\n"
+ " }\n"
+ " },\n"
- + " clientConnector.port: 10800\n"
+ + " clientConnector.port: 10800,\n"
+ + " rest.port: 10300\n"
+ "}"
);
@@ -96,7 +97,8 @@ class ItIgnitionTest extends IgniteIntegrationTest {
+ " netClusterNodes: [ \"localhost:3344\",
\"localhost:3345\", \"localhost:3346\" ]\n"
+ " }\n"
+ " },\n"
- + " clientConnector.port: 10801\n"
+ + " clientConnector.port: 10801,\n"
+ + " rest.port: 10301\n"
+ "}"
);
@@ -109,7 +111,8 @@ class ItIgnitionTest extends IgniteIntegrationTest {
+ " netClusterNodes: [ \"localhost:3344\",
\"localhost:3345\", \"localhost:3346\" ]\n"
+ " }\n"
+ " },\n"
- + " clientConnector.port: 10802\n"
+ + " clientConnector.port: 10802,\n"
+ + " rest.port: 10302\n"
+ "}"
);
}
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItTablesApiTest.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItTablesApiTest.java
index 8b72c52abf..cc86216ab4 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItTablesApiTest.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItTablesApiTest.java
@@ -71,17 +71,20 @@ public class ItTablesApiTest extends IgniteAbstractTest {
private final List<String> nodesBootstrapCfg = List.of(
"{\n"
+ " network.port :3344, clientConnector.port: 10800,\n"
- + " network.nodeFinder.netClusterNodes:[
\"localhost:3344\", \"localhost:3345\", \"localhost:3346\" ]\n"
+ + " network.nodeFinder.netClusterNodes:[
\"localhost:3344\", \"localhost:3345\", \"localhost:3346\" ],\n"
+ + " rest.port: 10300\n"
+ "}",
"{\n"
+ " network.port :3345, clientConnector.port: 10801,\n"
- + " network.nodeFinder.netClusterNodes:[
\"localhost:3344\", \"localhost:3345\", \"localhost:3346\" ]\n"
+ + " network.nodeFinder.netClusterNodes:[
\"localhost:3344\", \"localhost:3345\", \"localhost:3346\" ],\n"
+ + " rest.port: 10301\n"
+ "}",
"{\n"
+ " network.port :3346, clientConnector.port: 10802,\n"
- + " network.nodeFinder.netClusterNodes:[
\"localhost:3344\", \"localhost:3345\", \"localhost:3346\" ]\n"
+ + " network.nodeFinder.netClusterNodes:[
\"localhost:3344\", \"localhost:3345\", \"localhost:3346\" ],\n"
+ + " rest.port: 10302\n"
+ "}"
);
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/PlatformTestNodeRunner.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/PlatformTestNodeRunner.java
index a523f2cc02..575d9cb772 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/PlatformTestNodeRunner.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/PlatformTestNodeRunner.java
@@ -121,7 +121,8 @@ public class PlatformTestNodeRunner {
+ " \"nodeFinder\": {\n"
+ " \"netClusterNodes\":[ \"localhost:3344\",
\"localhost:3345\", \"localhost:3346\", \"localhost:3347\" ]\n"
+ " }\n"
- + " }\n"
+ + " },\n"
+ + " rest.port: 10300\n"
+ "}",
NODE_NAME2, "{\n"
@@ -132,7 +133,8 @@ public class PlatformTestNodeRunner {
+ " \"nodeFinder\": {\n"
+ " \"netClusterNodes\":[ \"localhost:3344\",
\"localhost:3345\", \"localhost:3346\", \"localhost:3347\" ]\n"
+ " }\n"
- + " }\n"
+ + " },\n"
+ + " rest.port: 10301\n"
+ "}",
NODE_NAME3, "{\n"
@@ -153,7 +155,8 @@ public class PlatformTestNodeRunner {
+ " \"nodeFinder\": {\n"
+ " \"netClusterNodes\":[ \"localhost:3344\",
\"localhost:3345\", \"localhost:3346\", \"localhost:3347\" ]\n"
+ " }\n"
- + " }\n"
+ + " },\n"
+ + " rest.port: 10303\n"
+ "}",
NODE_NAME4, "{\n"
@@ -179,7 +182,8 @@ public class PlatformTestNodeRunner {
+ " \"nodeFinder\": {\n"
+ " \"netClusterNodes\":[ \"localhost:3344\",
\"localhost:3345\", \"localhost:3346\", \"localhost:3347\" ]\n"
+ " }\n"
- + " }\n"
+ + " },\n"
+ + " rest.port: 10304\n"
+ "}"
);
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItAbstractThinClientTest.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItAbstractThinClientTest.java
index 0e801307dd..6ea27a3825 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItAbstractThinClientTest.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItAbstractThinClientTest.java
@@ -79,7 +79,8 @@ public abstract class ItAbstractThinClientTest extends
BaseIgniteAbstractTest {
"{\n"
+ " network.port: 3344,\n"
+ " network.nodeFinder.netClusterNodes: [
\"localhost:3344\", \"localhost:3345\", \"localhost:3346\" ]\n"
- + " clientConnector.port: 10800\n"
+ + " clientConnector.port: 10800,\n"
+ + " rest.port: 10300\n"
+ "}"
);
@@ -90,7 +91,8 @@ public abstract class ItAbstractThinClientTest extends
BaseIgniteAbstractTest {
+ " network.nodeFinder.netClusterNodes: [
\"localhost:3344\", \"localhost:3345\", \"localhost:3346\" ]\n"
+ "
clientConnector.sendServerExceptionStackTraceToClient: true\n"
+ " clientConnector.metricsEnabled: true\n"
- + " clientConnector.port: 10801\n"
+ + " clientConnector.port: 10801,\n"
+ + " rest.port: 10301\n"
+ "}"
);
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ClusterPerClassIntegrationTest.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ClusterPerClassIntegrationTest.java
index f91270958a..d73953bc13 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ClusterPerClassIntegrationTest.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ClusterPerClassIntegrationTest.java
@@ -98,6 +98,9 @@ public abstract class ClusterPerClassIntegrationTest extends
IgniteIntegrationTe
/** Base client port number. */
private static final int BASE_CLIENT_PORT = 10800;
+ /** Base rest port number. */
+ protected static final int BASE_REST_PORT = 10300;
+
/** Nodes bootstrap configuration pattern. */
private static final String NODE_BOOTSTRAP_CFG = "{\n"
+ " \"network\": {\n"
@@ -106,7 +109,8 @@ public abstract class ClusterPerClassIntegrationTest
extends IgniteIntegrationTe
+ " \"netClusterNodes\": [ {} ]\n"
+ " }\n"
+ " },\n"
- + " clientConnector: { port:{} }\n"
+ + " clientConnector: { port:{} },\n"
+ + " rest.port: {}\n"
+ "}";
/** Cluster nodes. */
@@ -149,7 +153,10 @@ public abstract class ClusterPerClassIntegrationTest
extends IgniteIntegrationTe
for (int i = 0; i < nodes(); i++) {
String nodeName = testNodeName(testInfo, i);
- String config = IgniteStringFormatter.format(NODE_BOOTSTRAP_CFG,
BASE_PORT + i, connectNodeAddr, BASE_CLIENT_PORT + i);
+ String config = IgniteStringFormatter.format(
+ NODE_BOOTSTRAP_CFG,
+ BASE_PORT + i, connectNodeAddr, BASE_CLIENT_PORT + i,
BASE_REST_PORT + i
+ );
futures.add(TestIgnitionManager.start(nodeName, config,
WORK_DIR.resolve(nodeName)));
}
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/sqllogic/ItSqlLogicTest.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/sqllogic/ItSqlLogicTest.java
index c8e9e03f72..2eba527ec5 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/sqllogic/ItSqlLogicTest.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/sqllogic/ItSqlLogicTest.java
@@ -157,6 +157,8 @@ public class ItSqlLogicTest extends IgniteIntegrationTest {
private static final int BASE_CLIENT_PORT = 10800;
+ private static final int BASE_REST_PORT = 10300;
+
/** Nodes bootstrap configuration pattern. */
private static final String NODE_BOOTSTRAP_CFG = "{\n"
+ " \"network\": {\n"
@@ -165,7 +167,8 @@ public class ItSqlLogicTest extends IgniteIntegrationTest {
+ " \"netClusterNodes\": [ {} ]\n"
+ " }\n"
+ " },\n"
- + " clientConnector.port: {}\n"
+ + " clientConnector.port: {},\n"
+ + " rest.port: {}\n"
+ "}";
/** Cluster nodes. */
@@ -322,7 +325,9 @@ public class ItSqlLogicTest extends IgniteIntegrationTest {
.mapToObj(i -> {
String nodeName = NODE_NAME_PREFIX + i;
- String config =
IgniteStringFormatter.format(NODE_BOOTSTRAP_CFG, BASE_PORT + i,
connectNodeAddr, BASE_CLIENT_PORT + i);
+ String config = IgniteStringFormatter.format(
+ NODE_BOOTSTRAP_CFG, BASE_PORT + i,
connectNodeAddr, BASE_CLIENT_PORT + i, BASE_REST_PORT + i
+ );
return TestIgnitionManager.start(nodeName, config,
WORK_DIR.resolve(nodeName));
})
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/ssl/ItSslTest.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/ssl/ItSslTest.java
index d1bf959de2..cfc9ba4fd1 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/ssl/ItSslTest.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/ssl/ItSslTest.java
@@ -90,7 +90,11 @@ public class ItSslTest extends IgniteIntegrationTest {
+ " netClusterNodes: [ {}, \"localhost:3355\",
\"localhost:3356\" ]\n"
+ " }\n"
+ " },\n"
- + " clientConnector: { port: {} }\n"
+ + " clientConnector: { port: {} },\n"
+ + " rest: {\n"
+ + " port: {},\n"
+ + " ssl.port: {}\n"
+ + " }\n"
+ "}";
@BeforeAll
@@ -189,6 +193,10 @@ public class ItSslTest extends IgniteIntegrationTest {
+ " path: \"" + escapeWindowsPath(keyStorePath) + "\",\n"
+ " password: \"" + password + "\"\n"
+ " }\n"
+ + " },\n"
+ + " rest: {\n"
+ + " port: {},\n"
+ + " ssl.port: {}\n"
+ " }\n"
+ "}";
@@ -405,6 +413,10 @@ public class ItSslTest extends IgniteIntegrationTest {
+ " password: \"" + password + "\","
+ " path: \"" + escapeWindowsPath(trustStorePath) + "\""
+ " }\n"
+ + " },\n"
+ + " rest: {\n"
+ + " port: {}, \n"
+ + " ssl.port: {} \n"
+ " }\n"
+ "}";
@@ -503,30 +515,32 @@ public class ItSslTest extends IgniteIntegrationTest {
@Test
@DisplayName("Cluster is not initialized when nodes are configured with
incompatible ciphers")
void incompatibleCiphersNodes(TestInfo testInfo) {
- Cluster cluster = new Cluster(testInfo, WORK_DIR);
-
- String sslEnabledWithCipher1BoostrapConfig =
createBoostrapConfig("TLS_AES_256_GCM_SHA384");
- String sslEnabledWithCipher2BoostrapConfig =
createBoostrapConfig("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384");
+ Cluster incompatibleTestCluster = new Cluster(testInfo, WORK_DIR);
- CompletableFuture<IgniteImpl> node1 = cluster.startNodeAsync(0,
sslEnabledWithCipher1BoostrapConfig);
+ try {
+ String sslEnabledWithCipher1BoostrapConfig =
createBoostrapConfig("TLS_AES_256_GCM_SHA384");
+ String sslEnabledWithCipher2BoostrapConfig =
createBoostrapConfig("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384");
- String metaStorageAndCmgNodeName = testNodeName(testInfo, 0);
+ CompletableFuture<IgniteImpl> node1 =
incompatibleTestCluster.startNodeAsync(10, sslEnabledWithCipher1BoostrapConfig);
- InitParameters initParameters = InitParameters.builder()
- .destinationNodeName(metaStorageAndCmgNodeName)
- .metaStorageNodeNames(List.of(metaStorageAndCmgNodeName))
- .clusterName("cluster")
- .build();
+ String metaStorageAndCmgNodeName = testNodeName(testInfo, 10);
- TestIgnitionManager.init(initParameters);
+ InitParameters initParameters = InitParameters.builder()
+ .destinationNodeName(metaStorageAndCmgNodeName)
+ .metaStorageNodeNames(List.of(metaStorageAndCmgNodeName))
+ .clusterName("cluster")
+ .build();
- // First node will initialize the cluster with single node
successfully since the second node can't connect to it.
- assertThat(node1, willCompleteSuccessfully());
+ TestIgnitionManager.init(initParameters);
- CompletableFuture<IgniteImpl> node2 = cluster.startNodeAsync(1,
sslEnabledWithCipher2BoostrapConfig);
- assertThat(node2, willTimeoutIn(1, TimeUnit.SECONDS));
+ // First node will initialize the cluster with single node
successfully since the second node can't connect to it.
+ assertThat(node1, willCompleteSuccessfully());
- cluster.shutdown();
+ CompletableFuture<IgniteImpl> node2 =
incompatibleTestCluster.startNodeAsync(11, sslEnabledWithCipher2BoostrapConfig);
+ assertThat(node2, willTimeoutIn(1, TimeUnit.SECONDS));
+ } finally {
+ incompatibleTestCluster.shutdown();
+ }
}
@Language("JSON")
@@ -559,6 +573,10 @@ public class ItSslTest extends IgniteIntegrationTest {
+ " path: \"" + escapeWindowsPath(keyStorePath) + "\",\n"
+ " password: \"" + password + "\"\n"
+ " }\n"
+ + " },\n"
+ + " rest: {\n"
+ + " port: {},\n"
+ + " ssl.port: {}\n"
+ " }\n"
+ "}";
}
diff --git
a/modules/runner/src/integrationTest/resources/ignite-config-rest-port-not-default.json
b/modules/runner/src/integrationTest/resources/ignite-config-rest-port-not-default.json
index bd4c4666f7..fdb059abbf 100644
---
a/modules/runner/src/integrationTest/resources/ignite-config-rest-port-not-default.json
+++
b/modules/runner/src/integrationTest/resources/ignite-config-rest-port-not-default.json
@@ -9,7 +9,6 @@
}
},
"rest": {
- "port": 10333,
- "portRange": 10
+ "port": 10333
}
}
diff --git
a/modules/runner/src/testFixtures/java/org/apache/ignite/internal/Cluster.java
b/modules/runner/src/testFixtures/java/org/apache/ignite/internal/Cluster.java
index ad35cc6d97..632c1388d6 100644
---
a/modules/runner/src/testFixtures/java/org/apache/ignite/internal/Cluster.java
+++
b/modules/runner/src/testFixtures/java/org/apache/ignite/internal/Cluster.java
@@ -83,6 +83,10 @@ public class Cluster {
private static final int BASE_CLIENT_PORT = 10800;
+ private static final int BASE_HTTP_PORT = 10300;
+
+ private static final int BASE_HTTPS_PORT = 10400;
+
private static final String CONNECT_NODE_ADDR = "\"localhost:" + BASE_PORT
+ '\"';
/** Timeout for SQL queries (in milliseconds). */
@@ -97,6 +101,10 @@ public class Cluster {
+ " }\n"
+ " },\n"
+ " clientConnector: { port:{} }\n"
+ + " rest: {\n"
+ + " port: {},\n"
+ + " ssl.port: {}\n"
+ + " }\n"
+ "}";
private final TestInfo testInfo;
@@ -237,7 +245,10 @@ public class Cluster {
nodeBootstrapConfigTemplate,
BASE_PORT + nodeIndex,
CONNECT_NODE_ADDR,
- BASE_CLIENT_PORT + nodeIndex);
+ BASE_CLIENT_PORT + nodeIndex,
+ BASE_HTTP_PORT + nodeIndex,
+ BASE_HTTPS_PORT + nodeIndex
+ );
return TestIgnitionManager.start(nodeName, config,
workDir.resolve(nodeName))
.thenApply(IgniteImpl.class::cast)