accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [24/50] [abbrv] ACCUMULO-1537 completed the conversion of functional tests to IT; also converted ShellServerTest to an IT
Date Wed, 17 Jul 2013 02:33:26 GMT
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java b/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
index f0cdd01..227bed8 100644
--- a/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
@@ -72,7 +72,7 @@ public class TableOperationsIT {
     connector = accumuloCluster.getConnector(ROOT, ROOT_PASS);
   }
   
-  @Test
+  @Test(timeout=30*1000)
   public void getDiskUsageErrors() throws TableExistsException, AccumuloException, AccumuloSecurityException, TableNotFoundException, TException {
     connector.tableOperations().create("table1");
     List<DiskUsage> diskUsage = connector.tableOperations().getDiskUsage(Collections.singleton("table1"));
@@ -93,7 +93,7 @@ public class TableOperationsIT {
     } catch (TableNotFoundException e) {}
   }
   
-  @Test
+  @Test(timeout=30*1000)
   public void getDiskUsage() throws TableExistsException, AccumuloException, AccumuloSecurityException, TableNotFoundException, TException {
     
     connector.tableOperations().create("table1");
@@ -148,7 +148,7 @@ public class TableOperationsIT {
     connector.tableOperations().delete("table1");
   }
   
-  @Test
+  @Test(timeout=30*1000)
   public void createTable() throws TableExistsException, AccumuloException, AccumuloSecurityException, TableNotFoundException {
     connector.tableOperations().create("table1");
     Iterable<Map.Entry<String,String>> itrProps = connector.tableOperations().getProperties("table1");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/BinaryIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/BinaryIT.java b/test/src/test/java/org/apache/accumulo/test/functional/BinaryIT.java
index fb28715..e225073 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/BinaryIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/BinaryIT.java
@@ -28,7 +28,7 @@ import org.junit.Test;
 
 public class BinaryIT extends MacTest {
   
-  @Test
+  @Test(timeout=30*1000)
   public void test() throws Exception {
     Connector c = getConnector();
     c.tableOperations().create("bt");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/BloomFilterIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/BloomFilterIT.java b/test/src/test/java/org/apache/accumulo/test/functional/BloomFilterIT.java
index d222991..9e8e5d3 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/BloomFilterIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/BloomFilterIT.java
@@ -49,15 +49,15 @@ public class BloomFilterIT extends MacTest {
     cfg.setDefaultMemory(500, MemoryUnit.MEGABYTE);
   }
   
-  @Test(timeout=500*1000)
+  @Test(timeout=200*1000)
   public void test() throws Exception {
     Connector c = getConnector();
     for (String table : "bt1 bt2 bt3 bt4".split(" ")) {
       c.tableOperations().create(table);
     }
-    write(c, "bt1", 1, 0, 1000000000, 100);
-    write(c, "bt2", 2, 0, 1000000000, 100);
-    write(c, "bt3", 3, 0, 1000000000, 100);
+    write(c, "bt1", 1, 0, 1000000000, 250);
+    write(c, "bt2", 2, 0, 1000000000, 250);
+    write(c, "bt3", 3, 0, 1000000000, 250);
     
     // test inserting an empty key
     BatchWriter bw = c.createBatchWriter("bt4", new BatchWriterConfig());
@@ -80,9 +80,9 @@ public class BloomFilterIT extends MacTest {
     FunctionalTestUtils.checkRFiles(c, "bt4", 1, 1, 1, 1);
     
     // these queries should only run quickly if bloom filters are working, so lets get a base
-    long t1 = query(c, "bt1", 1, 0, 1000000000, 100000, 100);
-    long t2 = query(c, "bt2", 2, 0, 1000000000, 100000, 100);
-    long t3 = query(c, "bt3", 3, 0, 1000000000, 100000, 100);
+    long t1 = query(c, "bt1", 1, 0, 1000000000, 100000, 250);
+    long t2 = query(c, "bt2", 2, 0, 1000000000, 100000, 250);
+    long t3 = query(c, "bt3", 3, 0, 1000000000, 100000, 250);
     
     c.tableOperations().setProperty("bt1", Property.TABLE_BLOOM_ENABLED.getKey(), "true");
     c.tableOperations().setProperty("bt1", Property.TABLE_BLOOM_KEY_FUNCTOR.getKey(), RowFunctor.class.getName());
@@ -102,9 +102,9 @@ public class BloomFilterIT extends MacTest {
     
     // these queries should only run quickly if bloom
     // filters are working
-    long tb1 = query(c, "bt1", 1, 0, 1000000000, 100000, 100);
-    long tb2 = query(c, "bt2", 2, 0, 1000000000, 100000, 100);
-    long tb3 = query(c, "bt3", 3, 0, 1000000000, 100000, 100);
+    long tb1 = query(c, "bt1", 1, 0, 1000000000, 100000, 250);
+    long tb2 = query(c, "bt2", 2, 0, 1000000000, 100000, 250);
+    long tb3 = query(c, "bt3", 3, 0, 1000000000, 100000, 250);
     
     timeCheck(t1, tb1);
     timeCheck(t2, tb2);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/BulkIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/BulkIT.java b/test/src/test/java/org/apache/accumulo/test/functional/BulkIT.java
index 5e33383..d5115ff 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/BulkIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/BulkIT.java
@@ -16,8 +16,6 @@
  */
 package org.apache.accumulo.test.functional;
 
-import org.apache.accumulo.core.cli.BatchWriterOpts;
-import org.apache.accumulo.core.cli.ScannerOpts;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.util.CachedConfiguration;
 import org.apache.accumulo.test.TestIngest;
@@ -49,24 +47,24 @@ public class BulkIT extends MacTest {
     for (int i = 0; i < COUNT; i++) {
       opts.outputFile = base + String.format("/testrf/rf%02d", i);
       opts.startRow = N * i;
-      TestIngest.ingest(c, opts , new BatchWriterOpts());
+      TestIngest.ingest(c, opts , BWOPTS);
     }
     opts.outputFile = base + String.format("/testrf/rf%02d", N);
     opts.startRow = N;
     opts.rows = 1;
     // create an rfile with one entry, there was a bug with this:
-    TestIngest.ingest(c, opts , new BatchWriterOpts());
+    TestIngest.ingest(c, opts , BWOPTS);
     c.tableOperations().importDirectory("test_ingest", base + "/testrf", base + "/testBulkFail", false);
     VerifyIngest.Opts vopts = new VerifyIngest.Opts();
     vopts.random = 56;
     for (int i = 0; i < COUNT; i++) {
       vopts.startRow = i * N;
       vopts.rows = N;
-      VerifyIngest.verifyIngest(c, vopts, new ScannerOpts());
+      VerifyIngest.verifyIngest(c, vopts, SOPTS);
     }
     vopts.startRow = N;
     vopts.rows = 1;
-    VerifyIngest.verifyIngest(c, vopts, new ScannerOpts());
+    VerifyIngest.verifyIngest(c, vopts, SOPTS);
   }
   
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java b/test/src/test/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java
index aa258e2..32e871e 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java
@@ -19,7 +19,6 @@ package org.apache.accumulo.test.functional;
 import java.util.Collections;
 
 import org.apache.accumulo.core.cli.ClientOpts.Password;
-import org.apache.accumulo.core.cli.ScannerOpts;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.util.CachedConfiguration;
@@ -83,7 +82,7 @@ public class BulkSplitOptimizationIT extends MacTest {
     opts.startRow = 0;
     opts.cols = 1;
     opts.password = new Password(PASSWORD);
-    VerifyIngest.verifyIngest(c, opts, new ScannerOpts());
+    VerifyIngest.verifyIngest(c, opts, SOPTS);
     
     // ensure each tablet does not have all map files
     FunctionalTestUtils.checkRFiles(c, TABLE_NAME, 50, 100, 1, 4);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/ChaoticBlancerIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ChaoticBlancerIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ChaoticBlancerIT.java
index fb46f1e..0e30a7a 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/ChaoticBlancerIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ChaoticBlancerIT.java
@@ -21,8 +21,6 @@ import java.util.Map;
 import java.util.SortedSet;
 import java.util.TreeSet;
 
-import org.apache.accumulo.core.cli.BatchWriterOpts;
-import org.apache.accumulo.core.cli.ScannerOpts;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.minicluster.MiniAccumuloConfig;
@@ -57,9 +55,9 @@ public class ChaoticBlancerIT extends MacTest {
     TestIngest.Opts opts = new TestIngest.Opts();
     VerifyIngest.Opts vopts = new VerifyIngest.Opts();
     vopts.rows = opts.rows = 200000;
-    TestIngest.ingest(c, opts, new BatchWriterOpts());
+    TestIngest.ingest(c, opts, BWOPTS);
     c.tableOperations().flush("test_ingest", null, null, true);
-    VerifyIngest.verifyIngest(c, vopts, new ScannerOpts());
+    VerifyIngest.verifyIngest(c, vopts, SOPTS);
   }
   
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/DeleteIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/DeleteIT.java b/test/src/test/java/org/apache/accumulo/test/functional/DeleteIT.java
index ad9e3fa..36c852e 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/DeleteIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/DeleteIT.java
@@ -18,7 +18,6 @@ package org.apache.accumulo.test.functional;
 
 import static org.junit.Assert.assertEquals;
 
-import org.apache.accumulo.core.cli.BatchWriterOpts;
 import org.apache.accumulo.core.cli.ScannerOpts;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.server.util.Admin;
@@ -43,9 +42,9 @@ public class DeleteIT extends MacTest {
     vopts.rows = opts.rows = 1000;
     vopts.cols = opts.cols = 1;
     vopts.random = opts.random = 56;
-    TestIngest.ingest(c, opts, new BatchWriterOpts());
+    TestIngest.ingest(c, opts, BWOPTS);
     assertEquals(0, cluster.exec(TestRandomDeletes.class, "-p", MacTest.PASSWORD, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers()).waitFor());
-    TestIngest.ingest(c, opts, new BatchWriterOpts());
+    TestIngest.ingest(c, opts, BWOPTS);
     VerifyIngest.verifyIngest(c, vopts, new ScannerOpts());
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java b/test/src/test/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java
index 6e4e1a7..d954974 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java
@@ -20,7 +20,6 @@ import static org.junit.Assert.assertTrue;
 
 import java.util.Collections;
 
-import org.apache.accumulo.core.cli.BatchWriterOpts;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.impl.MasterClient;
 import org.apache.accumulo.core.client.security.tokens.PasswordToken;
@@ -41,23 +40,23 @@ public class DynamicThreadPoolsIT extends MacTest {
   
   @Override
   public void configure(MiniAccumuloConfig cfg) {
-    cfg.setSiteConfig(Collections.singletonMap(Property.TSERV_MAJC_DELAY.getKey(), "1"));
+    cfg.setSiteConfig(Collections.singletonMap(Property.TSERV_MAJC_DELAY.getKey(), "100ms"));
   }
   
-  @Test(timeout = 90 * 1000)
+  @Test(timeout = 30 * 1000)
   public void test() throws Exception {
     Connector c = getConnector();
+    c.instanceOperations().setProperty(Property.TSERV_MAJC_MAXCONCURRENT.getKey(), "1");
     TestIngest.Opts opts = new TestIngest.Opts();
-    opts.rows = 100000;
+    opts.rows = 100*1000;
     opts.createTable = true;
-    TestIngest.ingest(c, opts, new BatchWriterOpts());
+    TestIngest.ingest(c, opts, BWOPTS);
     c.tableOperations().flush("test_ingest", null, null, true);
     c.tableOperations().clone("test_ingest", "test_ingest2", true, null, null);
     c.tableOperations().clone("test_ingest", "test_ingest3", true, null, null);
     c.tableOperations().clone("test_ingest", "test_ingest4", true, null, null);
     c.tableOperations().clone("test_ingest", "test_ingest5", true, null, null);
     c.tableOperations().clone("test_ingest", "test_ingest6", true, null, null);
-    c.instanceOperations().setProperty(Property.TSERV_MAJC_MAXCONCURRENT.getKey(), "1");
     
     TCredentials creds = CredentialHelper.create("root", new PasswordToken(MacTest.PASSWORD), c.getInstance().getInstanceName());
     UtilWaitThread.sleep(10);
@@ -79,6 +78,8 @@ public class DynamicThreadPoolsIT extends MacTest {
           count += table.majors.running;
         }
       }
+      System.out.println("count " + count);
+      UtilWaitThread.sleep(1000);
     }
     assertTrue(count == 1 || count == 2); // sometimes we get two threads due to the way the stats are pulled
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java b/test/src/test/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java
new file mode 100644
index 0000000..2064627
--- /dev/null
+++ b/test/src/test/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java
@@ -0,0 +1,158 @@
+package org.apache.accumulo.test.functional;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.util.Daemon;
+import org.apache.accumulo.core.util.UtilWaitThread;
+import org.apache.accumulo.minicluster.MiniAccumuloConfig;
+import org.apache.accumulo.minicluster.ServerType;
+import org.apache.accumulo.server.tabletserver.TabletServer;
+import org.apache.accumulo.start.Main;
+import org.apache.accumulo.test.TestIngest;
+import org.apache.accumulo.test.VerifyIngest;
+import org.junit.Test;
+
+public class HalfDeadTServerIT extends MacTest {
+  
+  @Override
+  public void configure(MiniAccumuloConfig cfg) {
+    cfg.setNumTservers(1);
+    Map<String,String> siteConfig = new HashMap<String,String>();
+    siteConfig.put(Property.INSTANCE_ZK_TIMEOUT.getKey(), "15s");
+    siteConfig.put(Property.GENERAL_RPC_TIMEOUT.getKey(), "5s");
+    cfg.setSiteConfig(siteConfig );
+  }
+  
+  class DumpOutput extends Daemon {
+    
+    private final BufferedReader rdr;
+    private final StringBuilder output;
+    
+    DumpOutput(InputStream is) {
+      rdr = new BufferedReader(new InputStreamReader(is));
+      output = new StringBuilder();
+    }
+    @Override
+    public void run() {
+      try {
+        while (true) {
+          String line = rdr.readLine();
+          if (line == null)
+            break;
+          System.out.println(line);
+          output.append(line);
+          output.append("\n");
+        }
+      } catch (IOException ex) {
+        log.error(ex, ex);
+      }
+    }
+    
+    @Override
+    public String toString() {
+      return output.toString();
+    }
+  }
+  
+  
+  @Test(timeout=30*1000)
+  public void testRecover() throws Exception {
+    test(10);
+  }
+  
+  @Test(timeout=60*1000)
+  public void testTimeout() throws Exception {
+    String results = test(40);
+    if (results != null)
+      assertTrue(results.contains("Session expired"));
+  }
+  
+  public String test(int seconds) throws Exception {
+    if (!makeDiskFailureLibrary())
+      return null;
+    Connector c = getConnector();
+    assertEquals(1, c.instanceOperations().getTabletServers().size());
+    // don't need the regular tablet server
+    cluster.killProcess(ServerType.TABLET_SERVER, cluster.getProcesses().get(ServerType.TABLET_SERVER).iterator().next());
+    
+    // create our own tablet server with the special test library
+    String javaHome = System.getProperty("java.home");
+    String javaBin = javaHome + File.separator + "bin" + File.separator + "java";
+    String classpath = System.getProperty("java.class.path");
+    classpath = new File(cluster.getConfig().getDir(), "conf") + File.pathSeparator + classpath;
+    String className = TabletServer.class.getCanonicalName();
+    ArrayList<String> argList = new ArrayList<String>();
+    argList.addAll(Arrays.asList(javaBin, "-cp", classpath));
+    argList.addAll(Arrays.asList(Main.class.getName(), className));
+    ProcessBuilder builder = new ProcessBuilder(argList);
+    Map<String,String> env = builder.environment();
+    env.put("ACCUMULO_HOME", cluster.getConfig().getDir().getAbsolutePath());
+    env.put("ACCUMULO_LOG_DIR", cluster.getConfig().getLogDir().getAbsolutePath());
+    String trickFilename = cluster.getConfig().getLogDir().getAbsolutePath() + "/TRICK_FILE";
+    env.put("TRICK_FILE", trickFilename);
+    String libPath = System.getProperty("user.dir") + "/target/fake_disk_failure.so";
+    env.put("LD_PRELOAD", libPath);
+    env.put("DYLD_INSERT_LIBRARIES", libPath);
+    env.put("DYLD_FORCE_FLAT_NAMESPACE", "true");
+    Process tserver = builder.start();
+    DumpOutput t = new DumpOutput(tserver.getInputStream());
+    t.start();
+    c.tableOperations().create("test_ingest");
+    assertTrue(c.instanceOperations().getTabletServers().size() > 1);
+    int rows = 100*1000;
+    Process ingest = cluster.exec(TestIngest.class, "-u", "root", "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "-p", MacTest.PASSWORD, "--rows", rows + "");
+    UtilWaitThread.sleep(500);
+    
+    // block I/O with some side-channel trickiness
+    File trickFile = new File(trickFilename);
+    trickFile.createNewFile();
+    UtilWaitThread.sleep(seconds*1000);
+    trickFile.delete();
+
+    if (seconds <= 10) {
+      assertEquals(0, ingest.waitFor());
+      VerifyIngest.Opts vopts = new VerifyIngest.Opts();
+      vopts.rows = rows;
+      VerifyIngest.verifyIngest(c, vopts, SOPTS);
+    } else {
+      UtilWaitThread.sleep(5*1000);
+    }
+    // verify the process was blocked 
+    String results = t.toString();
+    assertTrue(results.contains("sleeping\nsleeping\nsleeping\n"));
+    assertTrue(results.contains("Zookeeper error, will retry"));
+    ingest.destroy();
+    tserver.destroy();
+    t.join();
+    return results;
+  }
+
+  private boolean makeDiskFailureLibrary() throws Exception {
+    String root = System.getProperty("user.dir");
+    String source = root + "/src/test/c/fake_disk_failure.c";
+    String lib = root + "/target/fake_disk_failure.so";
+    String platform = System.getProperty("os.name");
+    String cmd[];
+    if (platform.equals("Darwin")) {
+      cmd = new String[]{"gcc","-arch","x86_64","-arch","i386","-dynamiclib","-O3","-fPIC", source,"-o",lib};
+    } else {
+      cmd = new String[]{"gcc","-D_GNU_SOURCE","-Wall","-fPIC", source,"-shared", "-o", lib, "-ldl"};
+    }
+    Process gcc = Runtime.getRuntime().exec(cmd);
+    return gcc.waitFor() == 0;
+  }
+  
+}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/LateLastContactIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/LateLastContactIT.java b/test/src/test/java/org/apache/accumulo/test/functional/LateLastContactIT.java
new file mode 100644
index 0000000..7edb8df
--- /dev/null
+++ b/test/src/test/java/org/apache/accumulo/test/functional/LateLastContactIT.java
@@ -0,0 +1,44 @@
+/*
+ * 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.accumulo.test.functional;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Collections;
+
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.minicluster.MiniAccumuloConfig;
+import org.junit.Test;
+
+/**
+ * Fake the "tablet stops talking but holds its lock" problem we see when hard drives and NFS fail. 
+ * Start a ZombieTServer, and see that master stops it.
+ */
+public class LateLastContactIT extends MacTest {
+  
+  @Override
+  public void configure(MiniAccumuloConfig cfg) {
+    cfg.setSiteConfig(Collections.singletonMap(Property.GENERAL_RPC_TIMEOUT.getKey(), "2s"));
+  }
+
+  @Test
+  public void test() throws Exception {
+    Process zombie = cluster.exec(ZombieTServer.class);
+    assertEquals(0, zombie.waitFor());
+  }
+  
+}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/MacTest.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/MacTest.java b/test/src/test/java/org/apache/accumulo/test/functional/MacTest.java
index dac87f4..0a288c5 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/MacTest.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/MacTest.java
@@ -16,10 +16,13 @@
  */
 package org.apache.accumulo.test.functional;
 
+import org.apache.accumulo.core.cli.BatchWriterOpts;
+import org.apache.accumulo.core.cli.ScannerOpts;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.minicluster.MiniAccumuloCluster;
+import org.apache.accumulo.minicluster.MiniAccumuloCluster.LogWriter;
 import org.apache.accumulo.minicluster.MiniAccumuloConfig;
 import org.apache.log4j.Logger;
 import org.junit.After;
@@ -31,6 +34,8 @@ public class MacTest {
   public static TemporaryFolder folder = new TemporaryFolder();
   public static MiniAccumuloCluster cluster;
   public static final String PASSWORD = "secret";
+  static final ScannerOpts SOPTS = new ScannerOpts();
+  static final BatchWriterOpts BWOPTS = new BatchWriterOpts();
   
   public Connector getConnector() throws AccumuloException, AccumuloSecurityException {
     return cluster.getConnector("root", PASSWORD);
@@ -50,7 +55,10 @@ public class MacTest {
   
   @After
   public void tearDown() throws Exception {
-    cluster.stop();
+    if (cluster != null)
+      cluster.stop();
+    for (LogWriter log : cluster.getLogWriters())
+      log.flush();
     folder.delete();
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/MapReduceIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/MapReduceIT.java b/test/src/test/java/org/apache/accumulo/test/functional/MapReduceIT.java
index 2b84d49..b8592d9 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/MapReduceIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/MapReduceIT.java
@@ -43,7 +43,7 @@ public class MapReduceIT extends MacTest {
   static final String output_cq = "cq-MD4BASE64";
   static final String output_cfcq =  input_cf + ":" + output_cq;
   
-  @Test
+  @Test(timeout=30*1000)
   public void test() throws Exception {
     Connector c = getConnector();
     c.tableOperations().create(tablename);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/MaxOpenIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/MaxOpenIT.java b/test/src/test/java/org/apache/accumulo/test/functional/MaxOpenIT.java
index 2934fd2..f5cc2cf 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/MaxOpenIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/MaxOpenIT.java
@@ -53,7 +53,7 @@ public class MaxOpenIT extends MacTest {
   private static final int NUM_TABLETS = 16;
   private static final int NUM_TO_INGEST = 10000;
   
-  @Test
+  @Test(timeout=30*1000)
   public void run() throws Exception {
     Connector c = getConnector();
     c.tableOperations().create("test_ingest");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/MetadataSplitIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/MetadataSplitIT.java b/test/src/test/java/org/apache/accumulo/test/functional/MetadataSplitIT.java
new file mode 100644
index 0000000..35f6251
--- /dev/null
+++ b/test/src/test/java/org/apache/accumulo/test/functional/MetadataSplitIT.java
@@ -0,0 +1,50 @@
+/*
+ * 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.accumulo.test.functional;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Collections;
+
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.metadata.MetadataTable;
+import org.apache.accumulo.core.util.UtilWaitThread;
+import org.apache.accumulo.minicluster.MiniAccumuloConfig;
+import org.junit.Test;
+
+public class MetadataSplitIT extends MacTest {
+  
+  @Override
+  public void configure(MiniAccumuloConfig cfg) {
+    cfg.setSiteConfig(Collections.singletonMap(Property.TSERV_MAJC_DELAY.getKey(), "100ms"));
+  }
+ 
+  @Test(timeout = 30 * 1000)
+  public void test() throws Exception {
+    Connector c = getConnector();
+    assertEquals(1, c.tableOperations().listSplits(MetadataTable.NAME).size());
+    c.tableOperations().setProperty(MetadataTable.NAME, Property.TABLE_SPLIT_THRESHOLD.getKey(), "500");
+    for (int i = 0; i < 10; i++) {
+      c.tableOperations().create("table" + i);
+      c.tableOperations().flush(MetadataTable.NAME, null, null, true);
+    }
+    UtilWaitThread.sleep(10*1000);
+    assertTrue(c.tableOperations().listSplits(MetadataTable.NAME).size() > 2);
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/NativeMapIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/NativeMapIT.java b/test/src/test/java/org/apache/accumulo/test/functional/NativeMapIT.java
new file mode 100644
index 0000000..b5b6953
--- /dev/null
+++ b/test/src/test/java/org/apache/accumulo/test/functional/NativeMapIT.java
@@ -0,0 +1,30 @@
+/*
+ * 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.accumulo.test.functional;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class NativeMapIT extends MacTest {
+  
+  @Test
+  public void test() throws Exception {
+    assertEquals(0, cluster.exec(NativeMapTest.class).waitFor());
+  }
+  
+}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java b/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java
index 561d453..c0fc4ea 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java
@@ -284,7 +284,7 @@ public class PermissionsIT extends MacTest {
   
   private static final String TEST_TABLE = "__TABLE_PERMISSION_TEST__";
   
-  @Test
+  @Test(timeout=30*1000)
   public void tablePermissionTest() throws Exception {
     // create the test user
     Connector c = getConnector();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/RestartIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/RestartIT.java b/test/src/test/java/org/apache/accumulo/test/functional/RestartIT.java
new file mode 100644
index 0000000..9c6549e
--- /dev/null
+++ b/test/src/test/java/org/apache/accumulo/test/functional/RestartIT.java
@@ -0,0 +1,144 @@
+/*
+ * 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.accumulo.test.functional;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map.Entry;
+
+import org.apache.accumulo.core.cli.BatchWriterOpts;
+import org.apache.accumulo.core.cli.ScannerOpts;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.metadata.MetadataTable;
+import org.apache.accumulo.core.util.UtilWaitThread;
+import org.apache.accumulo.minicluster.MiniAccumuloConfig;
+import org.apache.accumulo.minicluster.ProcessReference;
+import org.apache.accumulo.minicluster.ServerType;
+import org.apache.accumulo.server.util.Admin;
+import org.apache.accumulo.test.TestIngest;
+import org.apache.accumulo.test.VerifyIngest;
+import org.junit.Test;
+
+public class RestartIT extends MacTest {
+  @Override
+  public void configure(MiniAccumuloConfig cfg) {
+    cfg.setSiteConfig(Collections.singletonMap(Property.INSTANCE_ZK_TIMEOUT.getKey(), "5s"));
+  }
+
+  private static final ScannerOpts SOPTS = new ScannerOpts();
+  private static final VerifyIngest.Opts VOPTS = new VerifyIngest.Opts();
+  private static final BatchWriterOpts BWOPTS = new BatchWriterOpts();
+  
+  @Test
+  public void restartMaster() throws Exception {
+    Connector c = getConnector();
+    c.tableOperations().create("test_ingest");
+    Process ingest = cluster.exec(TestIngest.class, 
+        "-u", "root", "-p", MacTest.PASSWORD, 
+        "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers());
+    for (ProcessReference master : cluster.getProcesses().get(ServerType.MASTER)) {
+      cluster.killProcess(ServerType.MASTER, master);
+    }
+    cluster.start();
+    assertEquals(0, ingest.waitFor());
+    VerifyIngest.verifyIngest(c, VOPTS, SOPTS);
+    ingest.destroy();
+  }
+  
+  @Test
+  public void restartMasterRecovery() throws Exception {
+    Connector c = getConnector();
+    c.tableOperations().create("test_ingest");
+    TestIngest.Opts opts = new TestIngest.Opts();
+    TestIngest.ingest(c, opts, BWOPTS);
+    for (Entry<ServerType,Collection<ProcessReference>> entry : cluster.getProcesses().entrySet()) {
+      for (ProcessReference proc : entry.getValue()) {
+        cluster.killProcess(entry.getKey(), proc);
+      }
+    }
+    cluster.start();
+    UtilWaitThread.sleep(5);
+    for (ProcessReference master : cluster.getProcesses().get(ServerType.MASTER)) {
+      cluster.killProcess(ServerType.MASTER, master);
+    }
+    cluster.start();
+    VerifyIngest.verifyIngest(c, VOPTS, SOPTS);
+  }
+  
+  @Test
+  public void restartMasterSplit() throws Exception {
+    Connector c = getConnector();
+    c.tableOperations().create("test_ingest");
+    c.tableOperations().setProperty("test_ingest", Property.TABLE_SPLIT_THRESHOLD.getKey(), "5K");
+    Process ingest = cluster.exec(TestIngest.class, 
+        "-u", "root", "-p", MacTest.PASSWORD, 
+        "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers());
+    for (ProcessReference master : cluster.getProcesses().get(ServerType.MASTER)) {
+      cluster.killProcess(ServerType.MASTER, master);
+    }
+    cluster.start();
+    assertEquals(0, ingest.waitFor());
+    VerifyIngest.verifyIngest(c, VOPTS, SOPTS);
+    ingest.destroy();
+  }
+  
+  @Test
+  public void killedTabletServer() throws Exception {
+    Connector c = getConnector();
+    c.tableOperations().create("test_ingest");
+    TestIngest.Opts opts = new TestIngest.Opts();
+    TestIngest.ingest(c, opts, BWOPTS);
+    VerifyIngest.verifyIngest(c, VOPTS, SOPTS);
+    List<ProcessReference> procs = new ArrayList<ProcessReference>(cluster.getProcesses().get(ServerType.TABLET_SERVER));
+    for (ProcessReference tserver : procs) {
+      cluster.killProcess(ServerType.TABLET_SERVER, tserver);
+      cluster.start();
+      VerifyIngest.verifyIngest(c, VOPTS, SOPTS);
+    }
+  }
+
+  @Test
+  public void killedTabletServerDuringShutdown() throws Exception {
+    Connector c = getConnector();
+    c.tableOperations().create("test_ingest");
+    TestIngest.Opts opts = new TestIngest.Opts();
+    TestIngest.ingest(c, opts, BWOPTS);
+    List<ProcessReference> procs = new ArrayList<ProcessReference>(cluster.getProcesses().get(ServerType.TABLET_SERVER));
+    cluster.killProcess(ServerType.TABLET_SERVER, procs.get(0));
+    assertEquals(0, cluster.exec(Admin.class, "stopAll").waitFor());
+  }
+  
+  @Test
+  public void shutdownDuringCompactingSplitting() throws Exception {
+    Connector c = getConnector();
+    c.tableOperations().create("test_ingest");
+    c.tableOperations().setProperty("test_ingest", Property.TABLE_SPLIT_THRESHOLD.getKey(), "5K");
+    c.tableOperations().setProperty(MetadataTable.NAME, Property.TABLE_SPLIT_THRESHOLD.getKey(), "10K");
+    TestIngest.Opts opts = new TestIngest.Opts();
+    TestIngest.ingest(c, opts, BWOPTS);
+    c.tableOperations().flush("test_ingest", null, null, false);
+    VerifyIngest.verifyIngest(c, VOPTS, SOPTS);
+    assertEquals(0, cluster.exec(Admin.class, "stopAll").waitFor());
+  }
+  
+  
+}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/RestartStressIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/RestartStressIT.java b/test/src/test/java/org/apache/accumulo/test/functional/RestartStressIT.java
new file mode 100644
index 0000000..f60a8f0
--- /dev/null
+++ b/test/src/test/java/org/apache/accumulo/test/functional/RestartStressIT.java
@@ -0,0 +1,73 @@
+/*
+ * 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.accumulo.test.functional;
+
+import static org.junit.Assert.*;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.accumulo.core.cli.ScannerOpts;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.util.UtilWaitThread;
+import org.apache.accumulo.minicluster.MiniAccumuloConfig;
+import org.apache.accumulo.minicluster.ServerType;
+import org.apache.accumulo.test.TestIngest;
+import org.apache.accumulo.test.VerifyIngest;
+import org.junit.Test;
+
+public class RestartStressIT extends MacTest {
+  
+  @Override
+  public void configure(MiniAccumuloConfig cfg) {
+    Map<String, String> opts = new HashMap<String, String>();
+    opts.put(Property.TSERV_MAXMEM.getKey(), "5K");
+    opts.put(Property.TSERV_MAJC_DELAY.getKey(), "100ms");
+    opts.put(Property.TSERV_WALOG_MAX_SIZE.getKey(), "50K");
+    cfg.setSiteConfig(opts);
+  }
+
+  private static final TestIngest.Opts IOPTS;
+  private static final VerifyIngest.Opts VOPTS;
+  static {
+    IOPTS = new TestIngest.Opts();
+    VOPTS = new VerifyIngest.Opts();
+    IOPTS.rows = VOPTS.rows = 100*1000;
+  }
+  private static final ScannerOpts SOPTS = new ScannerOpts();
+  
+  
+  @Test(timeout=120*1000)
+  public void test() throws Exception {
+    Connector c = getConnector();
+    c.tableOperations().create("test_ingest");
+    c.tableOperations().setProperty("test_ingest", Property.TABLE_SPLIT_THRESHOLD.getKey(), "5K");
+    Process ingest = cluster.exec(TestIngest.class, 
+        "-u", "root", "-p", MacTest.PASSWORD, 
+        "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), 
+        "--rows", "" + IOPTS.rows);
+    for (int i = 0; i < 5; i++) {
+      UtilWaitThread.sleep(10*1000);
+      cluster.killProcess(ServerType.TABLET_SERVER, cluster.getProcesses().get(ServerType.TABLET_SERVER).iterator().next());
+      cluster.start();
+    }
+    assertEquals(0, ingest.waitFor());
+    VerifyIngest.verifyIngest(c, VOPTS, SOPTS);
+  }
+  
+}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java
index 3237fc1..cb4e2d7 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java
@@ -38,7 +38,7 @@ import org.junit.Test;
 
 public class ServerSideErrorIT extends MacTest {
   
-  @Test
+  @Test(timeout=60*1000)
   public void run() throws Exception {
     Connector c = getConnector();
     c.tableOperations().create("tt");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/SparseColumnFamilyIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/SparseColumnFamilyIT.java b/test/src/test/java/org/apache/accumulo/test/functional/SparseColumnFamilyIT.java
index 1f4a3fc..dda7c63 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/SparseColumnFamilyIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/SparseColumnFamilyIT.java
@@ -73,7 +73,6 @@ public class SparseColumnFamilyIT extends MacTest {
       scanner.setBatchSize(3);
       scanner.fetchColumnFamily(new Text(String.format("%03d", 1)));
       
-      long t1 = System.currentTimeMillis();
       Iterator<Entry<Key,Value>> iter = scanner.iterator();
       if (iter.hasNext()) {
         Entry<Key,Value> entry = iter.next();
@@ -81,10 +80,6 @@ public class SparseColumnFamilyIT extends MacTest {
           throw new Exception();
         }
       }
-      long t2 = System.currentTimeMillis();
-      
-      System.out.println("time " + (t2 - t1));
-      
     }
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/SplitIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/SplitIT.java b/test/src/test/java/org/apache/accumulo/test/functional/SplitIT.java
index c4719e0..e8a9d80 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/SplitIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/SplitIT.java
@@ -103,7 +103,7 @@ public class SplitIT extends MacTest {
     c.tableOperations().setProperty("test_ingest", Property.TABLE_SPLIT_THRESHOLD.getKey(), "10K");
     DeleteIT.deleteTest(c);
     c.tableOperations().flush("test_ingest", null, null, true);
-    UtilWaitThread.sleep(5*1000);
+    UtilWaitThread.sleep(10*1000);
     assertTrue(c.tableOperations().listSplits("test_ingest").size() > 30);
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/TableIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/TableIT.java b/test/src/test/java/org/apache/accumulo/test/functional/TableIT.java
index 1d02d91..cce2af5 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/TableIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/TableIT.java
@@ -26,6 +26,7 @@ import org.apache.accumulo.core.cli.BatchWriterOpts;
 import org.apache.accumulo.core.cli.ScannerOpts;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.Scanner;
+import org.apache.accumulo.core.client.admin.TableOperations;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.KeyExtent;
 import org.apache.accumulo.core.data.Value;
@@ -45,12 +46,13 @@ public class TableIT extends MacTest {
   @Test(timeout = 60 * 1000)
   public void test() throws Exception {
     Connector c = getConnector();
-    c.tableOperations().create("test_ingest");
+    TableOperations to = c.tableOperations();
+    to.create("test_ingest");
     TestIngest.Opts opts = new TestIngest.Opts();
     TestIngest.ingest(c, opts, new BatchWriterOpts());
     VerifyIngest.Opts vopts = new VerifyIngest.Opts();
     VerifyIngest.verifyIngest(c, vopts, new ScannerOpts());
-    String id = c.tableOperations().tableIdMap().get("test_ingest");
+    String id = to.tableIdMap().get("test_ingest");
     Scanner s = c.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
     s.setRange(new KeyExtent(new Text(id), null, null).toMetadataRange());
     int count = 0;
@@ -61,7 +63,7 @@ public class TableIT extends MacTest {
     assertTrue(count > 0);
     FileSystem fs = FileSystem.get(CachedConfiguration.getInstance());
     assertTrue(fs.listStatus(new Path(cluster.getConfig().getDir() + "/accumulo/tables/" + id)).length > 0);
-    c.tableOperations().delete("test_ingest");
+    to.delete("test_ingest");
     count = 0;
     for (@SuppressWarnings("unused")
     Entry<Key,Value> entry : s) {
@@ -69,10 +71,11 @@ public class TableIT extends MacTest {
     }
     assertEquals(0, count);
     assertEquals(0, fs.listStatus(new Path(cluster.getConfig().getDir() + "/accumulo/tables/" + id)).length);
-    assertNull(c.tableOperations().tableIdMap().get("test_ingest"));
-    c.tableOperations().create("test_ingest");
+    assertNull(to.tableIdMap().get("test_ingest"));
+    to.create("test_ingest");
     TestIngest.ingest(c, opts, new BatchWriterOpts());
     VerifyIngest.verifyIngest(c, vopts, new ScannerOpts());
+    to.delete("test_ingest");
     assertEquals(0, cluster.exec(Admin.class, "stopAll").waitFor());
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/TimeoutIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/TimeoutIT.java b/test/src/test/java/org/apache/accumulo/test/functional/TimeoutIT.java
index 2c3c86d..6c7fa75 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/TimeoutIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/TimeoutIT.java
@@ -66,9 +66,9 @@ public class TimeoutIT extends MacTest {
       bw.close();
       fail("batch writer did not timeout");
     } catch (MutationsRejectedException mre) {
-      if (!(mre.getCause() instanceof TimedOutException)) {
-        throw mre;
-      }
+      if (mre.getCause() instanceof TimedOutException)
+        return;
+      throw mre;
     }
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/VisibilityIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/VisibilityIT.java b/test/src/test/java/org/apache/accumulo/test/functional/VisibilityIT.java
index 7266430..51a45fa 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/VisibilityIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/VisibilityIT.java
@@ -46,7 +46,7 @@ import org.junit.Test;
 
 public class VisibilityIT extends MacTest {
   
-  @Test
+  @Test(timeout=30*1000)
   public void run() throws Exception {
     Connector c = getConnector();
     c.tableOperations().create("vt");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/WriteAheadLogIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/WriteAheadLogIT.java b/test/src/test/java/org/apache/accumulo/test/functional/WriteAheadLogIT.java
new file mode 100644
index 0000000..124629f
--- /dev/null
+++ b/test/src/test/java/org/apache/accumulo/test/functional/WriteAheadLogIT.java
@@ -0,0 +1,69 @@
+/*
+ * 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.accumulo.test.functional;
+
+import static org.junit.Assert.*;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.accumulo.core.cli.BatchWriterOpts;
+import org.apache.accumulo.core.cli.ScannerOpts;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.minicluster.MiniAccumuloConfig;
+import org.apache.accumulo.minicluster.ProcessReference;
+import org.apache.accumulo.minicluster.ServerType;
+import org.apache.accumulo.server.util.Admin;
+import org.apache.accumulo.test.TestIngest;
+import org.apache.accumulo.test.VerifyIngest;
+import org.junit.Test;
+
+public class WriteAheadLogIT extends MacTest {
+  
+  @Override
+  public void configure(MiniAccumuloConfig cfg) {
+    Map<String, String> siteConfig = new HashMap<String, String>();
+    siteConfig.put(Property.TSERV_WALOG_MAX_SIZE.getKey(), "2M");
+    siteConfig.put(Property.GC_CYCLE_DELAY.getKey(), "1");
+    siteConfig.put(Property.GC_CYCLE_START.getKey(), "1");
+    siteConfig.put(Property.MASTER_RECOVERY_DELAY.getKey(), "0");
+    siteConfig.put(Property.TSERV_MAXMEM.getKey(), "200K");
+    siteConfig.put(Property.TSERV_MAJC_DELAY.getKey(), "1");
+  }
+
+  @Test(timeout=60*1000)
+  public void test() throws Exception {
+    Connector c = getConnector();
+    c.tableOperations().create("test_ingest");
+    c.tableOperations().setProperty("test_ingest", Property.TABLE_SPLIT_THRESHOLD.getKey(), "750K");
+    TestIngest.Opts opts = new TestIngest.Opts();
+    TestIngest.ingest(c, opts, new BatchWriterOpts());
+    VerifyIngest.Opts vopts = new VerifyIngest.Opts();
+    VerifyIngest.verifyIngest(c, vopts, new ScannerOpts());
+    Map<ServerType,Collection<ProcessReference>> processes = cluster.getProcesses();
+    for (ProcessReference tserver : processes.get(ServerType.TABLET_SERVER)) {
+      cluster.killProcess(ServerType.TABLET_SERVER, tserver);
+    }
+    assertEquals(0, cluster.getProcesses().get(ServerType.TABLET_SERVER).size());
+    cluster.start();
+    VerifyIngest.verifyIngest(c, vopts, new ScannerOpts());
+    assertEquals(0, cluster.exec(Admin.class, "stopAll").waitFor());
+  }
+  
+}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/src/test/java/org/apache/accumulo/test/functional/ZooCacheIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ZooCacheIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ZooCacheIT.java
new file mode 100644
index 0000000..f483ce9
--- /dev/null
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ZooCacheIT.java
@@ -0,0 +1,55 @@
+/*
+ * 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.accumulo.test.functional;
+
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.junit.Test;
+
+public class ZooCacheIT extends MacTest {
+  
+  @Test(timeout=200*1000)
+  public void test() throws Exception {
+    assertEquals(0, cluster.exec(CacheTestClean.class, "/zcTest-42", "/tmp/zcTest-42").waitFor());
+    final AtomicReference<Exception> ref = new AtomicReference<Exception>();
+    List<Thread> threads = new ArrayList<Thread>();
+    for (int i = 0; i < 3; i++) {
+      Thread reader = new Thread() {
+        public void run() {
+          try {
+            CacheTestReader.main(new String[]{"/zcTest-42", "/tmp/zcTest-42", cluster.getZooKeepers()});
+          } catch(Exception ex) {
+            ref.set(ex);
+          }
+        }
+      };
+      reader.start();
+      threads.add(reader);
+    }
+    assertEquals(0, cluster.exec(CacheTestWriter.class, "/zcTest-42", "/tmp/zcTest-42", "3","500").waitFor());
+    for (Thread t: threads) {
+      t.join();
+      if (ref.get() != null)
+        throw ref.get();
+    }
+  }
+  
+}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/system/auto/fake_disk_failure.c
----------------------------------------------------------------------
diff --git a/test/system/auto/fake_disk_failure.c b/test/system/auto/fake_disk_failure.c
deleted file mode 100644
index ce76c9a..0000000
--- a/test/system/auto/fake_disk_failure.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-* 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.
-*/
-#include <unistd.h>
-#include <dlfcn.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-static
-void test_pause() {
-  static char trickFile[1024] = "";
-  static char pid[10] = "";
-  if (trickFile[0] == '\0') {
-    strcpy(trickFile, getenv("HOME"));
-    strcat(trickFile, "/");
-    strcat(trickFile, "HOLD_IO_");
-    sprintf(pid, "%d", getpid());
-    strcat(trickFile, pid);
-  }
-
-  while (access(trickFile, R_OK) == 0) {
-    fprintf(stderr, "sleeping\n");
-    fflush(stderr);
-    sleep(1);
-  }
-}
-
-ssize_t write(int fd, const void *buf, size_t count) {
-  void * real_write = dlsym(RTLD_NEXT, "write");
-  ssize_t (*real_write_t)(int, const void*, size_t) = real_write;
-
-  test_pause();
-  return real_write_t(fd, buf, count);
-}
-
-ssize_t read(int fd, void *buf, size_t count) {
-  void * real_read = dlsym(RTLD_NEXT, "read");
-  ssize_t (*real_read_t)(int, void*, size_t) = real_read;
-  test_pause();
-  return real_read_t(fd, buf, count);
-}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/system/auto/simple/masterFailover.py
----------------------------------------------------------------------
diff --git a/test/system/auto/simple/masterFailover.py b/test/system/auto/simple/masterFailover.py
deleted file mode 100755
index 0d2eca1..0000000
--- a/test/system/auto/simple/masterFailover.py
+++ /dev/null
@@ -1,51 +0,0 @@
-# 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.
-
-
-from simple.readwrite import SunnyDayTest
-
-import logging
-log = logging.getLogger('test.auto')
-
-import unittest
-
-class MasterFailover(SunnyDayTest):
-    "Test master automatic master fail-over"
-
-    order = 85
-
-    def start_master(self, host, safeMode=None):
-        goalState = 'NORMAL'
-        if safeMode:
-           goalState = 'SAFE_MODE'
-        self.wait(self.runOn('localhost',
-                             [self.accumulo_sh(),
-                              'org.apache.accumulo.server.master.state.SetGoalState',
-                              goalState]))
-        return self.runOn(host, [self.accumulo_sh(), 'master', 'dooomed'])
-
-    def runTest(self):
-         waitTime = self.waitTime()
-         self.waitForStop(self.ingester, waitTime)
-         handle = self.start_master(self.masterHost())
-         self.pkill(self.masterHost(), 'doomed')
-         self.sleep(2)
-         self.shutdown_accumulo()
-
-def suite():
-     result = unittest.TestSuite()
-     result.addTest(MasterFailover())
-     return result
- 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/system/auto/simple/nativeMap.py
----------------------------------------------------------------------
diff --git a/test/system/auto/simple/nativeMap.py b/test/system/auto/simple/nativeMap.py
deleted file mode 100755
index 1f154bd..0000000
--- a/test/system/auto/simple/nativeMap.py
+++ /dev/null
@@ -1,42 +0,0 @@
-# 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.
-
-import os
-
-import unittest
-import time
-
-from TestUtils import TestUtilsMixin
-
-class NativeMapTest(TestUtilsMixin, unittest.TestCase):
-    "Native Map Unit Test"
-
-    order = 21
-    testClass=""
-
-    def setUp(self):
-        pass
-        
-    def runTest(self):
-        handle = self.runClassOn('localhost', 'org.apache.accumulo.test.functional.NativeMapTest', [])
-        self.waitForStop(handle, 20)
-
-    def tearDown(self):
-        pass
-
-def suite():
-    result = unittest.TestSuite()
-    result.addTest(NativeMapTest())
-    return result

http://git-wip-us.apache.org/repos/asf/accumulo/blob/7a1075a4/test/system/auto/simple/shell.py
----------------------------------------------------------------------
diff --git a/test/system/auto/simple/shell.py b/test/system/auto/simple/shell.py
deleted file mode 100755
index ae17ec7..0000000
--- a/test/system/auto/simple/shell.py
+++ /dev/null
@@ -1,474 +0,0 @@
-# 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.
-
-import os
-
-import logging
-import unittest
-import time
-from TestUtils import TestUtilsMixin, ROOT, ROOT_PASSWORD, ACCUMULO_HOME
-from subprocess import Popen as BasePopen, PIPE
-
-log = logging.getLogger('test.shell')
-      
-class ShellTest(TestUtilsMixin,unittest.TestCase):
-    """Start a clean accumulo, and test different shell functions.
-    Some other shell functions are tests in the systemp and tablep tests"""
-    
-    command_list = [ "help", "tables", "table", "createtable", "deletetable", 
-                    "insert", "scan", "user", "users", "delete",
-                    "flush", "config", "setiter", "deleteiter", "whoami", "debug",
-                    "tablepermissions", "userpermissions", "authenticate", "createuser",
-                    "dropuser", "passwd", "setauths", "getauths", "grant", "revoke" ]
-    
-    def setUp(self):     
-        TestUtilsMixin.setUp(self)
-        
-    def runTest(self):
-        self.badLoginTest()
-        self.setIterTest()
-        self.setScanIterTest()
-        self.iteratorsTest()
-        self.createtableTestSplits()
-        self.createtableTestCopyConfig()
-        self.classpathTest()
-        self.tableTest()
-        self.configTest()
-        self.helpTest()
-        self.tablesTest()
-        self.createtableTest()
-        self.deletetableTest()
-        self.scanTest()
-        self.insertTest()
-        self.flushTest()
-        self.whoamiTest()
-        self.getauthsTest()
-        
-        
-    def badLoginTest(self, **opts):
-      log.debug("Running shell with bad password")
-      handle = self.runOn(self.masterHost(), [self.accumulo_sh(), 'shell', '-u', ROOT, '-p', "ThisWouldBeATerriblePasswordToHave"], stdin=PIPE, **opts)
-      handle.communicate("quit\n")
-      self.failUnless(handle.returncode != 0, "Was able to create a shell with bad credentials")
-
-    def setIterTest(self):
-        input = 'setiter -t setitertest -n mymax -scan -p 10 -class org.apache.accumulo.core.iterators.user.MaxCombiner\n\ncf\n\nSTRING\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.failUnless(out.find("TableNotFoundException") >= 0,
-                        "Was able to setiter a table that didn't exist")
-        input = 'createtable setitertest\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        input = 'table setitertest\nsetiter -n mymax -scan -p 10 -class org.apache.accumulo.core.iterators.user.MaxCombiner\n\ncf1\n\nSTRING\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        input = 'setiter -t setitertest -n mymax -scan -p 10 -class org.apache.accumulo.core.iterators.user.MinCombiner\n\ncf2\n\nSTRING\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.failUnless(out.find("IllegalArgumentException") >= 0,
-                        "Was able to configure same iter name twice")
-        input = 'setiter -t setitertest -n mymin -scan -p 10 -class org.apache.accumulo.core.iterators.user.MinCombiner\n\ncf2\n\nSTRING\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.failUnless(out.find("IllegalArgumentException") >= 0,
-                        "Was able to configure same priority twice")
-        input = 'setiter -t setitertest -n mymin -scan -p 11 -class org.apache.accumulo.core.iterators.user.MinCombiner\n\ncf2\n\nSTRING\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        input = 'table setitertest\ninsert row1 cf1 cq 10\ninsert row1 cf1 cq 30\ninsert row1 cf1 cq 20\ninsert row1 cf2 cq 10\ninsert row1 cf2 cq 30\nscan -np\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        self.failIf(out.find("row1 cf1:cq []    30") == -1 or out.find("row1 cf2:cq []    10") == -1,
-                        "SetIter Failed:  combining failed")
-        
-    def setScanIterTest(self):
-        input = 'createtable setscanitertest\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        input = 'table setscanitertest\ninsert row cf cq val1\ninsert row cf cq val2\nscan -np\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        self.failIf(out.find("row cf:cq []    val1") == 1 or out.find("row cf:cq []    val2") == -1,
-                        "SetScanIter Failed:  default versioning failed")
-        input = 'setscaniter -t setscanitertest -n vers -p 20 -class org.apache.accumulo.core.iterators.user.VersioningIterator\n2\ntable setscanitertest\nscan -np\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        self.failIf(out.find("row cf:cq []    val1") == -1 or out.find("row cf:cq []    val2") == -1,
-                        "SetScanIter Failed:  versioning override failed")
-        input = 'table setscanitertest\nsetscaniter -n vers -p 20 -class org.apache.accumulo.core.iterators.user.VersioningIterator\n2\nscan -np\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        self.failIf(out.find("row cf:cq []    val1") == -1 or out.find("row cf:cq []    val2") == -1,
-                        "SetScanIter Failed:  set on current table failed") 
-        input = 'setscaniter -t setscanitertest -n vers -p 20 -class org.apache.accumulo.core.iterators.user.VersioningIterator\n2\ndeletescaniter -t setscanitertest -n vers\ntable setscanitertest\nscan -np\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        self.failIf(out.find("row cf:cq []    val1") == 1 or out.find("row cf:cq []    val2") == -1,
-                        "SetScanIter Failed:  deletescaniter (single) failed")
-        input = 'table setscanitertest\nsetscaniter -n vers -p 20 -class org.apache.accumulo.core.iterators.user.VersioningIterator\n2\ndeletescaniter -n vers\ntable setscanitertest\nscan -np\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        self.failIf(out.find("row cf:cq []    val1") == 1 or out.find("row cf:cq []    val2") == -1,
-                        "SetScanIter Failed:  deletescaniter on current table failed")
-        input = 'setscaniter -t setscanitertest -n vers -p 20 -class org.apache.accumulo.core.iterators.user.VersioningIterator\n2\ndeletescaniter -t setscanitertest -a\ntable setscanitertest\nscan -np\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        self.failIf(out.find("row cf:cq []    val1") == 1 or out.find("row cf:cq []    val2") == -1,
-                        "SetScanIter Failed:  deletescaniter (all) failed")
-        input = 'setscaniter -t setscanitertest -n vers -p 20 -class org.apache.accumulo.core.iterators.user.VersioningIterator\n2\nsetscaniter -t setscanitertest -n vers -p 10 -class org.apache.accumulo.core.iterators.user.VersioningIterator\n2\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        self.failUnless(out.find("IllegalArgumentException") >= 0,
-                        "Was able to configure same iter name twice")
-        input = 'setscaniter -t setscanitertest -n vers -p 20 -class org.apache.accumulo.core.iterators.user.VersioningIterator\n2\nsetscaniter -t setscanitertest -n vers2 -p 20 -class org.apache.accumulo.core.iterators.user.VersioningIterator\n2\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        self.failUnless(out.find("IllegalArgumentException") >= 0,
-                        "Was able to configure same priority twice")
-        
-    def classpathTest(self):
-        input = 'classpath\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        lines = out.split()
-        for line in lines:
-            self.failUnless(line.startswith("file:") >= 0 or
-                            line.startswith("List of classpath items are:") >= 0, 
-                            "Classpath command: Command didn't work or classpath items were formatted incorrectly");
-        
-    def iteratorsTest(self):
-        input = 'createtable filtertest\nsetiter -t filtertest -n myfilter -scan -p 10 -class org.apache.accumulo.core.iterators.user.AgeOffFilter\n\n4000\n\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        input = 'config -t filtertest -np\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        self.failIf(out.find("table.iterator.scan.myfilter.opt.ttl") == -1, 
-                        "Config Failed:  Iterator doesn't exist in the config")
-        input = 'table filtertest\ninsert foo a b c\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        input = 'table filtertest\nscan\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        self.failUnless(out.find("foo a:b") >= 0, "Scan Failed:  Entries don't exist")
-        # Wait until ageoff happens
-        self.sleep(5)
-        input = 'table filtertest\nscan\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        self.failUnless(out.find("foo a:b") == -1, "Scan Failed:  Entries didn't ageoff")
-        input = 'deleteiter -t filtertest -n myfilter -scan\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        input = 'config filtertest -np\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        self.failUnless(out.find("table.iterator.scan.myfilter.opt.ttl") == -1, 
-                        "Config Failed:  Iterator doesn't exist in the config")
-        input = 'table filtertest\nsetiter -n myfilter -scan -p 10 -class org.apache.accumulo.core.iterators.user.AgeOffFilter\n\n4000\n\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        input = 'config -t filtertest -np\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        self.failIf(out.find("table.iterator.scan.myfilter.opt.ttl") == -1,
-                        "Config Failed:  Iterator doesn't exist in the config")
-        input = 'table filtertest\ndeleteiter -n myfilter -scan\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        input = 'config filtertest -np\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        self.failUnless(out.find("table.iterator.scan.myfilter.opt.ttl") == -1,
-                        "Config Failed:  Iterator doesn't exist in the config")
-        
-    def configTest(self):
-        cf_option = "table.scan.max.memory"
-        cf_value = "9361234"
-        input = 'createtable t1\nconfig -t t1 -s %s=%s -np\n' % (cf_option, cf_value)
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        input = 'config -t t1 -np\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        lines = out.split("\n")
-        foundConfig = False
-        foundOverride = False
-        for line in lines:
-            if foundConfig:
-                self.failUnless(line.startswith("table") and line.find("@override") >= 0 and line.find(cf_value),
-                                 "Error setting or retrieving config values")
-                foundOverride = True
-                break
-            if line.find(cf_option) >= 0:
-                foundConfig = True
-        self.failUnless(foundConfig and foundOverride, "Did not find the configuration that was set")
-        input = 'config -t t1 -d %s -np\n' % cf_option
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        input = 'config -t t1 -np\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        lines = out.split("\n")
-        for line in lines:
-            self.failIf(line.find(cf_value) >= 0, "Could not delete the value")
-        
-    def helpTest(self):
-        commands = self.command_list
-        input = "help -np\n"
-        startLooking = False
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        lines = out.split("\n")
-        for line in lines:
-            line = line.rstrip()
-            if startLooking:
-                command = line.split("-")[0].rstrip()
-                if not command.startswith("\t") and command in commands:
-                    commands.remove(command)
-            else:
-                if line[-10:] == "> help -np":
-                    startLooking = True
-        log.debug("missing commands:" + ", ".join(commands))
-        self.failIf(len(commands) > 0, "help command doesn't cover all the commands") 
-        
-    def tablesTest(self):
-        input = "tables\n"
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        self.failUnless(out.find("!METADATA"), 
-                        "tables command does not return the correct tables" )
-    
-    def tableTest(self):
-        input = "table !METADATA\n"
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        self.failUnless(out.split("\n")[-1].find("!METADATA >"), 
-                        "table command does not switch context to the table")
-        input = "table null\n"
-        out2, err2, code2 = self.rootShell(self.masterHost(), input)
-        self.failUnless(out2.find("TableNotFoundException") >= 0, 
-                        "Was able to connect to a table that didn't exist")
-        
-    
-    def createtableTest(self):
-        input = "createtable test_table\n"
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        input = "tables\n"
-        out2, err2, code2 = self.rootShell(self.masterHost(), input)
-        self.processResult(out2, err2, code2)
-        self.failUnless(out2.find("test_table"), 
-                        "createtable command did not correctly create the table")
-        self.failUnless(out.split("\n")[-1].find("test_table >"), 
-                        "createtable command did not switch contexts to the new table")
-        
-    def createtableTestCopyConfig(self):
-        input = 'createtable cttest\nsetiter -t cttest -n myfilter -scan -p 10 -class org.apache.accumulo.core.iterators.user.AgeOffFilter\n\n2000\n\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        input = 'config -t cttest -np\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        self.failIf(out.find("table.iterator.scan.myfilter.opt.ttl") == -1, 
-                        "CreateTable Failed:  Iterator doesn't exist in the config")
-        input = 'createtable cttest2 -cc cttest\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        input = 'config -t cttest2 -np\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        self.failIf(out.find("table.iterator.scan.myfilter.opt.ttl") == -1, 
-                        "CreateTable Failed:  Iterator doesn't exist in the config after copying the table config")
-        
-    def createtableTestSplits(self):
-        splits_file = os.path.join(ACCUMULO_HOME, 'test','system','bench','lib','splits')
-        input = 'createtable splits_test -sf %s\n' % splits_file
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        input = 'table !METADATA\nscan\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        splitTestID = self.getTableId('splits_test')
-        splits = []
-        for a in out.split("\n"):
-            if a.startswith(splitTestID+';'):
-                split = a.split()[0].split(";",1)[1]
-                splits.append(split)
-        self.failUnless(len(splits) == 190*5, 
-                        "CreateTable Failed:  Splits were not created correctly")
-        input = 'createtable test_splits -cs splits_test\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        input = 'table !METADATA\nscan\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        testSplitsID = self.getTableId('test_splits')
-        for a in out.split("\n"):
-            if a.startswith(testSplitsID+';'):
-                split = a.split()[0].split(";",1)[1]
-                splits.remove(split)
-        self.failUnless(len(splits) == 0, 
-                        "CreateTable Failed:  Splits were not copied correctly")
-        input = 'createtable test_splits_2\naddsplits one\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        input = 'table !METADATA\nscan\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        splitTestID = self.getTableId('test_splits_2')
-        splits = []
-        for a in out.split("\n"):
-            if a.startswith(splitTestID+';'):
-                split = a.split()[0].split(";",1)[1]
-                splits.append(split)
-        log.debug(splits)
-        self.failUnless(len(splits) == 1*5 and splits[0] == 'one',
-                        "CreateTable Failed:  Splits were not created correctly (add one split)")
-        input = 'createtable test_splits_3\naddsplits -sf %s\n' % splits_file 
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        input = 'table !METADATA\nscan\n'
-        out,err,code = self.rootShell(self.masterHost(),input)
-        self.processResult(out, err, code)
-        splitTestID = self.getTableId('test_splits_3')
-        splits = []
-        for a in out.split("\n"):
-            if a.startswith(splitTestID+';'):
-                split = a.split()[0].split(";",1)[1]
-                splits.append(split)
-        self.failUnless(len(splits) == 190*5,
-                        "CreateTable Failed:  Splits were not created correctly (addsplits from file)")
-    
-    def deletetableTest(self):
-        create = "createtable test_delete_table\n"
-        out, err, code = self.rootShell(self.masterHost(), create)
-        self.processResult(out, err, code)
-        self.failUnless(out.split("\n")[-1].find("test_table >"), 
-                        "createtable command did not switch contexts to the new table")
-        delete = "deletetable -t test_delete_table\ny\n"
-        out, err, code = self.rootShell(self.masterHost(), delete)
-        self.processResult(out, err, code)
-        input = "tables\n"
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        self.failIf(out.find("test_delete_table") >= 0, 
-                        "deletetable command did not delete the table" )
-        delete = "createtable test_delete_table1\ncreatetable test_delete_table2\ndeletetable -p test_delete_table.* -f\n"
-        out, err, code = self.rootShell(self.masterHost(), delete)
-        self.processResult(out, err, code)
-        input = "tables\n"
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        self.failIf(out.find("test_delete_table") >= 0,
-                        "deletetable -p command did not delete the tables" )
-        delete = "createtable test_delete_table\ndeletetable\ny\n"
-        out, err, code = self.rootShell(self.masterHost(), delete)
-        self.processResult(out, err, code)
-        input = "tables\n"
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        self.failIf(out.find("test_delete_table") >= 0,
-                        "deletetable command did not delete the current table" )
-        delete = "createtable test_delete_table\ndeletetable test_delete_table -f\n"
-        out, err, code = self.rootShell(self.masterHost(), delete)
-        self.processResult(out, err, code)
-        input = "tables\n"
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        self.failIf(out.find("test_delete_table") >= 0,
-                        "deletetable command did not delete the current table" )
-        
-    def scanTest(self):
-        input = "createtable test_scan_table\n"
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        input = "table test_scan_table\ninsert one two three four\nscan\n"
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        self.failUnless(out.find("one") >= 0 and out.find("two") >= 0 and 
-                        out.find("three") >= 0 and out.find("four") >= 0 and
-                        out.find("one") < out.find("two") < 
-                        out.find("three") < out.find("four"), 
-                                    "scan command did not return the correct results")
-        input = "table test_scan_table\ndelete one two three\n"
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        input = "table test_scan_table\nscan\n"
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        self.failIf((out.find("one") >= 0) or (out.find("two") >= 0) or (out.find("three") >= 0),
-                                    "scan command did not return the correct results")
-        input = "table test_scan_table\ninsert one two three four -ts 42\nscan\n"
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        self.failUnless(out.find("one") >= 0 and out.find("two") >= 0 and
-                        out.find("three") >= 0 and out.find("four") >= 0 and
-                        out.find("one") < out.find("two") <
-                        out.find("three") < out.find("four"),
-                                    "scan command did not return the correct results")
-        input = "table test_scan_table\ndelete one two three -ts 42\n"
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        input = "table test_scan_table\nscan\n"
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        self.failIf(out.find("one") >= 0 or out.find("two") >= 0 or out.find("three") >= 0,
-                                    "scan command did not return the correct results")
-        
-    def insertTest(self):
-        input = "createtable test_insert_table\n"
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        input = "table test_insert_table\ninsert a b c d\n"
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        
-    def flushTest(self):
-        input = "flush -t !METADATA -w\n"
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        self.failUnless(out.find("Flush of table !METADATA completed") >= 0, 
-                        "flush command did not flush the tables")
-        input = "flush !METADATA -w\n"
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        self.failUnless(out.find("Flush of table !METADATA completed") >= 0,
-                        "flush command did not flush the tables")
-        input = "table !METADATA\nflush -w\n"
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        self.failUnless(out.find("Flush of table !METADATA completed") >= 0,
-                        "flush command did not flush the tables")
-        
-    def whoamiTest(self):
-        input = "whoami\n"
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        self.failUnless(out.find("root") >= 0, 
-                        "whoami command did not return the correct values")
-    def getauthsTest(self):
-        passwd = 'secret'
-        input = "createuser test_user\n%s\n%s\nsetauths -u test_user -s 12,3,4\n" % (passwd, passwd)
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        input = "getauths -u test_user\n"
-        out, err, code = self.rootShell(self.masterHost(), input)
-        self.processResult(out, err, code)
-        self.failUnless(out.find("3") >= 0 and out.find("4") >= 0 and out.find("12") >= 0, 
-                        "getauths command did not return the correct values")
-        
-def suite():  
-    result = unittest.TestSuite()
-    result.addTest(ShellTest())
-    return result 


Mime
View raw message