sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject sqoop git commit: SQOOP-2860: Sqoop2: Should be able to run integration tests on a real cluster without kerberos
Date Wed, 02 Mar 2016 23:11:35 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 d6a24fc0b -> d6885ae0c


SQOOP-2860:  Sqoop2: Should be able to run integration tests on a real cluster without kerberos

(Abraham Fine via Jarek Jarcec Cecho)


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

Branch: refs/heads/sqoop2
Commit: d6885ae0c2c6a426ffa9154b20a40c399ce7d584
Parents: d6a24fc
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Wed Mar 2 15:10:53 2016 -0800
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Wed Mar 2 15:10:53 2016 -0800

----------------------------------------------------------------------
 .../test/hadoop/HadoopRealClusterRunner.java    |  2 +-
 .../test/infrastructure/SqoopTestCase.java      | 17 +++++-
 .../org/apache/sqoop/test/kdc/NoKdcRunner.java  | 60 ++++++++++++++++++++
 3 files changed, 75 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/d6885ae0/test/src/main/java/org/apache/sqoop/test/hadoop/HadoopRealClusterRunner.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/sqoop/test/hadoop/HadoopRealClusterRunner.java
b/test/src/main/java/org/apache/sqoop/test/hadoop/HadoopRealClusterRunner.java
index 0816067..21f99ab 100644
--- a/test/src/main/java/org/apache/sqoop/test/hadoop/HadoopRealClusterRunner.java
+++ b/test/src/main/java/org/apache/sqoop/test/hadoop/HadoopRealClusterRunner.java
@@ -46,7 +46,7 @@ public class HadoopRealClusterRunner extends HadoopRunner {
   public Configuration prepareConfiguration(Configuration config)
       throws Exception {
     String configPath = System.getProperty(
-        "sqoop.hadoop.config.path", "/etc/hadoop/conf");
+        "sqoop.hadoop.localconfig.path", "/etc/hadoop/conf");
     LOG.debug("Config path is: " + configPath);
 
     File dir = new File(configPath);

http://git-wip-us.apache.org/repos/asf/sqoop/blob/d6885ae0/test/src/main/java/org/apache/sqoop/test/infrastructure/SqoopTestCase.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/sqoop/test/infrastructure/SqoopTestCase.java b/test/src/main/java/org/apache/sqoop/test/infrastructure/SqoopTestCase.java
index e3fbe31..9e1c683 100644
--- a/test/src/main/java/org/apache/sqoop/test/infrastructure/SqoopTestCase.java
+++ b/test/src/main/java/org/apache/sqoop/test/infrastructure/SqoopTestCase.java
@@ -46,6 +46,7 @@ import org.apache.sqoop.test.infrastructure.providers.InfrastructureProvider;
 import org.apache.sqoop.test.infrastructure.providers.KdcInfrastructureProvider;
 import org.apache.sqoop.test.infrastructure.providers.SqoopInfrastructureProvider;
 import org.apache.sqoop.test.kdc.KdcRunner;
+import org.apache.sqoop.test.kdc.NoKdcRunner;
 import org.apache.sqoop.test.utils.HdfsUtils;
 import org.apache.sqoop.test.utils.SqoopUtils;
 import org.apache.sqoop.utils.UrlSafeUtils;
@@ -182,10 +183,13 @@ public class SqoopTestCase implements ITest {
       KdcInfrastructureProvider kdcProviderObject = startInfrastructureProvider(KdcInfrastructureProvider.class,
conf, null);
       kdc = kdcProviderObject.getInstance();
       providers.remove(KdcInfrastructureProvider.class);
-      conf = kdc.prepareHadoopConfiguration(conf);
+      if (kdc instanceof NoKdcRunner) {
+        conf = setNonKerberosConfiguration(conf);
+      } else {
+        conf = kdc.prepareHadoopConfiguration(conf);
+      }
     } else {
-      conf.set("dfs.block.access.token.enable", "false");
-      conf.set("hadoop.security.authentication", "simple");
+      conf = setNonKerberosConfiguration(conf);
     }
 
     // Start hadoop secondly.
@@ -205,6 +209,13 @@ public class SqoopTestCase implements ITest {
     }
   }
 
+  private static Configuration setNonKerberosConfiguration(Configuration conf) {
+    conf.set("dfs.block.access.token.enable", "false");
+    conf.set("hadoop.security.authentication", "simple");
+
+    return conf;
+  }
+
   /**
    * Start an infrastructure provider and add it to the PROVIDERS map
    * for stopping in the future.

http://git-wip-us.apache.org/repos/asf/sqoop/blob/d6885ae0/test/src/main/java/org/apache/sqoop/test/kdc/NoKdcRunner.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/sqoop/test/kdc/NoKdcRunner.java b/test/src/main/java/org/apache/sqoop/test/kdc/NoKdcRunner.java
new file mode 100644
index 0000000..6346d35
--- /dev/null
+++ b/test/src/main/java/org/apache/sqoop/test/kdc/NoKdcRunner.java
@@ -0,0 +1,60 @@
+/**
+ * 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.sqoop.test.kdc;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticatedURL;
+import org.apache.sqoop.client.SqoopClient;
+
+import java.net.URL;
+import java.util.Map;
+
+/**
+ * Special instance of KdcRunner that allows us to not use kerberos
+ */
+public class NoKdcRunner extends KdcRunner {
+  @Override
+  public Configuration prepareHadoopConfiguration(Configuration config) throws Exception
{
+    return config;
+  }
+
+  @Override
+  public Map<String, String> prepareSqoopConfiguration(Map<String, String> properties)
{
+    return properties;
+  }
+
+  @Override
+  public void start() throws Exception {
+    // Do nothing
+  }
+
+  @Override
+  public void stop() throws Exception {
+    // Do nothing
+  }
+
+  @Override
+  public void authenticateWithSqoopServer(SqoopClient client) throws Exception {
+    // Do nothing
+  }
+
+  @Override
+  public void authenticateWithSqoopServer(URL url, DelegationTokenAuthenticatedURL.Token
authToken) throws Exception {
+    // Do nothing
+  }
+}


Mime
View raw message