geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject [15/50] [abbrv] incubator-geode git commit: restricting membership-port-range for tests to be outside of AvailablePort's pool
Date Wed, 10 Aug 2016 19:41:01 GMT
restricting membership-port-range for tests to be outside of AvailablePort's pool


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/b81ebccb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/b81ebccb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/b81ebccb

Branch: refs/heads/feature/GEODE-420
Commit: b81ebccba3a39647b020ac8d4ee2bf5b993c2356
Parents: dce15e4
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Tue Aug 2 10:33:39 2016 -0700
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Tue Aug 2 10:35:40 2016 -0700

----------------------------------------------------------------------
 .../distributed/internal/DistributionConfig.java   | 17 ++++++++++-------
 .../test/dunit/standalone/DUnitLauncher.java       |  3 +++
 .../test/dunit/standalone/ProcessManager.java      |  1 +
 3 files changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b81ebccb/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionConfig.java
b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionConfig.java
index 816742e..fda9582 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionConfig.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionConfig.java
@@ -54,7 +54,10 @@ import com.gemstone.gemfire.memcached.GemFireMemcachedServer;
  */
 public interface DistributionConfig extends Config, LogConfig {
 
-  ////////////////////  Instance Methods  ////////////////////
+  /**
+   * The prefix used for Gemfire properties set through java system properties
+   */
+  String GEMFIRE_PREFIX = "gemfire.";
 
   /**
    * Returns the value of the {@link ConfigurationProperties#NAME} property
@@ -1744,7 +1747,12 @@ public interface DistributionConfig extends Config, LogConfig {
   @ConfigAttribute(type = int[].class)
   String MEMBERSHIP_PORT_RANGE_NAME = MEMBERSHIP_PORT_RANGE;
 
-  int[] DEFAULT_MEMBERSHIP_PORT_RANGE = new int[] { 1024, 65535 };
+  /** set this boolean to restrict membership/communications to use ports in the ephemeral
range */
+  String RESTRICT_MEMBERSHIP_PORT_RANGE = GEMFIRE_PREFIX + "use-ephemeral-ports";
+  
+  int[] DEFAULT_MEMBERSHIP_PORT_RANGE = Boolean.getBoolean(RESTRICT_MEMBERSHIP_PORT_RANGE)
+      ?  new int[] { 32769, 61000 }
+      :  new int[] {  1024, 65535 };
 
   @ConfigAttributeGetter(name = MEMBERSHIP_PORT_RANGE)
   int[] getMembershipPortRange();
@@ -2390,11 +2398,6 @@ public interface DistributionConfig extends Config, LogConfig {
   String SECURITY_PREFIX_NAME = SECURITY_PREFIX;
 
   /**
-   * The prefix used for Gemfire properties set through java system properties
-   */
-  String GEMFIRE_PREFIX = "gemfire.";
-
-  /**
    * For the "custom-" prefixed properties
    */
   String USERDEFINED_PREFIX_NAME = "custom-";

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b81ebccb/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/DUnitLauncher.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/DUnitLauncher.java
b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/DUnitLauncher.java
old mode 100755
new mode 100644
index 3335158..d6bfa8b
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/DUnitLauncher.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/DUnitLauncher.java
@@ -152,6 +152,9 @@ public class DUnitLauncher {
 
     // inhibit banners to make logs smaller
     System.setProperty(InternalLocator.INHIBIT_DM_BANNER, "true");
+    
+    // restrict membership ports to be outside of AvailablePort's range
+    System.setProperty(DistributionConfig.RESTRICT_MEMBERSHIP_PORT_RANGE, "true");
 
     Runtime.getRuntime().addShutdownHook(new Thread() {
       public void run() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b81ebccb/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/ProcessManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/ProcessManager.java
b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/ProcessManager.java
old mode 100755
new mode 100644
index 6f8f8ca..f938c1a
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/ProcessManager.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/standalone/ProcessManager.java
@@ -179,6 +179,7 @@ public class ProcessManager {
     cmds.add("-Xmx512m");
     cmds.add("-D" + DistributionConfig.GEMFIRE_PREFIX + "DEFAULT_MAX_OPLOG_SIZE=10");
     cmds.add("-D" + DistributionConfig.GEMFIRE_PREFIX + "disallowMcastDefaults=true");
+    cmds.add("-D" + DistributionConfig.RESTRICT_MEMBERSHIP_PORT_RANGE + "=true");
     cmds.add("-ea");
     cmds.add("-XX:+PrintGC");
     cmds.add("-XX:+PrintGCDetails");


Mime
View raw message