This is an automated email from the ASF dual-hosted git repository.

nnag pushed a commit to branch support/1.13
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/support/1.13 by this push:
     new cc5af15  GEODE-8996: Separated the gfsh rebalance test from other 
tests.
cc5af15 is described below

commit cc5af151dac54ff918670278586adbb04e804f49
Author: Nabarun Nag <[email protected]>
AuthorDate: Wed Apr 7 19:02:54 2021 -0700

    GEODE-8996: Separated the gfsh rebalance test from other tests.
    
        * Support for gfsh rebalance compatibilty is from 1.11.0
        * Remaining connectivity tests should be run with all other versions.
        * In the previous commit for GEODE-8996, the existing tests missed 
certain versions.
    
    (cherry picked from commit 0fbb98837afe30a375064c0d8814c9c8ef598e83)
---
 .../geode/management/GfshCompatibilityTest.java    | 30 +---------------
 ... => GfshRebalanceCommandCompatibilityTest.java} | 40 ++--------------------
 2 files changed, 3 insertions(+), 67 deletions(-)

diff --git 
a/geode-gfsh/src/upgradeTest/java/org/apache/geode/management/GfshCompatibilityTest.java
 
b/geode-gfsh/src/upgradeTest/java/org/apache/geode/management/GfshCompatibilityTest.java
index 494cdb9..a62b98a 100644
--- 
a/geode-gfsh/src/upgradeTest/java/org/apache/geode/management/GfshCompatibilityTest.java
+++ 
b/geode-gfsh/src/upgradeTest/java/org/apache/geode/management/GfshCompatibilityTest.java
@@ -26,7 +26,6 @@ import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
-import org.apache.geode.cache.RegionShortcut;
 import org.apache.geode.test.dunit.rules.ClusterStartupRule;
 import org.apache.geode.test.dunit.rules.MemberVM;
 import org.apache.geode.test.junit.categories.BackwardCompatibilityTest;
@@ -44,7 +43,6 @@ public class GfshCompatibilityTest {
   @Parameterized.Parameters(name = "{0}")
   public static Collection<String> data() {
     List<String> result = 
VersionManager.getInstance().getVersionsWithoutCurrent();
-    result.removeIf(s -> TestVersion.compare(s, "1.11.0") < 0);
     return result;
   }
 
@@ -72,7 +70,7 @@ public class GfshCompatibilityTest {
       assertThat(gfsh.isConnected()).isFalse();
       assertThat(gfsh.getGfshOutput()).contains("Cannot use a")
           .contains("gfsh client to connect to this cluster.");
-    } else if (TestVersion.compare(oldVersion, "1.11.0") < 0) {
+    } else if (TestVersion.compare(oldVersion, "1.10.0") < 0) {
       gfsh.connect(oldLocator.getPort(), GfshCommandRule.PortType.locator);
       assertThat(gfsh.isConnected()).isFalse();
       assertThat(gfsh.getGfshOutput()).contains("Cannot use a")
@@ -87,30 +85,4 @@ public class GfshCompatibilityTest {
           .statusIsSuccess();
     }
   }
-
-  @Test
-  public void 
whenCurrentVersionLocatorsExecuteRebalanceOnOldServersThenItMustSucceed()
-      throws Exception {
-    MemberVM locator1 = cluster.startLocatorVM(0, oldVersion);
-    int locatorPort1 = locator1.getPort();
-    MemberVM locator2 =
-        cluster.startLocatorVM(1, 0, oldVersion, x -> 
x.withConnectionToLocator(locatorPort1));
-    int locatorPort2 = locator2.getPort();
-    cluster
-        .startServerVM(2, oldVersion, s -> 
s.withRegion(RegionShortcut.PARTITION, "region")
-            .withConnectionToLocator(locatorPort1, locatorPort2));
-    cluster
-        .startServerVM(3, oldVersion, s -> 
s.withRegion(RegionShortcut.PARTITION, "region")
-            .withConnectionToLocator(locatorPort1, locatorPort2));
-    cluster.stop(0);
-    locator1 = cluster.startLocatorVM(0, x -> 
x.withConnectionToLocator(locatorPort2));
-    cluster.stop(1);
-    int locatorPort1_v2 = locator1.getPort();
-    cluster.startLocatorVM(1, x -> x.withConnectionToLocator(locatorPort1_v2));
-    gfsh.connectAndVerify(locator1);
-    gfsh.executeAndAssertThat("rebalance ")
-        .statusIsSuccess();
-
-  }
-
 }
