geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jensde...@apache.org
Subject [geode] branch develop updated: GEODE-3341: Convert DiskStoreCommandsDUnitTest to use gfsh rules (#1062)
Date Mon, 20 Nov 2017 15:40:23 GMT
This is an automated email from the ASF dual-hosted git repository.

jensdeppe pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 445b304  GEODE-3341: Convert DiskStoreCommandsDUnitTest to use gfsh rules (#1062)
445b304 is described below

commit 445b304670894a73cbe66a485539d8732d29a7c8
Author: Jens Deppe <jdeppe@pivotal.io>
AuthorDate: Mon Nov 20 07:40:20 2017 -0800

    GEODE-3341: Convert DiskStoreCommandsDUnitTest to use gfsh rules (#1062)
    
    * GEODE-3341: Convert DiskStoreCommandsDUnitTest to use gfsh rules
    
    * GEODE-3341: PR review updates
---
 .../cli/commands/DestroyDiskStoreCommand.java      |   21 +-
 .../cli/functions/DestroyDiskStoreFunction.java    |   11 +-
 .../management/internal/cli/json/GfJsonObject.java |    5 +
 .../internal/cli/result/CommandResult.java         |   46 +-
 .../geode/internal/cache/SnapshotTestUtil.java     |    8 +-
 .../cli/commands/DiskStoreCommandsDUnitTest.java   | 1573 +++-----------------
 .../test/dunit/rules/LocatorServerStartupRule.java |   34 +
 .../apache/geode/test/dunit/rules/MemberVM.java    |    5 +
 .../test/junit/assertions/CommandResultAssert.java |   56 +-
 .../geode/test/junit/rules/GfshCommandRule.java    |    8 +-
 .../geode/test/junit/rules/MemberStarterRule.java  |   21 +-
 .../cli/commands/CommandOverHttpDUnitTest.java     |    2 +-
 12 files changed, 324 insertions(+), 1466 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyDiskStoreCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyDiskStoreCommand.java
index 2f24736..fdf796f 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyDiskStoreCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyDiskStoreCommand.java
@@ -65,28 +65,19 @@ public class DestroyDiskStoreCommand implements GfshCommand {
 
       AtomicReference<XmlEntity> xmlEntity = new AtomicReference<>();
       for (CliFunctionResult result : results) {
-        if (result.getThrowable() != null) {
-          tabularData.accumulate("Member", result.getMemberIdOrName());
-          tabularData.accumulate("Result", "ERROR: " + result.getThrowable().getClass().getName()
-              + ": " + result.getThrowable().getMessage());
-          accumulatedData = true;
-          tabularData.setStatus(Result.Status.ERROR);
-        } else if (result.getMessage() != null) {
-          tabularData.accumulate("Member", result.getMemberIdOrName());
-          tabularData.accumulate("Result", result.getMessage());
-          accumulatedData = true;
-
+        if (result.isSuccessful()) {
           if (xmlEntity.get() == null) {
             xmlEntity.set(result.getXmlEntity());
           }
+        } else {
+          tabularData.setStatus(Result.Status.ERROR);
         }
-      }
-
-      if (!accumulatedData) {
-        return ResultBuilder.createInfoResult("No matching disk stores found.");
+        tabularData.accumulate("Member", result.getMemberIdOrName());
+        tabularData.accumulate("Result", result.getMessage());
       }
 
       Result result = ResultBuilder.buildResult(tabularData);
+
       if (xmlEntity.get() != null) {
         persistClusterConfiguration(result,
             () -> getSharedConfiguration().deleteXmlEntity(xmlEntity.get(), groups));
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DestroyDiskStoreFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DestroyDiskStoreFunction.java
index f617d48..741a417 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DestroyDiskStoreFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/DestroyDiskStoreFunction.java
@@ -19,7 +19,7 @@ import org.apache.logging.log4j.Logger;
 import org.apache.geode.SystemFailure;
 import org.apache.geode.cache.CacheClosedException;
 import org.apache.geode.cache.DiskStore;
-import org.apache.geode.cache.execute.FunctionAdapter;
+import org.apache.geode.cache.execute.Function;
 import org.apache.geode.cache.execute.FunctionContext;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.internal.InternalEntity;
@@ -33,18 +33,18 @@ import org.apache.geode.management.internal.configuration.domain.XmlEntity;
  *
  * @since GemFire 8.0
  */
-public class DestroyDiskStoreFunction extends FunctionAdapter implements InternalEntity {
+public class DestroyDiskStoreFunction implements Function<Object[]>, InternalEntity {
   private static final Logger logger = LogService.getLogger();
 
   private static final long serialVersionUID = 1L;
 
   @Override
-  public void execute(FunctionContext context) {
+  public void execute(FunctionContext<Object[]> context) {
     // Declared here so that it's available when returning a Throwable
     String memberId = "";
 
     try {
-      final Object[] args = (Object[]) context.getArguments();
+      final Object[] args = context.getArguments();
       final String diskStoreName = (String) args[0];
 
       InternalCache cache = (InternalCache) context.getCache();
@@ -80,7 +80,6 @@ public class DestroyDiskStoreFunction extends FunctionAdapter implements Interna
     } catch (VirtualMachineError e) {
       SystemFailure.initiateFailure(e);
       throw e;
-
     } catch (Throwable th) {
       SystemFailure.checkFailure();
       logger.error("Could not destroy disk store: {}", th.getMessage(), th);
@@ -92,6 +91,6 @@ public class DestroyDiskStoreFunction extends FunctionAdapter implements Interna
 
   @Override
   public String getId() {
-    return CreateDiskStoreFunction.class.getName();
+    return DestroyDiskStoreFunction.class.getName();
   }
 }
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/json/GfJsonObject.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/json/GfJsonObject.java
index ceda1b2..0000ec5 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/json/GfJsonObject.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/json/GfJsonObject.java
@@ -167,6 +167,11 @@ public class GfJsonObject {
     if (opt instanceof GfJsonObject) {
       return (GfJsonObject) opt;
     }
+
+    if (opt == null) {
+      return null;
+    }
+
     return new GfJsonObject(opt);
   }
 
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/result/CommandResult.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/result/CommandResult.java
index 1802b9b..13153ec 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/result/CommandResult.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/result/CommandResult.java
@@ -17,6 +17,7 @@ package org.apache.geode.management.internal.cli.result;
 import java.io.IOException;
 import java.nio.file.Path;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -24,6 +25,8 @@ import java.util.Map;
 import java.util.Vector;
 import java.util.zip.DataFormatException;
 
+import org.json.JSONArray;
+
 import org.apache.geode.management.cli.Result;
 import org.apache.geode.management.internal.cli.GfshParser;
 import org.apache.geode.management.internal.cli.LogWrapper;
@@ -605,6 +608,32 @@ public class CommandResult implements Result {
     return gfJsonObject.getJSONObject(ResultData.RESULT_CONTENT);
   }
 
+  /**
+   * The intent is that this method should be able to handle both ResultData as well as
+   * CompositeResultData
+   *
+   * @return the extracted GfJsonObject table
+   */
+  public GfJsonObject getTableContent() {
+    return getTableContent(0, 0);
+  }
+
+  public GfJsonObject getTableContent(int sectionIdx, int tableIdx) {
+    GfJsonObject topLevelContent = getContent();
+    GfJsonObject sectionObject = topLevelContent.getJSONObject("__sections__-" + sectionIdx);
+    // This means we're just dealing with a regular ResultData object
+    if (sectionObject == null) {
+      return topLevelContent;
+    }
+
+    GfJsonObject tableContent = sectionObject.getJSONObject("__tables__-" + tableIdx);
+    if (tableContent == null) {
+      return topLevelContent;
+    }
+
+    return tableContent.getJSONObject("content");
+  }
+
   public String getFooter() {
     return getFooter(gfJsonObject);
   }
@@ -625,7 +654,6 @@ public class CommandResult implements Result {
 
   public int hashCode() {
     return this.gfJsonObject.hashCode(); // any arbitrary constant will do
-
   }
 
   @Override
@@ -648,4 +676,20 @@ public class CommandResult implements Result {
   public void setFileToDownload(Path fileToDownload) {
     this.fileToDownload = fileToDownload;
   }
+
+  public List<Object> getColumnValues(String columnName) {
+    Object[] actualValues =
+        toArray(getTableContent().getInternalJsonObject().getJSONArray(columnName));
+    return Arrays.asList(actualValues);
+  }
+
+  private Object[] toArray(JSONArray array) {
+    Object[] values = new Object[array.length()];
+
+    for (int i = 0; i < array.length(); i++) {
+      values[i] = array.get(i);
+    }
+
+    return values;
+  }
 }
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/SnapshotTestUtil.java b/geode-core/src/test/java/org/apache/geode/internal/cache/SnapshotTestUtil.java
index bc1d14d..34757b0 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/SnapshotTestUtil.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/SnapshotTestUtil.java
@@ -14,7 +14,8 @@
  */
 package org.apache.geode.internal.cache;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 import java.io.File;
 import java.util.HashMap;
@@ -32,16 +33,13 @@ public class SnapshotTestUtil {
       String regionName) throws Exception {
     final Map<K, V> testData = new HashMap<K, V>(expected);
     String snapshot = "snapshot-" + diskStoreName + "-" + regionName + ".gfd";
-    SnapshotIterator<Integer, MyObject> iter = SnapshotReader.read(new File(dir, snapshot));
-    try {
+    try (SnapshotIterator<Integer, MyObject> iter = SnapshotReader.read(new File(dir, snapshot))) {
       while (iter.hasNext()) {
         Entry<Integer, MyObject> entry = iter.next();
         Object expectedVal = testData.remove(entry.getKey());
         assertEquals(expectedVal, entry.getValue());
       }
       assertTrue(testData.isEmpty());
-    } finally {
-      iter.close();
     }
   }
 }
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java
index 969873a..448579f 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsDUnitTest.java
@@ -12,1480 +12,283 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
+
 package org.apache.geode.management.internal.cli.commands;
 
-import static org.apache.geode.distributed.ConfigurationProperties.ENABLE_CLUSTER_CONFIGURATION;
-import static org.apache.geode.distributed.ConfigurationProperties.GROUPS;
-import static org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT;
-import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER;
-import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER_BIND_ADDRESS;
-import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER_PORT;
-import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER_START;
-import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
-import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
-import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
-import static org.apache.geode.distributed.ConfigurationProperties.NAME;
-import static org.apache.geode.distributed.ConfigurationProperties.START_LOCATOR;
-import static org.apache.geode.distributed.ConfigurationProperties.USE_CLUSTER_CONFIGURATION;
-import static org.apache.geode.test.dunit.Assert.fail;
-import static org.apache.geode.test.dunit.LogWriterUtils.getLogWriter;
-import static org.apache.geode.test.dunit.Wait.waitForCriterion;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.File;
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
-import java.util.StringTokenizer;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
 
-import org.apache.commons.io.FileUtils;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TemporaryFolder;
 
 import org.apache.geode.cache.Cache;
-import org.apache.geode.cache.CacheFactory;
-import org.apache.geode.cache.DataPolicy;
-import org.apache.geode.cache.DiskStore;
-import org.apache.geode.cache.DiskStoreFactory;
-import org.apache.geode.cache.EvictionAction;
-import org.apache.geode.cache.EvictionAttributes;
-import org.apache.geode.cache.PartitionAttributes;
-import org.apache.geode.cache.PartitionAttributesFactory;
 import org.apache.geode.cache.Region;
-import org.apache.geode.cache.RegionFactory;
-import org.apache.geode.cache.RegionShortcut;
-import org.apache.geode.cache.Scope;
-import org.apache.geode.cache.query.data.PortfolioPdx;
 import org.apache.geode.compression.SnappyCompressor;
-import org.apache.geode.distributed.DistributedSystemDisconnectedException;
 import org.apache.geode.distributed.Locator;
 import org.apache.geode.distributed.internal.ClusterConfigurationService;
 import org.apache.geode.distributed.internal.InternalLocator;
-import org.apache.geode.internal.AvailablePort;
-import org.apache.geode.internal.AvailablePortHelper;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
-import org.apache.geode.internal.cache.InternalCache;
-import org.apache.geode.internal.cache.PartitionedRegion;
 import org.apache.geode.internal.cache.SnapshotTestUtil;
-import org.apache.geode.internal.cache.persistence.PersistentMemberManager;
-import org.apache.geode.management.cli.Result;
-import org.apache.geode.management.internal.cli.i18n.CliStrings;
-import org.apache.geode.management.internal.cli.result.CommandResult;
-import org.apache.geode.management.internal.cli.shell.Gfsh;
-import org.apache.geode.management.internal.cli.util.CommandStringBuilder;
-import org.apache.geode.test.dunit.AsyncInvocation;
-import org.apache.geode.test.dunit.Host;
-import org.apache.geode.test.dunit.SerializableCallable;
-import org.apache.geode.test.dunit.SerializableRunnable;
-import org.apache.geode.test.dunit.VM;
-import org.apache.geode.test.dunit.WaitCriterion;
+import org.apache.geode.test.dunit.rules.LocatorServerStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
 import org.apache.geode.test.junit.categories.DistributedTest;
-import org.apache.geode.test.junit.categories.FlakyTest;
+import org.apache.geode.test.junit.rules.GfshCommandRule;
 
-/**
- * The DiskStoreCommandsDUnitTest class is a distributed test suite of test cases for testing the
- * disk store commands that are part of Gfsh.
- * </p>
- *
- * @see org.apache.geode.management.internal.cli.commands.AlterOfflineDiskStoreCommand
- * @see org.apache.geode.management.internal.cli.commands.BackupDiskStoreCommand
- * @see org.apache.geode.management.internal.cli.commands.CompactDiskStoreCommand
- * @see org.apache.geode.management.internal.cli.commands.CompactOfflineDiskStoreCommand
- * @see org.apache.geode.management.internal.cli.commands.CreateDiskStoreCommand
- * @see org.apache.geode.management.internal.cli.commands.DescribeDiskStoreCommand
- * @see org.apache.geode.management.internal.cli.commands.DescribeOfflineDiskStoreCommand
- * @see org.apache.geode.management.internal.cli.commands.DestroyDiskStoreCommand
- * @see org.apache.geode.management.internal.cli.commands.ExportOfflineDiskStoreCommand
- * @see ListDiskStoresCommand
- * @see org.apache.geode.management.internal.cli.commands.RevokeMissingDiskStoreCommand
- * @see org.apache.geode.management.internal.cli.commands.ShowMissingDiskStoreCommand
- * @see org.apache.geode.management.internal.cli.commands.UpgradeOfflineDiskStoreCommand
- * @see org.apache.geode.management.internal.cli.commands.ValidateDiskStoreCommand
- * @see org.junit.Assert
- * @see org.junit.Test
- * @since GemFire 7.0
- */
-@Category({DistributedTest.class, FlakyTest.class}) // GEODE-1206 GEODE-1406 GEODE-2102 GEODE-3530
-@SuppressWarnings("serial")
-public class DiskStoreCommandsDUnitTest extends CliCommandTestBase {
-
-  private final List<String> filesToBeDeleted = new CopyOnWriteArrayList<>();
-
-  @Test // FlakyTest: GEODE-2102
-  public void testMissingDiskStore() {
-    final String regionName = "testShowMissingDiskStoreRegion";
-
-    setUpJmxManagerOnVm0ThenConnect(null);
-
-    final VM vm0 = Host.getHost(0).getVM(0);
-    final VM vm1 = Host.getHost(0).getVM(1);
-    final String vm1Name = "VM" + vm1.getId();
-    final String diskStoreName = "DiskStoreCommandsDUnitTest";
-
-    // Default setup creates a cache in the Manager, now create a cache in VM1
-    vm1.invoke(new SerializableRunnable() {
-      public void run() {
-        Properties localProps = new Properties();
-        localProps.setProperty(NAME, vm1Name);
-        getSystem(localProps);
-        Cache cache = getCache();
-      }
-    });
+@Category(DistributedTest.class)
+public class DiskStoreCommandsDUnitTest {
 
-    // Create a disk store and region in the Manager (VM0) and VM1 VMs
-    for (final VM vm : (new VM[] {vm0, vm1})) {
-      final String vmName = "VM" + vm.getId();
-      vm.invoke(new SerializableRunnable() {
-        public void run() {
-          Cache cache = getCache();
-
-          File diskStoreDirFile = new File(diskStoreName + vm.getId());
-          diskStoreDirFile.mkdirs();
-
-          DiskStoreFactory diskStoreFactory = cache.createDiskStoreFactory();
-          diskStoreFactory.setDiskDirs(new File[] {diskStoreDirFile});
-          diskStoreFactory.setMaxOplogSize(1);
-          diskStoreFactory.setAllowForceCompaction(true);
-          diskStoreFactory.setAutoCompact(false);
-          diskStoreFactory.create(regionName);
-
-          RegionFactory regionFactory = cache.createRegionFactory();
-          regionFactory.setDiskStoreName(regionName);
-          regionFactory.setDiskSynchronous(true);
-          regionFactory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
-          regionFactory.setScope(Scope.DISTRIBUTED_ACK);
-          regionFactory.create(regionName);
-        }
-      });
-    }
-
-    // Add data to the region
-    vm0.invoke(new SerializableRunnable() {
-      public void run() {
-        Cache cache = getCache();
-        Region region = cache.getRegion(regionName);
-        region.put("A", "B");
-      }
-    });
+  private static final String REGION_1 = "REGION1";
+  private static final String DISKSTORE = "DISKSTORE";
+  private static final String GROUP = "GROUP1";
 
-    // Make sure that everything thus far is okay and there are no missing disk stores
-    CommandResult cmdResult = executeCommand(CliStrings.SHOW_MISSING_DISK_STORE);
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-    assertTrue(commandResultToString(cmdResult).contains("No missing disk store found"));
-
-    // Close the region in the Manager (VM0) VM
-    vm0.invoke(new SerializableRunnable() {
-      public void run() {
-        Cache cache = getCache();
-        Region region = cache.getRegion(regionName);
-        region.close();
-      }
-    });
+  @Rule
+  public LocatorServerStartupRule rule = new LocatorServerStartupRule();
 
-    // Add data to VM1 and then close the region
-    vm1.invoke(new SerializableRunnable() {
-      public void run() {
-        Cache cache = getCache();
-        Region region = cache.getRegion(regionName);
-        region.put("A", "C");
-        region.close();
-      }
-    });
+  @Rule
+  public GfshCommandRule gfsh = new GfshCommandRule();
 
-    // Add the region back to the Manager (VM0) VM
-    vm0.invokeAsync(new SerializableRunnable() {
-      public void run() {
-        Cache cache = getCache();
-
-        RegionFactory regionFactory = cache.createRegionFactory();
-        regionFactory.setDiskStoreName(regionName);
-        regionFactory.setDiskSynchronous(true);
-        regionFactory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
-        regionFactory.setScope(Scope.DISTRIBUTED_ACK);
-        try {
-          regionFactory.create(regionName);
-        } catch (DistributedSystemDisconnectedException ignore) {
-          // okay to ignore
-        }
-      }
-    });
+  @Rule
+  public TemporaryFolder tempDir = new TemporaryFolder();
 
-    // Wait for the region in the Manager (VM0) to come online
-    vm0.invoke(new SerializableRunnable() {
-      public void run() {
-        WaitCriterion waitCriterion = new WaitCriterion() {
-          public boolean done() {
-            Cache cache = getCache();
-            PersistentMemberManager memberManager =
-                ((InternalCache) cache).getPersistentMemberManager();
-            return !memberManager.getWaitingRegions().isEmpty();
-          }
-
-          public String description() {
-            return "Waiting for another persistent member to come online";
-          }
-        };
-        waitForCriterion(waitCriterion, 70000, 100, true);
-      }
-    });
+  private void createDiskStoreAndRegion(MemberVM jmxManager, int serverCount) {
+    gfsh.executeAndAssertThat(String.format("create disk-store --name=%s --dir=%s --group=%s",
+        DISKSTORE, DISKSTORE, GROUP));
 
-    // Validate that there is a missing disk store on VM1
-    cmdResult = executeCommand(CliStrings.SHOW_MISSING_DISK_STORE);
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-
-    String stringResult = commandResultToString(cmdResult);
-    System.out.println("command result=" + stringResult);
-    assertEquals(5, countLinesInString(stringResult, false));
-    assertTrue(stringContainsLine(stringResult, "Disk Store ID.*Host.*Directory"));
-    assertTrue(stringContainsLine(stringResult, ".*" + diskStoreName + vm1.getId()));
-
-    // Extract the id from the returned missing disk store
-    String line = getLineFromString(stringResult, 4);
-    assertFalse(line.contains("---------"));
-    StringTokenizer resultTokenizer = new StringTokenizer(line);
-    String id = resultTokenizer.nextToken();
-
-    // Remove the missing disk store and validate the result
-    cmdResult = executeCommand("revoke missing-disk-store --id=" + id);
-    assertNotNull(cmdResult);
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-    assertTrue(
-        commandResultToString(cmdResult).contains("Missing disk store successfully revoked"));
-
-    // Do our own cleanup so that the disk store directories can be removed
-    super.destroyDefaultSetup();
-    for (final VM vm : (new VM[] {vm0, vm1})) {
-      final String vmName = "VM" + vm.getId();
-      vm.invoke(new SerializableRunnable() {
-        public void run() {
-          try {
-            FileUtils.deleteDirectory((new File(diskStoreName + vm.getId())));
-          } catch (IOException iex) {
-            // There's nothing else we can do
-          }
-        }
-      });
-    }
-  }
+    List<String> diskStores =
+        IntStream.rangeClosed(1, serverCount).mapToObj(x -> DISKSTORE).collect(Collectors.toList());
+    gfsh.executeAndAssertThat("list disk-stores").statusIsSuccess()
+        .tableHasColumnWithValuesContaining("Disk Store Name", diskStores.toArray(new String[0]));
 
-  @Test
-  public void testMissingDiskStoreCommandWithColocation() {
-    final String regionName = "testShowPersistentRecoveryFailuresRegion";
-    final String childName = "childRegion";
-
-    setUpJmxManagerOnVm0ThenConnect(null);
-
-    final VM vm0 = Host.getHost(0).getVM(0);
-    final VM vm1 = Host.getHost(0).getVM(1);
-    final String vm1Name = "VM" + vm1.getId();
-    final String diskStoreName = "DiskStoreCommandsDUnitTest";
-
-    // Default setup creates a cache in the Manager, now create a cache in VM1
-    vm1.invoke(new SerializableRunnable() {
-      public void run() {
-        Properties localProps = new Properties();
-        localProps.setProperty(NAME, vm1Name);
-        getSystem(localProps);
-        Cache cache = getCache();
-      }
-    });
+    jmxManager.waitTillDiskstoreIsReady(DISKSTORE, serverCount);
 
-    // Create a disk store and region in the Manager (VM0) and VM1 VMs
-    for (final VM vm : (new VM[] {vm0, vm1})) {
-      final String vmName = "VM" + vm.getId();
-      vm.invoke(new SerializableRunnable() {
-        public void run() {
-          Cache cache = getCache();
-
-          File diskStoreDirFile = new File(diskStoreName + vm.getId());
-          diskStoreDirFile.mkdirs();
-
-          DiskStoreFactory diskStoreFactory = cache.createDiskStoreFactory();
-          diskStoreFactory.setDiskDirs(new File[] {diskStoreDirFile});
-          diskStoreFactory.setMaxOplogSize(1);
-          diskStoreFactory.setAllowForceCompaction(true);
-          diskStoreFactory.setAutoCompact(false);
-          diskStoreFactory.create(regionName);
-          diskStoreFactory.create(childName);
-
-          RegionFactory regionFactory = cache.createRegionFactory();
-          regionFactory.setDiskStoreName(regionName);
-          regionFactory.setDiskSynchronous(true);
-          regionFactory.setDataPolicy(DataPolicy.PERSISTENT_PARTITION);
-          regionFactory.create(regionName);
-
-          PartitionAttributes pa =
-              new PartitionAttributesFactory().setColocatedWith(regionName).create();
-          RegionFactory childRegionFactory = cache.createRegionFactory();
-          childRegionFactory.setPartitionAttributes(pa);
-          childRegionFactory.setDiskStoreName(childName);
-          childRegionFactory.setDiskSynchronous(true);
-          childRegionFactory.setDataPolicy(DataPolicy.PERSISTENT_PARTITION);
-          childRegionFactory.create(childName);
-        }
-      });
-    }
-
-    // Add data to the region
-    vm0.invoke(new SerializableRunnable() {
-      public void run() {
-        Cache cache = getCache();
-        Region region = cache.getRegion(regionName);
-        region.put("A", "a");
-        region.put("B", "b");
-      }
-    });
+    gfsh.executeAndAssertThat(String.format(
+        "create region --name=%s --type=REPLICATE_PERSISTENT --disk-store=%s --group=%s --eviction-action=overflow-to-disk",
+        REGION_1, DISKSTORE, GROUP)).statusIsSuccess();
+  }
 
-    // Make sure that everything thus far is okay and there are no missing disk stores
-    CommandResult cmdResult = executeCommand(CliStrings.SHOW_MISSING_DISK_STORE);
-    System.out.println("command result=\n" + commandResultToString(cmdResult));
-
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-    assertTrue(cmdResult.toString(),
-        commandResultToString(cmdResult).contains("No missing disk store found"));
-
-    // Close the regions in the Manager (VM0) VM
-    vm0.invoke(new SerializableRunnable() {
-      public void run() {
-        Cache cache = getCache();
-        Region region = cache.getRegion(childName);
-        region.close();
-        region = cache.getRegion(regionName);
-        region.close();
-      }
-    });
+  @Test
+  public void testMissingDiskStore() throws Exception {
+    Properties props = new Properties();
+    props.setProperty("groups", GROUP);
 
-    // Add data to VM1 and then close the region
-    vm1.invoke(new SerializableRunnable() {
-      public void run() {
-        Cache cache = getCache();
-        Region childRegion = cache.getRegion(childName);
-        PartitionedRegion parentRegion = (PartitionedRegion) (cache.getRegion(regionName));
-        try {
-          parentRegion.put("A", "C");
-        } catch (Exception e) {
-          // Ignore any exception on the put
-        }
-        childRegion.close();
-        parentRegion.close();
-      }
-    });
+    MemberVM locator = rule.startLocatorVM(0);
+    MemberVM server1 = rule.startServerVM(1, props, locator.getPort());
+    MemberVM server2 = rule.startServerVM(2, props, locator.getPort());
 
-    SerializableRunnable restartParentRegion =
-        new SerializableRunnable("Restart parent region on") {
-          public void run() {
-            Cache cache = getCache();
-
-            RegionFactory regionFactory = cache.createRegionFactory();
-            regionFactory.setDiskStoreName(regionName);
-            regionFactory.setDiskSynchronous(true);
-            regionFactory.setDataPolicy(DataPolicy.PERSISTENT_PARTITION);
-            try {
-              regionFactory.create(regionName);
-            } catch (Exception e) {
-              // okay to ignore
-            }
-          }
-        };
-
-    SerializableRunnable restartChildRegion = new SerializableRunnable("Restart child region") {
-      public void run() {
-        Cache cache = getCache();
-
-        PartitionAttributes pa =
-            new PartitionAttributesFactory().setColocatedWith(regionName).create();
-        RegionFactory regionFactory = cache.createRegionFactory();
-        regionFactory.setPartitionAttributes(pa);
-        regionFactory.setDiskStoreName(childName);
-        regionFactory.setDiskSynchronous(true);
-        regionFactory.setDataPolicy(DataPolicy.PERSISTENT_PARTITION);
-        try {
-          regionFactory.create(childName);
-        } catch (Exception e) {
-          // okay to ignore
-          e.printStackTrace();
-        }
-      }
-    };
-
-    // Add the region back to the Manager (VM0) VM
-    AsyncInvocation async0 = vm0.invokeAsync(restartParentRegion);
-    AsyncInvocation async1 = vm1.invokeAsync(restartParentRegion);
-
-    // Wait for the region in the Manager (VM0) to come online
-    vm0.invoke(new SerializableRunnable("WaitForRegionInVm0") {
-      public void run() {
-        WaitCriterion waitCriterion = new WaitCriterion() {
-          public boolean done() {
-            Cache cache = getCache();
-            PersistentMemberManager memberManager =
-                ((GemFireCacheImpl) cache).getPersistentMemberManager();
-            return !memberManager.getWaitingRegions().isEmpty();
-          }
-
-          public String description() {
-            return "Waiting for another persistent member to come online";
-          }
-        };
-        try {
-          waitForCriterion(waitCriterion, 5000, 100, true);
-        } catch (AssertionError ae) {
-          // Ignore. waitForCriterion is expected to timeout in this test
-        }
-      }
-    });
+    gfsh.connectAndVerify(locator);
 
-    // Validate that there is a missing disk store on VM1
-    try {
-      cmdResult = executeCommand(CliStrings.SHOW_MISSING_DISK_STORE);
-      assertNotNull("Expect command result != null", cmdResult);
-      assertEquals(Result.Status.OK, cmdResult.getStatus());
-
-      String stringResult = commandResultToString(cmdResult);
-      System.out.println("command result=\n" + stringResult);
-      // Expect 2 result sections with header lines and 4 information lines in the first section
-      assertEquals(6, countLinesInString(stringResult, false));
-      assertTrue(stringContainsLine(stringResult,
-          "Host.*Distributed Member.*Parent Region.*Missing Colocated Region"));
-      assertTrue(stringContainsLine(stringResult, ".*" + regionName + ".*" + childName));
-
-      AsyncInvocation async0b = vm0.invokeAsync(restartChildRegion);
-      try {
-        async0b.get(5000, TimeUnit.MILLISECONDS);
-      } catch (Exception e) {
-        // Expected timeout - Region recovery is still waiting on vm1 child region and disk-store to
-        // come online
-      }
-
-      cmdResult = executeCommand(CliStrings.SHOW_MISSING_DISK_STORE);
-      assertNotNull("Expect command result != null", cmdResult);
-      assertEquals(Result.Status.OK, cmdResult.getStatus());
-
-      stringResult = commandResultToString(cmdResult);
-      System.out.println("command result=\n" + stringResult);
-
-      // Extract the id from the returned missing disk store
-      String line = getLineFromString(stringResult, 4);
-      assertFalse(line.contains("---------"));
-      StringTokenizer resultTokenizer = new StringTokenizer(line);
-      String id = resultTokenizer.nextToken();
-
-      AsyncInvocation async1b = vm1.invokeAsync(restartChildRegion);
-      try {
-        async1b.get(5000, TimeUnit.MILLISECONDS);
-      } catch (Exception e) {
-        e.printStackTrace();
-      }
-      cmdResult = executeCommand(CliStrings.SHOW_MISSING_DISK_STORE);
-      assertNotNull("Expect command result != null", cmdResult);
-      assertEquals(Result.Status.OK, cmdResult.getStatus());
-
-      stringResult = commandResultToString(cmdResult);
-      System.out.println("command result=\n" + stringResult);
-
-    } finally {
-      // Verify that the invokeAsync thread terminated
-      try {
-        async0.get(10000, TimeUnit.MILLISECONDS);
-        async1.get(10000, TimeUnit.MILLISECONDS);
-      } catch (Exception e) {
-        fail("Unexpected timeout waitiong for invokeAsync threads to terminate: " + e.getMessage());
-      }
-    }
-
-    // Do our own cleanup so that the disk store directories can be removed
-    super.destroyDefaultSetup();
-    for (final VM vm : (new VM[] {vm0, vm1})) {
-      final String vmName = "VM" + vm.getId();
-      vm.invoke(new SerializableRunnable() {
-        public void run() {
-          try {
-            FileUtils.deleteDirectory((new File(diskStoreName + vm.getId())));
-          } catch (IOException iex) {
-            // There's nothing else we can do
-          }
-        }
-      });
-    }
-  }
+    createDiskStoreAndRegion(locator, 2);
 
-  @Test
-  public void testDescribeOfflineDiskStore() {
-    setUpJmxManagerOnVm0ThenConnect(null);
-
-    final File diskStoreDir =
-        new File(new File(".").getAbsolutePath(), "DiskStoreCommandDUnitDiskStores");
-    diskStoreDir.mkdir();
-    this.filesToBeDeleted.add(diskStoreDir.getAbsolutePath());
-
-    final String diskStoreName1 = "DiskStore1";
-    final String region1 = "Region1";
-    final String region2 = "Region2";
-
-    final VM vm1 = Host.getHost(0).getVM(1);
-    vm1.invoke(new SerializableRunnable() {
-      public void run() {
-        final Cache cache = getCache();
-
-        DiskStoreFactory diskStoreFactory = cache.createDiskStoreFactory();
-        diskStoreFactory.setDiskDirs(new File[] {diskStoreDir});
-        final DiskStore diskStore1 = diskStoreFactory.create(diskStoreName1);
-        assertNotNull(diskStore1);
-
-        RegionFactory regionFactory =
-            cache.createRegionFactory(RegionShortcut.REPLICATE_PERSISTENT);
-        regionFactory.setDiskStoreName(diskStoreName1);
-        regionFactory.setDiskSynchronous(true);
-        regionFactory.create(region1);
-
-        regionFactory.setCompressor(SnappyCompressor.getDefaultInstance());
-        regionFactory.create(region2);
-
-        cache.close();
-        assertTrue(new File(diskStoreDir, "BACKUP" + diskStoreName1 + ".if").exists());
-      }
+    server1.invoke(() -> {
+      Cache cache = LocatorServerStartupRule.getCache();
+      Region r = cache.getRegion(REGION_1);
+      r.put("A", "B");
     });
 
-    CommandResult cmdResult = executeCommand("describe offline-disk-store --name=" + diskStoreName1
-        + " --disk-dirs=" + diskStoreDir.getAbsolutePath());
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-    String stringResult = commandResultToString(cmdResult);
-    assertEquals(3, countLinesInString(stringResult, false));
-    assertTrue(stringContainsLine(stringResult, ".*/" + region1
-        + ": -lru=none -concurrencyLevel=16 -initialCapacity=16 -loadFactor=0.75 -offHeap=false -compressor=none -statisticsEnabled=false"));
-    assertTrue(stringContainsLine(stringResult, ".*/" + region2
-        + ": -lru=none -concurrencyLevel=16 -initialCapacity=16 -loadFactor=0.75 -offHeap=false -compressor=org.apache.geode.compression.SnappyCompressor -statisticsEnabled=false"));
-
-    cmdResult = executeCommand("describe offline-disk-store --name=" + diskStoreName1
-        + " --disk-dirs=" + diskStoreDir.getAbsolutePath() + " --region=/" + region1);
-    stringResult = commandResultToString(cmdResult);
-    assertEquals(2, countLinesInString(stringResult, false));
-    assertTrue(stringContainsLine(stringResult, ".*/" + region1 + ": .*"));
-    assertFalse(stringContainsLine(stringResult, ".*/" + region2 + ": .*"));
-  }
+    gfsh.executeAndAssertThat("show missing-disk-stores")
+        .containsOutput("No missing disk store found");
 
-  @Test
-  public void testOfflineDiskStorePdxCommands() {
-    final Properties props = new Properties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(START_LOCATOR,
-        "localhost[" + AvailablePortHelper.getRandomAvailableTCPPort() + "]");
-
-    final File diskStoreDir =
-        new File(new File(".").getAbsolutePath(), "DiskStoreCommandDUnitDiskStores");
-    diskStoreDir.mkdir();
-    this.filesToBeDeleted.add(diskStoreDir.getAbsolutePath());
-
-    final String diskStoreName1 = "DiskStore1";
-    final String region1 = "Region1";
-
-    final VM vm1 = Host.getHost(0).getVM(1);
-    vm1.invoke(new SerializableRunnable() {
-      public void run() {
-        final Cache cache =
-            new CacheFactory(props).setPdxPersistent(true).setPdxDiskStore(diskStoreName1).create();
-
-        DiskStoreFactory diskStoreFactory = cache.createDiskStoreFactory();
-        diskStoreFactory.setDiskDirs(new File[] {diskStoreDir});
-        final DiskStore diskStore1 = diskStoreFactory.create(diskStoreName1);
-        assertNotNull(diskStore1);
-
-        RegionFactory regionFactory =
-            cache.createRegionFactory(RegionShortcut.REPLICATE_PERSISTENT);
-        regionFactory.setDiskStoreName(diskStoreName1);
-        regionFactory.setDiskSynchronous(true);
-        Region r1 = regionFactory.create(region1);
-        r1.put("key-1", new PortfolioPdx(1));
-
-        cache.close();
-        assertTrue(new File(diskStoreDir, "BACKUP" + diskStoreName1 + ".if").exists());
-      }
-    });
-
-    CommandResult cmdResult = executeCommand("describe offline-disk-store --name=" + diskStoreName1
-        + " --disk-dirs=" + diskStoreDir.getAbsolutePath() + " --pdx=true");
-    String stringResult = commandResultToString(cmdResult);
-    assertTrue(stringContainsLine(stringResult, ".*PDX Types.*"));
-    assertTrue(stringContainsLine(stringResult,
-        ".*org\\.apache\\.geode\\.cache\\.query\\.data\\.PortfolioPdx.*"));
-    assertTrue(stringContainsLine(stringResult,
-        ".*org\\.apache\\.geode\\.cache\\.query\\.data\\.PositionPdx.*"));
-    assertTrue(stringContainsLine(stringResult, ".*PDX Enums.*"));
-    assertTrue(stringContainsLine(stringResult,
-        ".*org\\.apache\\.geode\\.cache\\.query\\.data\\.PortfolioPdx\\$Day.*"));
-  }
+    server1.invoke(LocatorServerStartupRule::stopMemberInThisVM);
 
-  @Test
-  public void testValidateDiskStore() {
-    setUpJmxManagerOnVm0ThenConnect(null);
-
-    final File diskStoreDir =
-        new File(new File(".").getAbsolutePath(), "DiskStoreCommandDUnitDiskStores");
-    diskStoreDir.mkdir();
-    this.filesToBeDeleted.add(diskStoreDir.getAbsolutePath());
-
-    final String diskStoreName1 = "DiskStore1";
-    final String region1 = "Region1";
-    final String region2 = "Region2";
-
-    final VM vm1 = Host.getHost(0).getVM(1);
-    vm1.invoke(new SerializableRunnable() {
-      public void run() {
-        final Cache cache = getCache();
-
-        DiskStoreFactory diskStoreFactory = cache.createDiskStoreFactory();
-        diskStoreFactory.setDiskDirs(new File[] {diskStoreDir});
-        final DiskStore diskStore1 = diskStoreFactory.create(diskStoreName1);
-        assertNotNull(diskStore1);
-
-        RegionFactory regionFactory =
-            cache.createRegionFactory(RegionShortcut.REPLICATE_PERSISTENT);
-        regionFactory.setDiskStoreName(diskStoreName1);
-        regionFactory.setDiskSynchronous(true);
-        regionFactory.create(region1);
-        regionFactory.create(region2);
-
-        cache.close();
-        assertTrue(new File(diskStoreDir, "BACKUP" + diskStoreName1 + ".if").exists());
-      }
+    server2.invoke(() -> {
+      Cache cache = LocatorServerStartupRule.getCache();
+      Region r = cache.getRegion(REGION_1);
+      r.put("A", "C");
     });
-    String command = "validate offline-disk-store --name=" + diskStoreName1 + " --disk-dirs="
-        + diskStoreDir.getAbsolutePath();
-    getLogWriter().info("testValidateDiskStore command: " + command);
-    CommandResult cmdResult = executeCommand(command);
-    if (cmdResult != null) {
-      String stringResult = commandResultToString(cmdResult);
-      getLogWriter().info("testValidateDiskStore cmdResult is stringResult " + stringResult);
-      assertEquals(Result.Status.OK, cmdResult.getStatus());
-      assertTrue(stringResult.contains("Total number of region entries in this disk store is"));
-
-    } else {
-      getLogWriter().info("testValidateDiskStore cmdResult is null");
-      fail("Did not get CommandResult in testValidateDiskStore");
-    }
-  }
 
-  @Test
-  public void testExportOfflineDiskStore() throws Exception {
-    setUpJmxManagerOnVm0ThenConnect(null);
-
-    final File diskStoreDir =
-        new File(new File(".").getAbsolutePath(), "DiskStoreCommandDUnitDiskStores");
-    diskStoreDir.mkdir();
-    this.filesToBeDeleted.add(diskStoreDir.getAbsolutePath());
-    final File exportDir = new File(new File(".").getAbsolutePath(), "DiskStoreCommandDUnitExport");
-    exportDir.mkdir();
-    this.filesToBeDeleted.add(exportDir.getAbsolutePath());
-
-    final String diskStoreName1 = "DiskStore1";
-    final String region1 = "Region1";
-    final String region2 = "Region2";
-    final Map<String, String> entries = new HashMap<>();
-    entries.put("key1", "value1");
-    entries.put("key2", "value2");
-
-    final VM vm1 = Host.getHost(0).getVM(1);
-    vm1.invoke(new SerializableRunnable() {
-      public void run() {
-        final Cache cache = getCache();
-
-        DiskStoreFactory diskStoreFactory = cache.createDiskStoreFactory();
-        diskStoreFactory.setDiskDirs(new File[] {diskStoreDir});
-        final DiskStore diskStore1 = diskStoreFactory.create(diskStoreName1);
-        assertNotNull(diskStore1);
-
-        RegionFactory regionFactory =
-            cache.createRegionFactory(RegionShortcut.REPLICATE_PERSISTENT);
-        regionFactory.setDiskStoreName(diskStoreName1);
-        regionFactory.setDiskSynchronous(true);
-        Region r1 = regionFactory.create(region1);
-        r1.putAll(entries);
-        Region r2 = regionFactory.create(region2);
-        r2.putAll(entries);
-
-        cache.close();
-        assertTrue(new File(diskStoreDir, "BACKUP" + diskStoreName1 + ".if").exists());
-      }
-    });
-    String command = "export offline-disk-store --name=" + diskStoreName1 + " --disk-dirs="
-        + diskStoreDir.getAbsolutePath() + " --dir=" + exportDir;
-    getLogWriter().info("testExportDiskStore command" + command);
-    CommandResult cmdResult = executeCommand(command);
-    if (cmdResult != null) {
-      assertEquals(Result.Status.OK, cmdResult.getStatus());
-      String stringResult = commandResultToString(cmdResult);
-      SnapshotTestUtil.checkSnapshotEntries(exportDir, entries, diskStoreName1, region1);
-      SnapshotTestUtil.checkSnapshotEntries(exportDir, entries, diskStoreName1, region2);
-
-    } else {
-      getLogWriter().info("testExportOfflineDiskStore cmdResult is null");
-      fail("Did not get CommandResult in testExportOfflineDiskStore");
-    }
-  }
+    server2.invoke(LocatorServerStartupRule::stopMemberInThisVM);
 
-  /**
-   * Asserts that creating and destroying disk stores correctly updates the shared configuration.
-   */
-  @Test // FlakyTest: GEODE-1406
-  public void testCreateDestroyUpdatesSharedConfig() {
-    disconnectAllFromDS();
-    final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(2);
-    jmxPort = ports[0];
-    httpPort = ports[1];
-    try {
-      jmxHost = InetAddress.getLocalHost().getHostName();
-    } catch (UnknownHostException ignore) {
-      jmxHost = "localhost";
-    }
-
-    final String groupName = "testDiskStoreSharedConfigGroup";
-    final String diskStoreName = "testDiskStoreSharedConfigDiskStore";
-
-    // Start the Locator and wait for shared configuration to be available
-    final int locatorPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-    final Properties locatorProps = new Properties();
-    locatorProps.setProperty(NAME, "Locator");
-    locatorProps.setProperty(MCAST_PORT, "0");
-    locatorProps.setProperty(LOG_LEVEL, "fine");
-    locatorProps.setProperty(ENABLE_CLUSTER_CONFIGURATION, "true");
-    locatorProps.setProperty(JMX_MANAGER, "true");
-    locatorProps.setProperty(JMX_MANAGER_START, "true");
-    locatorProps.setProperty(JMX_MANAGER_BIND_ADDRESS, String.valueOf(jmxHost));
-    locatorProps.setProperty(JMX_MANAGER_PORT, String.valueOf(jmxPort));
-    locatorProps.setProperty(HTTP_SERVICE_PORT, String.valueOf(httpPort));
-
-    Host.getHost(0).getVM(0).invoke(new SerializableRunnable() {
-      @Override
-      public void run() {
-        final File locatorLogFile = new File("locator-" + locatorPort + ".log");
-        try {
-          final InternalLocator locator = (InternalLocator) Locator.startLocatorAndDS(locatorPort,
-              locatorLogFile, null, locatorProps);
-
-          WaitCriterion wc = new WaitCriterion() {
-            @Override
-            public boolean done() {
-              return locator.isSharedConfigurationRunning();
-            }
-
-            @Override
-            public String description() {
-              return "Waiting for shared configuration to be started";
-            }
-          };
-          waitForCriterion(wc, 5000, 500, true);
-        } catch (IOException ioex) {
-          fail("Unable to create a locator with a shared configuration");
-        }
-      }
-    });
+    props.setProperty("log-file", "");
+    rule.startServerVMAsync(server1.getVM().getId(), props, locator.getPort());
 
-    connect(jmxHost, jmxPort, httpPort, getDefaultShell());
-
-    // Create a cache in VM 1
-    final File diskStoreDir = new File(new File(".").getAbsolutePath(), diskStoreName);
-    this.filesToBeDeleted.add(diskStoreDir.getAbsolutePath());
-    VM vm = Host.getHost(0).getVM(1);
-    vm.invoke(new SerializableRunnable() {
-      @Override
-      public void run() {
-        diskStoreDir.mkdirs();
-
-        Properties localProps = new Properties();
-        localProps.setProperty(MCAST_PORT, "0");
-        localProps.setProperty(LOCATORS, "localhost[" + locatorPort + "]");
-        localProps.setProperty(GROUPS, groupName);
-        getSystem(localProps);
-        assertNotNull(getCache());
-      }
-    });
+    locator.waitTillDiskstoreIsReady(DISKSTORE, 1);
 
-    // Test creating the disk store
-    CommandStringBuilder commandStringBuilder =
-        new CommandStringBuilder(CliStrings.CREATE_DISK_STORE);
-    commandStringBuilder.addOption(CliStrings.CREATE_DISK_STORE__NAME, diskStoreName);
-    commandStringBuilder.addOption(CliStrings.GROUP, groupName);
-    commandStringBuilder.addOption(CliStrings.CREATE_DISK_STORE__DIRECTORY_AND_SIZE,
-        diskStoreDir.getAbsolutePath());
-    CommandResult cmdResult = executeCommand(commandStringBuilder.toString());
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-
-    // Make sure the disk store exists in the shared config
-    Host.getHost(0).getVM(0).invoke(new SerializableRunnable() {
-      @Override
-      public void run() {
-        ClusterConfigurationService sharedConfig =
-            ((InternalLocator) Locator.getLocator()).getSharedConfiguration();
-        String xmlFromConfig;
-        try {
-          xmlFromConfig = sharedConfig.getConfiguration(groupName).getCacheXmlContent();
-          assertTrue(xmlFromConfig.contains(diskStoreName));
-        } catch (Exception e) {
-          fail("Error occurred in cluster configuration service", e);
-        }
-      }
-    });
+    gfsh.executeAndAssertThat("show missing-disk-stores").statusIsSuccess()
+        .containsOutput("Missing Disk Stores", "No missing colocated region found");
 
-    // Restart the cache and make sure it has the diskstore
-    vm = Host.getHost(0).getVM(1);
-    vm.invoke(new SerializableCallable() {
-      @Override
-      public Object call() {
-        getCache().close();
-        Properties localProps = new Properties();
-        localProps.setProperty(MCAST_PORT, "0");
-        localProps.setProperty(LOCATORS, "localhost[" + locatorPort + "]");
-        localProps.setProperty(GROUPS, groupName);
-        localProps.setProperty(USE_CLUSTER_CONFIGURATION, "true");
-        getSystem(localProps);
-        Cache cache = getCache();
-        assertNotNull(cache);
-
-        InternalCache internalCache = (InternalCache) cache;
-        Collection<DiskStore> diskStoreList = internalCache.listDiskStores();
-        assertNotNull(diskStoreList);
-        assertFalse(diskStoreList.isEmpty());
-        assertTrue(diskStoreList.size() == 1);
-
-        for (DiskStore diskStore : diskStoreList) {
-          assertTrue(diskStore.getName().equals(diskStoreName));
-          break;
-        }
-        return null;
-      }
-    });
+    List<Object> diskstoreIDs = gfsh.getCommandResult().getColumnValues("Disk Store ID");
+    assertThat(diskstoreIDs.size()).isEqualTo(1);
 
-    // Test destroying the disk store
-    commandStringBuilder = new CommandStringBuilder(CliStrings.DESTROY_DISK_STORE);
-    commandStringBuilder.addOption(CliStrings.DESTROY_DISK_STORE__NAME, diskStoreName);
-    commandStringBuilder.addOption(CliStrings.GROUP, groupName);
-    cmdResult = executeCommand(commandStringBuilder.toString());
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-
-    // Make sure the disk store was removed from the shared config
-    Host.getHost(0).getVM(0).invoke(new SerializableRunnable() {
-      @Override
-      public void run() {
-        ClusterConfigurationService sharedConfig =
-            ((InternalLocator) Locator.getLocator()).getSharedConfiguration();
-        String xmlFromConfig;
-        try {
-          xmlFromConfig = sharedConfig.getConfiguration(groupName).getCacheXmlContent();
-          assertFalse(xmlFromConfig.contains(diskStoreName));
-        } catch (Exception e) {
-          fail("Error occurred in cluster configuration service", e);
-        }
-      }
-    });
+    gfsh.executeAndAssertThat("revoke missing-disk-store --id=" + diskstoreIDs.get(0))
+        .statusIsSuccess().containsOutput("Missing disk store successfully revoked");
 
+    locator.waitTillRegionsAreReadyOnServers("/" + REGION_1, 1);
 
-    // Restart the cache and make sure it DOES NOT have the diskstore
-    vm = Host.getHost(0).getVM(1);
-    vm.invoke(new SerializableCallable() {
-      @Override
-      public Object call() {
-        getCache().close();
-        Properties localProps = new Properties();
-        localProps.setProperty(MCAST_PORT, "0");
-        localProps.setProperty(LOCATORS, "localhost[" + locatorPort + "]");
-        localProps.setProperty(GROUPS, groupName);
-        localProps.setProperty(USE_CLUSTER_CONFIGURATION, "true");
-        getSystem(localProps);
-        Cache cache = getCache();
-        assertNotNull(cache);
-        InternalCache internalCache = (InternalCache) cache;
-        Collection<DiskStore> diskStores = internalCache.listDiskStores();
-        assertNotNull(diskStores);
-        assertTrue(diskStores.isEmpty());
-        return null;
-      }
+    server1.invoke(() -> {
+      Cache cache = LocatorServerStartupRule.getCache();
+      Region<String, String> r = cache.getRegion(REGION_1);
+      assertThat(r.get("A")).isEqualTo("B");
     });
   }
 
-
-  /**
-   * 1) Create a disk-store in a member, get the disk-dirs. 2) Close the member. 3) Execute the
-   * command. 4) Restart the member. 5) Check if the disk-store is altered.
-   *
-   * @throws IOException
-   * @throws ClassNotFoundException
-   */
   @Test
-  public void testAlterDiskStore() throws ClassNotFoundException, IOException {
-    final String regionName = "region1";
-    final String diskStoreName = "disk-store1";
-    final String diskDirName = "diskStoreDir";
-    final File diskStoreDir = new File(diskDirName);
-    diskStoreDir.deleteOnExit();
-
-    if (!diskStoreDir.exists()) {
-      diskStoreDir.mkdir();
-    }
-
-    final String diskDirPath = diskStoreDir.getCanonicalPath();
-    final VM vm1 = Host.getHost(0).getVM(1);
-
-
-    vm1.invoke(new SerializableCallable() {
-
-      @Override
-      public Object call() throws Exception {
-        getSystem();
-        Region region = createParRegWithPersistence(regionName, diskStoreName, diskDirPath);
-        region.put("a", "QWE");
-        return region.put("b", "ASD");
-      }
-    });
-    // Close the cache and all the connections , so the disk-store can be altered
-    disconnectAllFromDS();
-
-    // Now do the command execution
-    setUpJmxManagerOnVm0ThenConnect(null);
-    Gfsh gfshInstance = Gfsh.getCurrentInstance();
-
-    if (gfshInstance == null) {
-      fail("In testAlterDiskStore command gfshInstance is null");
-    }
-
-    gfshInstance.setDebug(true);
-
-    CommandStringBuilder csb = new CommandStringBuilder(CliStrings.ALTER_DISK_STORE);
-    csb.addOption(CliStrings.ALTER_DISK_STORE__DISKSTORENAME, diskStoreName);
-    csb.addOption(CliStrings.ALTER_DISK_STORE__REGIONNAME, regionName);
-    csb.addOption(CliStrings.ALTER_DISK_STORE__DISKDIRS, diskDirPath);
-    csb.addOption(CliStrings.ALTER_DISK_STORE__CONCURRENCY__LEVEL, "5");
-    csb.addOption(CliStrings.ALTER_DISK_STORE__INITIAL__CAPACITY, "6");
-    csb.addOption(CliStrings.ALTER_DISK_STORE__LRU__EVICTION__ACTION, "local-destroy");
-    csb.addOption(CliStrings.ALTER_DISK_STORE__COMPRESSOR,
-        "org.apache.geode.compression.SnappyCompressor");
-    csb.addOption(CliStrings.ALTER_DISK_STORE__STATISTICS__ENABLED, "true");
-
-    String commandString = csb.getCommandString();
-
-    commandString.trim();
-
-    CommandResult cmdResult = executeCommand(commandString);
-    String resultString = commandResultToString(cmdResult);
-    getLogWriter().info("#SB command output : \n" + resultString);
-    assertEquals(true, Result.Status.OK.equals(cmdResult.getStatus()));
-    assertEquals(true, resultString.contains("concurrencyLevel=5"));
-    assertEquals(true, resultString.contains("lruAction=local-destroy"));
-    assertEquals(true,
-        resultString.contains("compressor=org.apache.geode.compression.SnappyCompressor"));
-    assertEquals(true, resultString.contains("initialCapacity=6"));
-
-    csb = new CommandStringBuilder(CliStrings.ALTER_DISK_STORE);
-    csb.addOption(CliStrings.ALTER_DISK_STORE__DISKSTORENAME, diskStoreName);
-    csb.addOption(CliStrings.ALTER_DISK_STORE__REGIONNAME, regionName);
-    csb.addOption(CliStrings.ALTER_DISK_STORE__DISKDIRS, diskDirPath);
-    csb.addOption(CliStrings.ALTER_DISK_STORE__COMPRESSOR, "none");
-
-    cmdResult = executeCommand(csb.getCommandString().trim());
-    resultString = commandResultToString(cmdResult);
-    assertEquals(true, Result.Status.OK.equals(cmdResult.getStatus()));
-    assertTrue(stringContainsLine(resultString, "-compressor=none"));
-
-    // Alter DiskStore with remove option
-    csb = new CommandStringBuilder(CliStrings.ALTER_DISK_STORE);
-    csb.addOption(CliStrings.ALTER_DISK_STORE__DISKSTORENAME, diskStoreName);
-    csb.addOption(CliStrings.ALTER_DISK_STORE__REGIONNAME, regionName);
-    csb.addOption(CliStrings.ALTER_DISK_STORE__DISKDIRS, diskDirPath);
-    csb.addOption(CliStrings.ALTER_DISK_STORE__REMOVE, "true");
-
-    commandString = csb.getCommandString();
-
-    commandString.trim();
-
-    cmdResult = executeCommand(commandString);
-    resultString = commandResultToString(cmdResult);
-    getLogWriter().info("command output : \n" + resultString);
-    assertEquals(true, Result.Status.OK.equals(cmdResult.getStatus()));
-
-    Object postDestroyValue = vm1.invoke(new SerializableCallable() {
-
-      @Override
-      public Object call() throws Exception {
-        getSystem();
-        Region region = createParRegWithPersistence(regionName, diskStoreName, diskDirPath);
-        return region.get("a");
-      }
-    });
-    assertNull(postDestroyValue);
+  public void testDescribeOfflineDiskStoreCommand() throws Exception {
+    Properties props = new Properties();
+    props.setProperty("groups", GROUP);
+    MemberVM server1 = rule.startServerAsJmxManager(0, props);
 
-    csb = new CommandStringBuilder(CliStrings.ALTER_DISK_STORE);
-    csb.addOption(CliStrings.ALTER_DISK_STORE__DISKSTORENAME, diskStoreName);
-    csb.addOption(CliStrings.ALTER_DISK_STORE__REGIONNAME, regionName);
-    csb.addOption(CliStrings.ALTER_DISK_STORE__DISKDIRS, diskDirPath);
-    csb.addOption(CliStrings.ALTER_DISK_STORE__CONCURRENCY__LEVEL, "5");
-    csb.addOption(CliStrings.ALTER_DISK_STORE__REMOVE, "true");
+    gfsh.connectAndVerify(server1.getJmxPort(), GfshCommandRule.PortType.jmxManager);
 
+    createDiskStoreAndRegion(server1, 1);
 
-    commandString = csb.getCommandString();
-    commandString.trim();
+    server1.invoke(() -> {
+      Cache cache = LocatorServerStartupRule.getCache();
+      Region r = cache.getRegion(REGION_1);
+      r.put("A", "B");
+    });
+
+    gfsh.executeAndAssertThat("show missing-disk-stores")
+        .containsOutput("No missing disk store found");
 
-    cmdResult = executeCommand(commandString);
-    resultString = commandResultToString(cmdResult);
-    getLogWriter().info("Alter DiskStore with wrong remove option  : \n" + resultString);
-    assertEquals(true, Result.Status.ERROR.equals(cmdResult.getStatus()));
+    server1.invoke(LocatorServerStartupRule::stopMemberInThisVM);
 
-    filesToBeDeleted.add(diskDirName);
+    String diskDirs = new File(server1.getWorkingDir(), DISKSTORE).getAbsolutePath();
+    gfsh.executeAndAssertThat(
+        "validate offline-disk-store --name=" + DISKSTORE + " --disk-dirs=" + diskDirs)
+        .statusIsSuccess()
+        .containsOutput("Total number of region entries in this disk store is: 1");
   }
 
   @Test
-  public void testBackupDiskStoreBackup() throws IOException {
-    final String regionName = "region1";
-    final String fullBackUpName = "fullBackUp";
-    final String controllerName = "controller";
-    final String vm1Name = "vm1";
-    final String diskStoreName = "diskStore";
-    final String controllerDiskDirName = "controllerDiskDir";
-    final String vm1DiskDirName = "vm1DiskDir";
-    final String incrementalBackUpName = "incrementalBackUp";
-    final VM manager = Host.getHost(0).getVM(0);
-    final VM vm1 = Host.getHost(0).getVM(1);
-    setUpJmxManagerOnVm0ThenConnect(null);
-
-
-    File controllerDiskDir = new File(controllerDiskDirName);
-    controllerDiskDir.mkdir();
-    final String controllerDiskDirPath = controllerDiskDir.getCanonicalPath();
-    filesToBeDeleted.add(controllerDiskDirPath);
-
-    File vm1DiskDir = new File(vm1DiskDirName);
-    vm1DiskDir.mkdir();
-    final String vm1DiskDirPath = vm1DiskDir.getCanonicalPath();
-    filesToBeDeleted.add(vm1DiskDirPath);
-
-    File fullBackupDir = new File(fullBackUpName);
-    fullBackupDir.mkdir();
-    final String fullBackupDirPath = fullBackupDir.getCanonicalPath();
-    filesToBeDeleted.add(fullBackupDirPath);
-
+  public void testExportOfflineDiskStore() throws Exception {
     Properties props = new Properties();
-    props.setProperty(NAME, controllerName);
+    props.setProperty("groups", GROUP);
+    MemberVM server1 = rule.startServerAsJmxManager(0, props);
 
-    getSystem(props);
+    gfsh.connectAndVerify(server1.getJmxPort(), GfshCommandRule.PortType.jmxManager);
 
-    manager.invoke(new SerializableRunnable() {
-      public void run() {
-        Region region =
-            createParRegWithPersistence(regionName, diskStoreName, controllerDiskDirPath);
-        region.put("A", "1");
-        region.put("B", "2");
-      }
-    });
-
-    vm1.invoke(new SerializableRunnable() {
-      public void run() {
-        Properties localProps = new Properties();
-        localProps.setProperty(NAME, vm1Name);
-        getSystem(localProps);
+    createDiskStoreAndRegion(server1, 1);
 
-        Cache cache = getCache();
-        Region region = createParRegWithPersistence(regionName, diskStoreName, vm1DiskDirPath);
-      }
+    server1.invoke(() -> {
+      Cache cache = LocatorServerStartupRule.getCache();
+      Region r = cache.getRegion(REGION_1);
+      r.put("A", "B");
     });
 
+    gfsh.executeAndAssertThat("show missing-disk-stores")
+        .containsOutput("No missing disk store found");
 
-    CommandStringBuilder csb = new CommandStringBuilder(CliStrings.BACKUP_DISK_STORE);
-    csb.addOption(CliStrings.BACKUP_DISK_STORE__DISKDIRS, fullBackupDirPath);
-    String commandString = csb.toString();
-
-    CommandResult cmdResult = executeCommand(commandString);
-    String resultAsString = commandResultToString(cmdResult);
-    getLogWriter().info("Result from full backup : \n" + resultAsString);
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-    assertEquals(true, resultAsString.contains("Manager"));
-    assertEquals(true, resultAsString.contains(vm1Name));
+    server1.invoke(LocatorServerStartupRule::stopMemberInThisVM);
 
+    String diskDirs = new File(server1.getWorkingDir(), DISKSTORE).getAbsolutePath();
+    File exportDir = tempDir.newFolder();
+    gfsh.executeAndAssertThat("export offline-disk-store --name=" + DISKSTORE + " --disk-dirs="
+        + diskDirs + " --dir=" + exportDir.getAbsolutePath()).statusIsSuccess()
+        .containsOutput("Exported all regions from disk store DISKSTORE");
 
-    vm1.invoke(new SerializableRunnable() {
+    Map<String, String> entries = new HashMap<>();
+    entries.put("A", "B");
+    SnapshotTestUtil.checkSnapshotEntries(exportDir, entries, DISKSTORE, REGION_1);
+  }
 
-      @Override
-      public void run() {
-        Region region = getCache().getRegion(regionName);
-        // Add some data to the region
-        region.put("F", "231");
-        region.put("D", "ew");
-      }
+  private boolean diskStoreExistsInClusterConfig(MemberVM jmxManager) {
+    boolean result = jmxManager.invoke(() -> {
+      ClusterConfigurationService sharedConfig =
+          ((InternalLocator) Locator.getLocator()).getSharedConfiguration();
+      String xmlFromConfig;
+      xmlFromConfig = sharedConfig.getConfiguration(GROUP).getCacheXmlContent();
+      return xmlFromConfig.contains(DISKSTORE);
     });
 
-    File incrementalBackUpDir = new File(incrementalBackUpName);
-    incrementalBackUpDir.mkdir();
+    return result;
+  }
 
-    // Perform an incremental backup
-    final String incrementalBackUpDirPath = incrementalBackUpDir.getCanonicalPath();
-    filesToBeDeleted.add(incrementalBackUpDirPath);
+  @Test
+  public void testCannotDestroyDiskStoreInUse() throws Exception {
+    Properties props = new Properties();
+    props.setProperty("groups", GROUP);
 
-    csb = new CommandStringBuilder(CliStrings.BACKUP_DISK_STORE);
-    csb.addOption(CliStrings.BACKUP_DISK_STORE__DISKDIRS, incrementalBackUpDirPath);
-    csb.addOption(CliStrings.BACKUP_DISK_STORE__BASELINEDIR, fullBackupDirPath);
+    MemberVM locator = rule.startLocatorVM(0);
+    MemberVM server1 = rule.startServerVM(1, props, locator.getPort());
 
-    cmdResult = executeCommand(csb.toString());
-    resultAsString = commandResultToString(cmdResult);
-    getLogWriter().info("Result from incremental backup : \n" + resultAsString);
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
+    gfsh.connectAndVerify(locator);
 
-    assertEquals(true, resultAsString.contains("Manager"));
-    assertEquals(true, resultAsString.contains(vm1Name));
+    createDiskStoreAndRegion(locator, 1);
+
+    gfsh.executeAndAssertThat(
+        String.format("destroy disk-store --name=%s --group=%s", DISKSTORE, GROUP)).statusIsError()
+        .containsOutput("Disk store is currently in use by these regions");
+    assertThat(diskStoreExistsInClusterConfig(locator)).isTrue();
   }
 
-  @Test // FlakyTest: GEODE-1206
-  public void testCreateDiskStore() {
-    final String diskStore1Name = "testCreateDiskStore1";
-    final String diskStore2Name = "testCreateDiskStore2";
-
-    Properties localProps = new Properties();
-    localProps.setProperty(GROUPS, "Group0");
-    setUpJmxManagerOnVm0ThenConnect(localProps);
-
-    CommandResult cmdResult = executeCommand(CliStrings.LIST_DISK_STORE);
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-    assertTrue(commandResultToString(cmdResult).contains("No Disk Stores Found"));
-
-    final VM vm1 = Host.getHost(0).getVM(1);
-    final String vm1Name = "VM" + vm1.getId();
-    final File diskStore1Dir1 = new File(new File(".").getAbsolutePath(), diskStore1Name + ".1");
-    this.filesToBeDeleted.add(diskStore1Dir1.getAbsolutePath());
-    final File diskStore1Dir2 = new File(new File(".").getAbsolutePath(), diskStore1Name + ".2");
-    this.filesToBeDeleted.add(diskStore1Dir2.getAbsolutePath());
-    vm1.invoke(new SerializableRunnable() {
-      public void run() {
-        diskStore1Dir1.mkdirs();
-        diskStore1Dir2.mkdirs();
-
-        Properties localProps = new Properties();
-        localProps.setProperty(NAME, vm1Name);
-        localProps.setProperty(GROUPS, "Group1");
-        getSystem(localProps);
-        getCache();
-      }
-    });
+  @Test
+  public void testDestroyUpdatesSharedConfig() throws Exception {
+    Properties props = new Properties();
+    props.setProperty("groups", GROUP);
 
-    final VM vm2 = Host.getHost(0).getVM(2);
-    final String vm2Name = "VM" + vm2.getId();
-    final File diskStore2Dir = new File(new File(".").getAbsolutePath(), diskStore2Name);
-    this.filesToBeDeleted.add(diskStore2Dir.getAbsolutePath());
-    vm2.invoke(new SerializableRunnable() {
-      public void run() {
-        diskStore2Dir.mkdirs();
-
-        Properties localProps = new Properties();
-        localProps.setProperty(NAME, vm2Name);
-        localProps.setProperty(GROUPS, "Group2");
-        getSystem(localProps);
-        getCache();
-      }
-    });
+    MemberVM locator = rule.startLocatorVM(0);
+    MemberVM server1 = rule.startServerVM(1, props, locator.getPort());
+
+    gfsh.connectAndVerify(locator.getJmxPort(), GfshCommandRule.PortType.jmxManager);
+
+    createDiskStoreAndRegion(locator, 1);
 
-    CommandStringBuilder commandStringBuilder =
-        new CommandStringBuilder(CliStrings.CREATE_DISK_STORE);
-    commandStringBuilder.addOption(CliStrings.CREATE_DISK_STORE__NAME, diskStore1Name);
-    commandStringBuilder.addOption(CliStrings.GROUP, "Group1");
-    commandStringBuilder.addOption(CliStrings.CREATE_DISK_STORE__ALLOW_FORCE_COMPACTION, "true");
-    commandStringBuilder.addOption(CliStrings.CREATE_DISK_STORE__AUTO_COMPACT, "false");
-    commandStringBuilder.addOption(CliStrings.CREATE_DISK_STORE__COMPACTION_THRESHOLD, "67");
-    commandStringBuilder.addOption(CliStrings.CREATE_DISK_STORE__MAX_OPLOG_SIZE, "355");
-    commandStringBuilder.addOption(CliStrings.CREATE_DISK_STORE__QUEUE_SIZE, "5321");
-    commandStringBuilder.addOption(CliStrings.CREATE_DISK_STORE__TIME_INTERVAL, "2023");
-    commandStringBuilder.addOption(CliStrings.CREATE_DISK_STORE__WRITE_BUFFER_SIZE, "3110");
-    commandStringBuilder.addOption(CliStrings.CREATE_DISK_STORE__DIRECTORY_AND_SIZE,
-        diskStore1Dir1.getAbsolutePath() + "#1452637463," + diskStore1Dir2.getAbsolutePath());
-    cmdResult = executeCommand(commandStringBuilder.toString());
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-    String stringResult = commandResultToString(cmdResult);
-    assertEquals(3, countLinesInString(stringResult, false));
-    assertEquals(false, stringResult.contains("ERROR"));
-    assertTrue(stringContainsLine(stringResult, vm1Name + ".*Success"));
-
-    // Verify that the disk store was created on the correct member
-    cmdResult = executeCommand(CliStrings.LIST_DISK_STORE);
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-    stringResult = commandResultToString(cmdResult);
-    assertEquals(3, countLinesInString(stringResult, false));
-    assertTrue(stringContainsLine(stringResult, vm1Name + ".*" + diskStore1Name + " .*"));
-    assertFalse(stringContainsLine(stringResult, vm2Name + ".*" + diskStore1Name + " .*"));
-
-    // Verify that the disk store files were created in the correct directory.
-    assertEquals(diskStore1Dir1.listFiles().length, 2);
-
-    // Verify that all of the attributes of the disk store were set correctly.
-    commandStringBuilder = new CommandStringBuilder(CliStrings.DESCRIBE_DISK_STORE);
-    commandStringBuilder.addOption(CliStrings.MEMBER, vm1Name);
-    commandStringBuilder.addOption(CliStrings.DESCRIBE_DISK_STORE__NAME, diskStore1Name);
-    cmdResult = executeCommand(commandStringBuilder.toString());
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-    stringResult = commandResultToString(cmdResult);
-    assertTrue(stringContainsLine(stringResult, "Allow Force Compaction.*Yes"));
-    assertTrue(stringContainsLine(stringResult, "Auto Compaction.*No"));
-    assertTrue(stringContainsLine(stringResult, "Compaction Threshold.*67"));
-    assertTrue(stringContainsLine(stringResult, "Max Oplog Size.*355"));
-    assertTrue(stringContainsLine(stringResult, "Queue Size.*5321"));
-    assertTrue(stringContainsLine(stringResult, "Time Interval.*2023"));
-    assertTrue(stringContainsLine(stringResult, "Write Buffer Size.*3110"));
-    assertTrue(stringContainsLine(stringResult, ".*" + diskStore1Name + ".1 .*1452637463"));
-    assertTrue(
-        stringContainsLine(stringResult, ".*" + diskStore1Name + ".2 .*" + Integer.MAX_VALUE));
-
-    commandStringBuilder = new CommandStringBuilder(CliStrings.CREATE_DISK_STORE);
-    commandStringBuilder.addOption(CliStrings.CREATE_DISK_STORE__NAME, diskStore2Name);
-    commandStringBuilder.addOption(CliStrings.GROUP, "Group2");
-    commandStringBuilder.addOption(CliStrings.CREATE_DISK_STORE__DIRECTORY_AND_SIZE,
-        diskStore2Dir.getAbsolutePath());
-    cmdResult = executeCommand(commandStringBuilder.toString());
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-    stringResult = commandResultToString(cmdResult);
-    assertEquals(3, countLinesInString(stringResult, false));
-    assertTrue(stringContainsLine(stringResult, vm2Name + ".*Success"));
-
-    // Verify that the second disk store was created correctly.
-    cmdResult = executeCommand(CliStrings.LIST_DISK_STORE);
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-    stringResult = commandResultToString(cmdResult);
-    assertEquals(4, countLinesInString(stringResult, false));
-    assertTrue(stringContainsLine(stringResult, vm1Name + ".*" + diskStore1Name + " .*"));
-    assertFalse(stringContainsLine(stringResult, vm2Name + ".*" + diskStore1Name + " .*"));
-    assertFalse(stringContainsLine(stringResult, vm1Name + ".*" + diskStore2Name + " .*"));
-    assertTrue(stringContainsLine(stringResult, vm2Name + ".*" + diskStore2Name + " .*"));
+    gfsh.executeAndAssertThat("destroy region --name=" + REGION_1).statusIsSuccess();
+    gfsh.executeAndAssertThat(
+        String.format("destroy disk-store --name=%s --group=%s", DISKSTORE, GROUP))
+        .statusIsSuccess();
+    assertThat(diskStoreExistsInClusterConfig(locator)).isFalse();
   }
 
   @Test
-  public void testDestroyDiskStore() {
-    final String diskStore1Name = "testDestroyDiskStore1";
-    final String diskStore2Name = "testDestroyDiskStore2";
-    final String region1Name = "testDestroyDiskStoreRegion1";
-    final String region2Name = "testDestroyDiskStoreRegion2";
-
-    Properties localProps = new Properties();
-    localProps.setProperty(GROUPS, "Group0");
-    setUpJmxManagerOnVm0ThenConnect(localProps);
-
-    CommandResult cmdResult = executeCommand(CliStrings.LIST_DISK_STORE);
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-    assertTrue(commandResultToString(cmdResult).contains("No Disk Stores Found"));
-
-    final VM vm1 = Host.getHost(0).getVM(1);
-    final String vm1Name = "VM" + vm1.getId();
-    final File diskStore1Dir1 = new File(new File(".").getAbsolutePath(), diskStore1Name + ".1");
-    this.filesToBeDeleted.add(diskStore1Dir1.getAbsolutePath());
-    final File diskStore2Dir1 = new File(new File(".").getAbsolutePath(), diskStore2Name + ".1");
-    this.filesToBeDeleted.add(diskStore2Dir1.getAbsolutePath());
-    vm1.invoke(new SerializableRunnable() {
-      public void run() {
-        diskStore1Dir1.mkdirs();
-        diskStore2Dir1.mkdirs();
-
-        Properties localProps = new Properties();
-        localProps.setProperty(NAME, vm1Name);
-        localProps.setProperty(GROUPS, "Group1,Group2");
-        getSystem(localProps);
-        Cache cache = getCache();
-
-        DiskStoreFactory diskStoreFactory = cache.createDiskStoreFactory();
-        diskStoreFactory.setDiskDirs(new File[] {diskStore1Dir1});
-        diskStoreFactory.create(diskStore1Name);
-
-        diskStoreFactory.setDiskDirs(new File[] {diskStore2Dir1});
-        diskStoreFactory.create(diskStore2Name);
-      }
-    });
+  public void testAlterDiskStore() throws Exception {
+    Properties props = new Properties();
+    props.setProperty("groups", GROUP);
+    MemberVM locator = rule.startLocatorVM(0);
+    MemberVM server1 = rule.startServerVM(1, props, locator.getPort());
 
-    final VM vm2 = Host.getHost(0).getVM(2);
-    final String vm2Name = "VM" + vm2.getId();
-    final File diskStore1Dir2 = new File(new File(".").getAbsolutePath(), diskStore1Name + ".2");
-    this.filesToBeDeleted.add(diskStore1Dir2.getAbsolutePath());
-    final File diskStore2Dir2 = new File(new File(".").getAbsolutePath(), diskStore2Name + ".2");
-    this.filesToBeDeleted.add(diskStore2Dir2.getAbsolutePath());
-    vm2.invoke(new SerializableRunnable() {
-      public void run() {
-        diskStore1Dir2.mkdirs();
-        diskStore2Dir2.mkdirs();
-
-        Properties localProps = new Properties();
-        localProps.setProperty(NAME, vm2Name);
-        localProps.setProperty(GROUPS, "Group2");
-        getSystem(localProps);
-        Cache cache = getCache();
-
-        DiskStoreFactory diskStoreFactory = cache.createDiskStoreFactory();
-        diskStoreFactory.setDiskDirs(new File[] {diskStore1Dir2});
-        diskStoreFactory.create(diskStore1Name);
-
-        RegionFactory regionFactory = cache.createRegionFactory();
-        regionFactory.setDiskStoreName(diskStore1Name);
-        regionFactory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
-        regionFactory.create(region1Name);
-        regionFactory.create(region2Name);
-
-        diskStoreFactory.setDiskDirs(new File[] {diskStore2Dir2});
-        diskStoreFactory.create(diskStore2Name);
-      }
-    });
+    gfsh.connectAndVerify(locator);
 
-    // TEST DELETING ON 1 MEMBER
-
-    CommandStringBuilder commandStringBuilder =
-        new CommandStringBuilder(CliStrings.DESTROY_DISK_STORE);
-    commandStringBuilder.addOption(CliStrings.DESTROY_DISK_STORE__NAME, diskStore1Name);
-    commandStringBuilder.addOption(CliStrings.GROUP, "Group1");
-    cmdResult = executeCommand(commandStringBuilder.toString());
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-    String stringResult = commandResultToString(cmdResult);
-    assertEquals(3, countLinesInString(stringResult, false));
-    assertEquals(false, stringResult.contains("ERROR"));
-    assertTrue(stringContainsLine(stringResult, vm1Name + ".*Success"));
-
-    // Verify that the disk store was destroyed on the correct member
-    cmdResult = executeCommand(CliStrings.LIST_DISK_STORE);
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-    stringResult = commandResultToString(cmdResult);
-    assertEquals(5, countLinesInString(stringResult, false));
-    assertFalse(stringContainsLine(stringResult, vm1Name + ".*" + diskStore1Name + " .*"));
-    assertTrue(stringContainsLine(stringResult, vm2Name + ".*" + diskStore1Name + " .*"));
-
-    // Verify that the disk store files were deleted from the correct directory.
-    assertEquals(0, diskStore1Dir1.listFiles().length);
-    assertEquals(4, diskStore1Dir2.listFiles().length);
-
-    // TEST DELETING ON 2 MEMBERS
-
-    commandStringBuilder = new CommandStringBuilder(CliStrings.DESTROY_DISK_STORE);
-    commandStringBuilder.addOption(CliStrings.DESTROY_DISK_STORE__NAME, diskStore2Name);
-    commandStringBuilder.addOption(CliStrings.GROUP, "Group2");
-    cmdResult = executeCommand(commandStringBuilder.toString());
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-    stringResult = commandResultToString(cmdResult);
-    assertEquals(4, countLinesInString(stringResult, false));
-    assertEquals(false, stringResult.contains("ERROR"));
-    assertTrue(stringContainsLine(stringResult, vm1Name + ".*Success"));
-    assertTrue(stringContainsLine(stringResult, vm2Name + ".*Success"));
-
-    // Verify that the disk store was destroyed on the correct member
-    cmdResult = executeCommand(CliStrings.LIST_DISK_STORE);
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-    stringResult = commandResultToString(cmdResult);
-    assertEquals(3, countLinesInString(stringResult, false));
-    assertFalse(stringContainsLine(stringResult, vm1Name + ".*" + diskStore2Name + " .*"));
-    assertFalse(stringContainsLine(stringResult, vm2Name + ".*" + diskStore2Name + " .*"));
-
-    // Verify that the disk store files were deleted from the correct directories.
-    assertEquals(0, diskStore2Dir1.listFiles().length);
-    assertEquals(0, diskStore2Dir2.listFiles().length);
-
-    // TEST FOR DISK STORE IN USE
-
-    commandStringBuilder = new CommandStringBuilder(CliStrings.DESTROY_DISK_STORE);
-    commandStringBuilder.addOption(CliStrings.DESTROY_DISK_STORE__NAME, diskStore1Name);
-    commandStringBuilder.addOption(CliStrings.GROUP, "Group2");
-    cmdResult = executeCommand(commandStringBuilder.toString());
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-    stringResult = commandResultToString(cmdResult);
-    assertEquals(4, countLinesInString(stringResult, false));
-    assertEquals(false, stringResult.contains("ERROR"));
-    assertTrue(stringContainsLine(stringResult, vm1Name + ".*Disk store not found on this member"));
-    assertTrue(
-        stringContainsLine(stringResult, vm2Name + ".*" + region1Name + ".*" + region2Name + ".*"));
-
-    // TEST DELETING ON ALL MEMBERS
-
-    vm2.invoke(new SerializableRunnable() {
-      public void run() {
-        Cache cache = getCache();
-
-        Region region = cache.getRegion(region1Name);
-        region.destroyRegion();
-
-        region = cache.getRegion(region2Name);
-        region.destroyRegion();
-      }
-    });
+    createDiskStoreAndRegion(locator, 1);
 
-    commandStringBuilder = new CommandStringBuilder(CliStrings.DESTROY_DISK_STORE);
-    commandStringBuilder.addOption(CliStrings.DESTROY_DISK_STORE__NAME, diskStore1Name);
-    cmdResult = executeCommand(commandStringBuilder.toString());
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-    stringResult = commandResultToString(cmdResult);
-    assertEquals(5, countLinesInString(stringResult, false));
-    assertEquals(false, stringResult.contains("ERROR"));
-    assertTrue(stringContainsLine(stringResult, "Manager.*Disk store not found on this member"));
-    assertTrue(stringContainsLine(stringResult, vm1Name + ".*Disk store not found on this member"));
-    assertTrue(stringContainsLine(stringResult, vm2Name + ".*Success"));
-
-    // Verify that there are no disk stores left.
-    cmdResult = executeCommand(CliStrings.LIST_DISK_STORE);
-    assertEquals(Result.Status.OK, cmdResult.getStatus());
-    assertTrue(commandResultToString(cmdResult).contains("No Disk Stores Found"));
-
-    // Verify that the disk store files were deleted from the correct directory.
-    assertEquals(0, diskStore1Dir2.listFiles().length);
-  }
+    String diskDirs = new File(server1.getWorkingDir(), DISKSTORE).getAbsolutePath();
+    gfsh.executeAndAssertThat(
+        String.format("alter disk-store --name=%s --region=%s --disk-dirs=%s --concurrency-level=5",
+            DISKSTORE, REGION_1, diskDirs))
+        .statusIsError().containsOutput("Could not lock");
 
-  private Region<?, ?> createParRegWithPersistence(String regionName, String diskStoreName,
-      String diskDirName) {
-    Cache cache = getCache();
-    File diskStoreDirFile = new File(diskDirName);
-
-    if (!diskStoreDirFile.exists()) {
-      diskStoreDirFile.mkdirs();
-    }
-
-    DiskStoreFactory diskStoreFactory = cache.createDiskStoreFactory();
-    diskStoreFactory.setDiskDirs(new File[] {diskStoreDirFile});
-    diskStoreFactory.setMaxOplogSize(1);
-    diskStoreFactory.setAllowForceCompaction(true);
-    diskStoreFactory.setAutoCompact(false);
-    diskStoreFactory.create(diskStoreName);
-
-    /*
-     * Eviction Attributes
-     */
-    EvictionAttributes ea =
-        EvictionAttributes.createLRUEntryAttributes(1, EvictionAction.OVERFLOW_TO_DISK);
-
-    RegionFactory regionFactory = cache.createRegionFactory();
-    regionFactory.setDiskStoreName(diskStoreName);
-    regionFactory.setDiskSynchronous(true);
-    regionFactory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE);
-    regionFactory.setScope(Scope.DISTRIBUTED_ACK);
-    regionFactory.setEvictionAttributes(ea);
-
-    return regionFactory.create(regionName);
-  }
+    server1.invoke(LocatorServerStartupRule::stopMemberInThisVM);
 
-  @Override
-  protected final void preTearDownCliCommandTestBase() throws Exception {
-    try {
-      deleteFiles();
-    } catch (IOException ex) {
-      // This sometimes throws a DirectoryNotEmptyException. The only reason I can see for this is
-      // that additional
-      // files are being written into the directory while it is being deleted (recursively). So
-      // let's just try one more
-      // time.
-      try {
-        deleteFiles();
-      } catch (IOException e) {
-        getLogWriter().error("Unable to delete file", e);
-      }
-    }
-    this.filesToBeDeleted.clear();
+    gfsh.executeAndAssertThat(String.format(
+        "alter disk-store --name=%s --region=%s --disk-dirs=%s --concurrency-level=5 --initial-capacity=6 --lru-action=local-destroy --compressor=%s --enable-statistics=true",
+        DISKSTORE, REGION_1, diskDirs, SnappyCompressor.class.getName())).statusIsSuccess()
+        .containsOutput("concurrencyLevel=16", "concurrencyLevel=5", "initialCapacity=16",
+            "initialCapacity=6", "lruAction=overflow-to-disk", "lruAction=local-destroy",
+            "compressor=none", "compressor=" + SnappyCompressor.class.getName(),
+            "statisticsEnabled=false", "statisticsEnabled=true");
   }
 
-  private void deleteFiles() throws IOException {
-    for (String path : this.filesToBeDeleted) {
-      FileUtils.deleteDirectory(new File(path));
-    }
+  @Test
+  public void testBackupDiskStore() throws Exception {
+    Properties props = new Properties();
+    props.setProperty("groups", GROUP);
+    MemberVM locator = rule.startLocatorVM(0);
+    MemberVM server1 = rule.startServerVM(1, props, locator.getPort());
+
+    gfsh.connectAndVerify(locator);
 
+    createDiskStoreAndRegion(locator, 1);
+
+    server1.invoke(() -> {
+      Cache cache = LocatorServerStartupRule.getCache();
+      Region r = cache.getRegion(REGION_1);
+      r.put("A", "B");
+    });
+
+    String backupDir = tempDir.newFolder().getCanonicalPath();
+    String diskDirs = new File(server1.getWorkingDir(), DISKSTORE).getAbsolutePath();
+    gfsh.executeAndAssertThat(
+        String.format("backup disk-store --dir=%s --baseline-dir=%s", diskDirs, backupDir))
+        .statusIsSuccess()
+        .tableHasColumnWithExactValuesInAnyOrder("Member", "locator-0", "server-1");
   }
+
 }
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/LocatorServerStartupRule.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/LocatorServerStartupRule.java
index ca55d8e..ff68361 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/LocatorServerStartupRule.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/LocatorServerStartupRule.java
@@ -218,6 +218,40 @@ public class LocatorServerStartupRule extends ExternalResource implements Serial
     return setMember(index, new MemberVM(server, serverVM, useTempWorkingDir()));
   }
 
+  public void startServerVMAsync(int index) {
+    startServerVMAsync(index, new Properties(), -1);
+  }
+
+  public void startServerVMAsync(int index, int locatorPort) {
+    startServerVMAsync(index, new Properties(), locatorPort);
+  }
+
+  public void startServerVMAsync(int index, Properties specifiedProperties, int locatorPort) {
+    assert members.get(index) != null;
+
+    Properties properties = new Properties();
+    properties.putAll(specifiedProperties);
+
+    String defaultName = "server-" + index;
+    properties.putIfAbsent(NAME, defaultName);
+    String name = properties.getProperty(NAME);
+
+    VM serverVM = getVM(index);
+    serverVM.invokeAsync(() -> {
+      memberStarter = new ServerStarterRule();
+      ServerStarterRule serverStarter = (ServerStarterRule) memberStarter;
+      if (useTempWorkingDir()) {
+        File workingDirFile = createWorkingDirForMember(name);
+        serverStarter.withWorkingDir(workingDirFile);
+      }
+      if (logFile) {
+        serverStarter.withLogFile();
+      }
+      serverStarter.withProperties(properties).withConnectionToLocator(locatorPort).withAutoStart();
+      serverStarter.before();
+    });
+  }
+
   public MemberVM startServerAsJmxManager(int index) throws IOException {
     return startServerAsJmxManager(index, new Properties());
   }
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/MemberVM.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/MemberVM.java
index bedd65a..0e9cfbc 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/MemberVM.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/MemberVM.java
@@ -132,4 +132,9 @@ public class MemberVM implements Member {
           serverCount);
     });
   }
+
+  public void waitTillDiskstoreIsReady(String diskstoreName, int serverCount) {
+    vm.invoke(() -> LocatorServerStartupRule.memberStarter.waitTillDiskStoreIsReady(diskstoreName,
+        serverCount));
+  }
 }
diff --git a/geode-core/src/test/java/org/apache/geode/test/junit/assertions/CommandResultAssert.java b/geode-core/src/test/java/org/apache/geode/test/junit/assertions/CommandResultAssert.java
index 97c72dc..51a6821 100644
--- a/geode-core/src/test/java/org/apache/geode/test/junit/assertions/CommandResultAssert.java
+++ b/geode-core/src/test/java/org/apache/geode/test/junit/assertions/CommandResultAssert.java
@@ -17,6 +17,7 @@ package org.apache.geode.test.junit.assertions;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.util.Arrays;
+import java.util.List;
 
 import org.assertj.core.api.AbstractAssert;
 import org.assertj.core.api.Assertions;
@@ -131,15 +132,7 @@ public class CommandResultAssert
    */
   public CommandResultAssert tableHasColumnWithExactValuesInExactOrder(String header,
       Object... expectedValues) {
-    GfJsonObject resultContentJSON = actual.getCommandResult().getContent();
-    Object content = getColumnContent(header, resultContentJSON);
-
-    if (content == null) {
-      failWithMessage(
-          "Command result did not contain <" + header + ">: " + resultContentJSON.toString());
-    }
-
-    Object[] actualValues = toArray((JSONArray) content);
+    List<Object> actualValues = actual.getCommandResult().getColumnValues(header);
     assertThat(actualValues).containsExactly(expectedValues);
 
     return this;
@@ -167,15 +160,7 @@ public class CommandResultAssert
    */
   public CommandResultAssert tableHasColumnWithExactValuesInAnyOrder(String header,
       Object... expectedValues) {
-    GfJsonObject resultContentJSON = actual.getCommandResult().getContent();
-    Object content = getColumnContent(header, resultContentJSON);
-
-    if (content == null) {
-      failWithMessage("Command result did not contain a table with column header <" + header + ">: "
-          + resultContentJSON.toString());
-    }
-
-    Object[] actualValues = toArray((JSONArray) content);
+    List<Object> actualValues = actual.getCommandResult().getColumnValues(header);
     assertThat(actualValues).containsExactlyInAnyOrder(expectedValues);
 
     return this;
@@ -187,15 +172,7 @@ public class CommandResultAssert
    */
   public CommandResultAssert tableHasColumnWithValuesContaining(String header,
       String... expectedValues) {
-    GfJsonObject resultContentJSON = actual.getCommandResult().getContent();
-    Object content = getColumnContent(header, resultContentJSON);
-
-    if (content == null) {
-      failWithMessage("Command result did not contain a table with column header <" + header + ">: "
-          + resultContentJSON.toString());
-    }
-
-    Object[] actualValues = toArray((JSONArray) content);
+    List<Object> actualValues = actual.getCommandResult().getColumnValues(header);
 
     for (Object actualValue : actualValues) {
       String actualValueString = (String) actualValue;
@@ -210,36 +187,15 @@ public class CommandResultAssert
     return this;
   }
 
-
   /**
    * Verifies that each of the actual values in the column with the given header contains at least
    * one of the expectedValues.
    */
   public CommandResultAssert tableHasColumnOnlyWithValues(String header, String... expectedValues) {
-    GfJsonObject resultContentJSON = actual.getCommandResult().getContent();
-    Object content = getColumnContent(header, resultContentJSON);
-
-    if (content == null) {
-      failWithMessage("Command result did not contain a table with column header <" + header + ">: "
-          + resultContentJSON.toString());
-    }
-
-    Object[] actualValues = toArray((JSONArray) content);
+    List<Object> actualValues = actual.getCommandResult().getColumnValues(header);
     assertThat(actualValues).containsOnly(expectedValues);
-    return this;
-  }
 
-  private Object getColumnContent(String header, GfJsonObject resultContentJSON) {
-    if (resultContentJSON.get(header) != null) {
-      return resultContentJSON.get(header);
-    }
-    try {
-      // Sometimes, the output is buried in a most questionable way.
-      return resultContentJSON.getJSONObject("__sections__-0").getJSONObject("__tables__-0")
-          .getJSONObject("content").get(header);
-    } catch (NullPointerException ignored) {
-    }
-    return null;
+    return this;
   }
 
   public CommandResultAssert hasResult() {
diff --git a/geode-core/src/test/java/org/apache/geode/test/junit/rules/GfshCommandRule.java b/geode-core/src/test/java/org/apache/geode/test/junit/rules/GfshCommandRule.java
index 3583684..dd1a453 100644
--- a/geode-core/src/test/java/org/apache/geode/test/junit/rules/GfshCommandRule.java
+++ b/geode-core/src/test/java/org/apache/geode/test/junit/rules/GfshCommandRule.java
@@ -77,6 +77,7 @@ public class GfshCommandRule extends DescribedExternalResource {
   private IgnoredException ignoredException;
   private TemporaryFolder temporaryFolder = new TemporaryFolder();
   private File workingDir;
+  private CommandResult commandResult;
 
   public GfshCommandRule() {
     try {
@@ -235,11 +236,12 @@ public class GfshCommandRule extends DescribedExternalResource {
       }
     }
     System.out.println("Command result for <" + command + ">: \n" + gfsh.outputString);
+    commandResult = result;
     return result;
   }
 
   public CommandResultAssert executeAndAssertThat(String command) {
-    CommandResult commandResult = executeCommand(command);
+    commandResult = executeCommand(command);
     return new CommandResultAssert(gfsh.outputString, commandResult);
   }
 
@@ -265,4 +267,8 @@ public class GfshCommandRule extends DescribedExternalResource {
   public enum PortType {
     locator, jmxManager, http
   }
+
+  public CommandResult getCommandResult() {
+    return commandResult;
+  }
 }
diff --git a/geode-core/src/test/java/org/apache/geode/test/junit/rules/MemberStarterRule.java b/geode-core/src/test/java/org/apache/geode/test/junit/rules/MemberStarterRule.java
index 722a4c4..da0f588 100644
--- a/geode-core/src/test/java/org/apache/geode/test/junit/rules/MemberStarterRule.java
+++ b/geode-core/src/test/java/org/apache/geode/test/junit/rules/MemberStarterRule.java
@@ -28,9 +28,11 @@ import static org.awaitility.Awaitility.await;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.Map;
 import java.util.Properties;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.commons.lang.ArrayUtils;
 import org.junit.rules.TemporaryFolder;
 
 import org.apache.geode.distributed.DistributedSystem;
@@ -39,6 +41,7 @@ import org.apache.geode.internal.AvailablePortHelper;
 import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.net.SocketCreatorFactory;
 import org.apache.geode.management.DistributedRegionMXBean;
+import org.apache.geode.management.DistributedSystemMXBean;
 import org.apache.geode.management.ManagementService;
 import org.apache.geode.security.SecurityManager;
 import org.apache.geode.test.junit.rules.serializable.SerializableExternalResource;
@@ -241,11 +244,25 @@ public abstract class MemberStarterRule<T> extends SerializableExternalResource
   public abstract InternalCache getCache();
 
   public void waitTillRegionIsReadyOnServers(String regionName, int serverCount) {
-    await().atMost(2, TimeUnit.SECONDS).until(() -> getRegionMBean(regionName) != null);
-    await().atMost(2, TimeUnit.SECONDS)
+    await().atMost(30, TimeUnit.SECONDS).until(() -> getRegionMBean(regionName) != null);
+    await().atMost(30, TimeUnit.SECONDS)
         .until(() -> getRegionMBean(regionName).getMembers().length == serverCount);
   }
 
+  private long getDiskStoreCount(String diskStoreName) {
+    DistributedSystemMXBean dsMXBean = getManagementService().getDistributedSystemMXBean();
+    Map<String, String[]> diskstores = dsMXBean.listMemberDiskstore();
+    long count =
+        diskstores.values().stream().filter(x -> ArrayUtils.contains(x, diskStoreName)).count();
+
+    return count;
+  }
+
+  public void waitTillDiskStoreIsReady(String diskstoreName, int serverCount) {
+    await().atMost(30, TimeUnit.SECONDS)
+        .until(() -> getDiskStoreCount(diskstoreName) == serverCount);
+  }
+
   abstract void stopMember();
 
   @Override
diff --git a/geode-web/src/test/java/org/apache/geode/management/internal/cli/commands/CommandOverHttpDUnitTest.java b/geode-web/src/test/java/org/apache/geode/management/internal/cli/commands/CommandOverHttpDUnitTest.java
index 5334e10..4073b00 100644
--- a/geode-web/src/test/java/org/apache/geode/management/internal/cli/commands/CommandOverHttpDUnitTest.java
+++ b/geode-web/src/test/java/org/apache/geode/management/internal/cli/commands/CommandOverHttpDUnitTest.java
@@ -29,7 +29,7 @@ import org.apache.geode.test.junit.runners.SuiteRunner;
  */
 @Category({DistributedTest.class, SecurityTest.class})
 @RunWith(SuiteRunner.class)
-@Suite.SuiteClasses({DiskStoreCommandsDUnitTest.class, GemfireDataCommandsDUnitTest.class,
+@Suite.SuiteClasses({GemfireDataCommandsDUnitTest.class,
     ListAndDescribeDiskStoreCommandsDUnitTest.class, QueueCommandsDUnitTest.class,
     ShellCommandsDUnitTest.class, ShowStackTraceDUnitTest.class})
 public class CommandOverHttpDUnitTest {

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <commits@geode.apache.org>'].

Mime
View raw message