accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject accumulo git commit: ACCUMULO-3660 Fix some broken ITs left from previous fix
Date Tue, 17 Mar 2015 19:27:31 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master f4ac49c65 -> 6ab9ac4a4


ACCUMULO-3660 Fix some broken ITs left from previous fix


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/6ab9ac4a
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/6ab9ac4a
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/6ab9ac4a

Branch: refs/heads/master
Commit: 6ab9ac4a4ec4e05d89391061a03b290a851a5dae
Parents: f4ac49c
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Tue Mar 17 15:27:06 2015 -0400
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Tue Mar 17 15:27:06 2015 -0400

----------------------------------------------------------------------
 .../org/apache/accumulo/harness/AccumuloIT.java    | 17 +++++++----------
 .../accumulo/harness/MiniClusterHarness.java       |  2 +-
 .../test/functional/ConfigurableMacIT.java         | 10 +++++++---
 .../accumulo/test/functional/MonitorSslIT.java     |  2 +-
 .../org/apache/accumulo/test/functional/SslIT.java |  2 +-
 .../test/replication/CyclicReplicationIT.java      |  2 +-
 6 files changed, 18 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/6ab9ac4a/test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java b/test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java
index d9d2e6a..03ee44c 100644
--- a/test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java
+++ b/test/src/test/java/org/apache/accumulo/harness/AccumuloIT.java
@@ -44,19 +44,16 @@ public class AccumuloIT {
   }
 
   /**
-   * Creates a directory for holding generated ssl files with the same name as the provided
directory, but with the suffix "-ssl" appended.
+   * Determines an appropriate directory name for holding generated ssl files for a test.
The directory returned will have the same name as the provided
+   * directory, but with the suffix "-ssl" appended. This new directory is not created here,
but is expected to be created as needed.
    *
-   * @param dir
+   * @param baseDir
    *          the original directory, which the new directory will be created next to; it
should exist
-   * @return the new directory, after it is created as a new empty directory; old contents,
if any, are removed first
+   * @return the new directory (is not created)
    */