diff --git 
a/geode-gfsh/src/upgradeTest/java/org/apache/geode/management/GfshCompatibilityTest.java
 
b/geode-gfsh/src/upgradeTest/java/org/apache/geode/management/GfshRebalanceCommandCompatibilityTest.java
similarity index 65%
copy from 
geode-gfsh/src/upgradeTest/java/org/apache/geode/management/GfshCompatibilityTest.java
copy to 
geode-gfsh/src/upgradeTest/java/org/apache/geode/management/GfshRebalanceCommandCompatibilityTest.java
index 494cdb9..3f16b76 100644
--- 
a/geode-gfsh/src/upgradeTest/java/org/apache/geode/management/GfshCompatibilityTest.java
+++ 
b/geode-gfsh/src/upgradeTest/java/org/apache/geode/management/GfshRebalanceCommandCompatibilityTest.java
@@ -12,11 +12,8 @@
  * or implied. See the License for the specific language governing permissions 
and limitations under
  * the License.
  */
-
 package org.apache.geode.management;
 
-import static org.assertj.core.api.Assertions.assertThat;
-
 import java.util.Collection;
 import java.util.List;
 
@@ -31,14 +28,12 @@ import org.apache.geode.test.dunit.rules.ClusterStartupRule;
 import org.apache.geode.test.dunit.rules.MemberVM;
 import org.apache.geode.test.junit.categories.BackwardCompatibilityTest;
 import org.apache.geode.test.junit.rules.GfshCommandRule;
-import 
org.apache.geode.test.junit.runners.CategoryWithParameterizedRunnerFactory;
 import org.apache.geode.test.version.TestVersion;
 import org.apache.geode.test.version.VersionManager;
 
 @Category({BackwardCompatibilityTest.class})
 @RunWith(Parameterized.class)
[email protected](CategoryWithParameterizedRunnerFactory.class)
-public class GfshCompatibilityTest {
+public class GfshRebalanceCommandCompatibilityTest {
   private final String oldVersion;
 
   @Parameterized.Parameters(name = "{0}")
@@ -48,12 +43,10 @@ public class GfshCompatibilityTest {
     return result;
   }
 
-  public GfshCompatibilityTest(String oldVersion) {
+  public GfshRebalanceCommandCompatibilityTest(String oldVersion) {
     this.oldVersion = oldVersion;
   }
 
-  private MemberVM oldLocator;
-
   @Rule
   public GfshCommandRule gfsh = new GfshCommandRule();
 
@@ -61,34 +54,6 @@ public class GfshCompatibilityTest {
   public ClusterStartupRule cluster = new ClusterStartupRule();
 
   @Test
-  public void currentGfshConnectToOlderVersionsOfLocator() throws Exception {
-    oldLocator = cluster.startLocatorVM(0, oldVersion);
-    int locatorPort = oldLocator.getPort();
-    cluster.startServerVM(1, oldVersion,
-        s -> s.withConnectionToLocator(locatorPort));
-    // pre 1.10, it should not be able to connect
-    if (TestVersion.compare(oldVersion, "1.5.0") < 0) {
-      gfsh.connect(oldLocator.getPort(), GfshCommandRule.PortType.locator);
-      assertThat(gfsh.isConnected()).isFalse();
-      assertThat(gfsh.getGfshOutput()).contains("Cannot use a")
-          .contains("gfsh client to connect to this cluster.");
-    } else if (TestVersion.compare(oldVersion, "1.11.0") < 0) {
-      gfsh.connect(oldLocator.getPort(), GfshCommandRule.PortType.locator);
-      assertThat(gfsh.isConnected()).isFalse();
-      assertThat(gfsh.getGfshOutput()).contains("Cannot use a")
-          .contains("gfsh client to connect to a " + oldVersion + " cluster.");
-    }
-    // post 1.10 (including) should connect and be able to execute command
-    else {
-      gfsh.connectAndVerify(oldLocator);
-      assertThat(gfsh.getGfshOutput())
-          .contains("You are connected to a cluster of version: " + 
oldVersion);
-      gfsh.executeAndAssertThat("list members")
-          .statusIsSuccess();
-    }
-  }
-
-  @Test
   public void 
whenCurrentVersionLocatorsExecuteRebalanceOnOldServersThenItMustSucceed()
       throws Exception {
     MemberVM locator1 = cluster.startLocatorVM(0, oldVersion);
@@ -112,5 +77,4 @@ public class GfshCompatibilityTest {
         .statusIsSuccess();
 
   }
-
 }

Reply via email to