diff --git a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestHelper.java b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestHelper.java
index 0804126..5661258 100644
--- a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestHelper.java
+++ b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestHelper.java
@@ -18,7 +18,18 @@
  */
 package org.apache.asterix.test.common;
 
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Enumeration;
 import java.util.List;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import org.apache.commons.compress.utils.IOUtils;
+import org.apache.commons.lang3.StringUtils;
 
 public final class TestHelper {
 
@@ -31,4 +42,34 @@
         return false;
     }
 
+    public static String joinPath(String... pathElements) {
+        return StringUtils.join(pathElements, File.separatorChar);
+    }
+
+    public static void unzip(String sourceFile, String outputDir) throws IOException {
+        if (System.getProperty("os.name").toLowerCase().startsWith("win")) {
+            try (ZipFile zipFile = new ZipFile(sourceFile)) {
+                Enumeration<? extends ZipEntry> entries = zipFile.entries();
+                while (entries.hasMoreElements()) {
+                    ZipEntry entry = entries.nextElement();
+                    File entryDestination = new File(outputDir,  entry.getName());
+                    if (!entry.isDirectory()) {
+                        entryDestination.getParentFile().mkdirs();
+                        try (InputStream in = zipFile.getInputStream(entry);
+                             OutputStream out = new FileOutputStream(entryDestination)) {
+                            IOUtils.copy(in, out);
+                        }
+                    }
+                }
+            }
+        } else {
+            Process process = new ProcessBuilder("unzip", "-d", outputDir, sourceFile).start();
+            try {
+                process.waitFor();
+            } catch (InterruptedException e) {
+                Thread.currentThread().interrupt();
+                throw new IOException(e);
+            }
+        }
+    }
 }
diff --git a/asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/SampleLocalClusterIT.java b/asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/SampleLocalClusterIT.java
new file mode 100644
index 0000000..e98262a
--- /dev/null
+++ b/asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/SampleLocalClusterIT.java
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.asterix.server.test;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.net.URL;
+import java.util.Collections;
+import java.util.logging.Logger;
+
+import org.apache.asterix.common.utils.ServletUtil.Servlets;
+import org.apache.asterix.test.aql.TestExecutor;
+import org.apache.asterix.test.common.TestHelper;
+import org.apache.asterix.testframework.context.TestCaseContext.OutputFormat;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+import static org.apache.asterix.test.common.TestHelper.joinPath;
+
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+public class SampleLocalClusterIT {
+
+    // Important paths and files for this test.
+
+    // The "target" subdirectory of asterix-server. All outputs go here.
+    private static final String TARGET_DIR = joinPath(/*System.getProperty("basedir"),*/ "target");
+
+    // Directory where the NCs create and store all data, as configured by
+    // src/test/resources/NCServiceExecutionIT/cc.conf.
+    private static final String OUTPUT_DIR = joinPath(TARGET_DIR, "sample-local-cluster");
+
+    private static final String LOCAL_SAMPLES_DIR = joinPath(OUTPUT_DIR, "samples", "local");
+
+    private static final Logger LOGGER = Logger.getLogger(SampleLocalClusterIT.class.getName());
+
+    @BeforeClass
+    public static void setUp() throws Exception {
+        // Create actual-results output directory.
+        File outDir = new File(OUTPUT_DIR);
+
+        // Remove any instance data from previous runs.
+        if (outDir.isDirectory()) {
+            FileUtils.deleteDirectory(outDir);
+        }
+        outDir.mkdirs();
+
+        String installerZip = joinPath(TARGET_DIR,
+                new File(TARGET_DIR).list((dir, name) -> name.matches("asterix-server.*-binary-assembly.zip"))[0]);
+
+        TestHelper.unzip(installerZip, OUTPUT_DIR);
+    }
+
+    @Test
+    public void test0_startCluster() throws Exception {
+        Process process = new ProcessBuilder(joinPath(LOCAL_SAMPLES_DIR, "bin/start-sample-cluster.sh"))
+                .inheritIO().start();
+        Assert.assertEquals(process.waitFor(), 0);
+    }
+
+    @Test
+    public void test1_sanityQuery() throws Exception {
+        TestExecutor testExecutor = new TestExecutor();
+        InputStream resultStream = testExecutor.executeQuery("1+1", OutputFormat.ADM,
+                "http://127.0.0.1:19002" + Servlets.AQL_QUERY.getPath(), Collections.emptyList());
+        StringWriter sw = new StringWriter();
+        IOUtils.copy(resultStream, sw);
+        Assert.assertEquals(sw.toString().trim(), "2");
+    }
+
+    @Test
+    public void test2_stopCluster() throws Exception {
+        Process process = new ProcessBuilder(joinPath(LOCAL_SAMPLES_DIR, "bin/stop-sample-cluster.sh"))
+                .inheritIO().start();
+        Assert.assertEquals(process.waitFor(), 0);
+        try {
+            new URL("http://127.0.0.1:19002").openConnection().connect();
+            Assert.assertTrue("Expected connection to be refused.", false);
+        } catch (IOException e) {
+            // expected
+        }
+    }
+}