-  public static File createSslDir(File dir) {
-    String suffix = "-ssl";
-    assertTrue(dir.exists() && dir.isDirectory());
-    File testDir = new File(dir.getParentFile(), dir.getName() + suffix);
-    FileUtils.deleteQuietly(testDir);
-    assertTrue(testDir.mkdir());
-    return testDir;
+  public static File getSslDir(File baseDir) {
+    assertTrue(baseDir.exists() && baseDir.isDirectory());
+    return new File(baseDir.getParentFile(), baseDir.getName() + "-ssl");
   }
 
   public static File createTestDir(String name) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/6ab9ac4a/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java b/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java
index 75e809c..5d32cb1 100644
--- a/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java
+++ b/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java
@@ -128,7 +128,7 @@ public class MiniClusterHarness {
     Configuration coreSite = new Configuration(false);
 
     // Setup SSL and credential providers if the properties request such
-    configureForEnvironment(cfg, getClass(), AccumuloClusterIT.createSslDir(baseDir), coreSite,
kdc);
+    configureForEnvironment(cfg, getClass(), AccumuloClusterIT.getSslDir(baseDir), coreSite,
kdc);
 
     // Invoke the callback for tests to configure MAC before it starts
     configCallback.configureMiniCluster(cfg, coreSite);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/6ab9ac4a/test/src/test/java/org/apache/accumulo/test/functional/ConfigurableMacIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ConfigurableMacIT.java
b/test/src/test/java/org/apache/accumulo/test/functional/ConfigurableMacIT.java
index 8c207c0..ad03f11 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/ConfigurableMacIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ConfigurableMacIT.java
@@ -42,6 +42,7 @@ import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
 import org.apache.accumulo.minicluster.impl.ZooKeeperBindException;
 import org.apache.accumulo.test.util.CertUtils;
 import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.commons.io.FileUtils;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.log4j.Logger;
 import org.apache.zookeeper.KeeperException;
@@ -72,15 +73,18 @@ public class ConfigurableMacIT extends AccumuloIT {
     }
   }
 
-  protected static void configureForSsl(MiniAccumuloConfigImpl cfg, File folder) {
+  protected static void configureForSsl(MiniAccumuloConfigImpl cfg, File sslDir) {
     Map<String,String> siteConfig = cfg.getSiteConfig();
     if ("true".equals(siteConfig.get(Property.INSTANCE_RPC_SSL_ENABLED.getKey()))) {
       // already enabled; don't mess with it
       return;
     }
 
-    File sslDir = new File(folder, "ssl");
+    // create parent directories, and ensure sslDir is empty
     assertTrue(sslDir.mkdirs() || sslDir.isDirectory());
+    FileUtils.deleteQuietly(sslDir);
+    assertTrue(sslDir.mkdir());
+
     File rootKeystoreFile = new File(sslDir, "root-" + cfg.getInstanceName() + ".jks");
     File localKeystoreFile = new File(sslDir, "local-" + cfg.getInstanceName() + ".jks");
     File publicTruststoreFile = new File(sslDir, "public-" + cfg.getInstanceName() + ".jks");
@@ -128,7 +132,7 @@ public class ConfigurableMacIT extends AccumuloIT {
     Configuration coreSite = new Configuration(false);
     configure(cfg, coreSite);
     cfg.setProperty(Property.TSERV_NATIVEMAP_ENABLED, Boolean.TRUE.toString());
-    configureForEnvironment(cfg, getClass(), createSslDir(baseDir));
+    configureForEnvironment(cfg, getClass(), getSslDir(baseDir));
     cluster = new MiniAccumuloClusterImpl(cfg);
     if (coreSite.size() > 0) {
       File csFile = new File(cluster.getConfig().getConfDir(), "core-site.xml");

http://git-wip-us.apache.org/repos/asf/accumulo/blob/6ab9ac4a/test/src/test/java/org/apache/accumulo/test/functional/MonitorSslIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/MonitorSslIT.java b/test/src/test/java/org/apache/accumulo/test/functional/MonitorSslIT.java
index 9dd27a3..197de7e 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/MonitorSslIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/MonitorSslIT.java
@@ -87,7 +87,7 @@ public class MonitorSslIT extends ConfigurableMacIT {
   public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
     super.configure(cfg, hadoopCoreSite);
     File baseDir = createTestDir(this.getClass().getName() + "_" + this.testName.getMethodName());
-    configureForSsl(cfg, createSslDir(baseDir));
+    configureForSsl(cfg, getSslDir(baseDir));
     Map<String,String> siteConfig = cfg.getSiteConfig();
     siteConfig.put(Property.MONITOR_SSL_KEYSTORE.getKey(), siteConfig.get(Property.RPC_SSL_KEYSTORE_PATH.getKey()));
     siteConfig.put(Property.MONITOR_SSL_KEYSTOREPASS.getKey(), siteConfig.get(Property.RPC_SSL_KEYSTORE_PASSWORD.getKey()));

http://git-wip-us.apache.org/repos/asf/accumulo/blob/6ab9ac4a/test/src/test/java/org/apache/accumulo/test/functional/SslIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/SslIT.java b/test/src/test/java/org/apache/accumulo/test/functional/SslIT.java
index 51cfad8..2d157b8 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/SslIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/SslIT.java
@@ -38,7 +38,7 @@ public class SslIT extends ConfigurableMacIT {
   @Override
   public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
     super.configure(cfg, hadoopCoreSite);
-    configureForSsl(cfg, createSslDir(createTestDir(this.getClass().getName() + "_" + this.testName.getMethodName())));
+    configureForSsl(cfg, getSslDir(createTestDir(this.getClass().getName() + "_" + this.testName.getMethodName())));
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/accumulo/blob/6ab9ac4a/test/src/test/java/org/apache/accumulo/test/replication/CyclicReplicationIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/replication/CyclicReplicationIT.java
b/test/src/test/java/org/apache/accumulo/test/replication/CyclicReplicationIT.java
index 7099d5b..6e7aabe 100644
--- a/test/src/test/java/org/apache/accumulo/test/replication/CyclicReplicationIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/replication/CyclicReplicationIT.java
@@ -158,7 +158,7 @@ public class CyclicReplicationIT {
       master1Cfg.setInstanceName("master1");
 
       // Set up SSL if needed
-      ConfigurableMacIT.configureForEnvironment(master1Cfg, this.getClass(), ConfigurableMacIT.createSslDir(master1Dir));
+      ConfigurableMacIT.configureForEnvironment(master1Cfg, this.getClass(), ConfigurableMacIT.getSslDir(master1Dir));
 
       master1Cfg.setProperty(Property.REPLICATION_NAME, master1Cfg.getInstanceName());
       master1Cfg.setProperty(Property.TSERV_WALOG_MAX_SIZE, "5M");


Mime
View raw message