Repository: sqoop Updated Branches: refs/heads/sqoop2 acc085406 -> 87515c56e
SQOOP-2813: Sqoop2: Enable kerberos for real Hadoop cluster in the integration test (Dian Fu 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/87515c56 Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/87515c56 Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/87515c56 Branch: refs/heads/sqoop2 Commit: 87515c56e8519335d33edcd91ad16487cd303d4d Parents: acc0854 Author: Jarek Jarcec Cecho <[email protected]> Authored: Fri Feb 19 07:22:35 2016 -0800 Committer: Jarek Jarcec Cecho <[email protected]> Committed: Fri Feb 19 07:22:35 2016 -0800 ---------------------------------------------------------------------- .../providers/HadoopInfrastructureProvider.java | 5 +- .../apache/sqoop/test/kdc/RealKdcRunner.java | 61 ++++++++++++++++++++ .../test/minicluster/RealSqoopCluster.java | 3 +- 3 files changed, 67 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sqoop/blob/87515c56/test/src/main/java/org/apache/sqoop/test/infrastructure/providers/HadoopInfrastructureProvider.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/sqoop/test/infrastructure/providers/HadoopInfrastructureProvider.java b/test/src/main/java/org/apache/sqoop/test/infrastructure/providers/HadoopInfrastructureProvider.java index 62f93fe..a761612 100644 --- a/test/src/main/java/org/apache/sqoop/test/infrastructure/providers/HadoopInfrastructureProvider.java +++ b/test/src/main/java/org/apache/sqoop/test/infrastructure/providers/HadoopInfrastructureProvider.java @@ -18,6 +18,7 @@ package org.apache.sqoop.test.infrastructure.providers; import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.security.UserGroupInformation; import org.apache.log4j.Logger; import org.apache.sqoop.test.hadoop.HadoopMiniClusterRunner; import org.apache.sqoop.test.hadoop.HadoopRunner; @@ -61,7 +62,9 @@ public class HadoopInfrastructureProvider extends InfrastructureProvider { @Override public void setHadoopConfiguration(Configuration conf) { try { - instance.setConfiguration(instance.prepareConfiguration(conf)); + Configuration newConf = instance.prepareConfiguration(conf); + instance.setConfiguration(newConf); + UserGroupInformation.setConfiguration(newConf); } catch (Exception e) { LOG.error("Could not set configuration.", e); } http://git-wip-us.apache.org/repos/asf/sqoop/blob/87515c56/test/src/main/java/org/apache/sqoop/test/kdc/RealKdcRunner.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/sqoop/test/kdc/RealKdcRunner.java b/test/src/main/java/org/apache/sqoop/test/kdc/RealKdcRunner.java new file mode 100644 index 0000000..76f0363 --- /dev/null +++ b/test/src/main/java/org/apache/sqoop/test/kdc/RealKdcRunner.java @@ -0,0 +1,61 @@ +/** + * 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; + +/** + * Represents a real kdc setup. It should be used together with + * real clusters such as RealSqoopCluster, HadoopRealClusterRunner etc. + */ +public class RealKdcRunner 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 + } +} http://git-wip-us.apache.org/repos/asf/sqoop/blob/87515c56/test/src/main/java/org/apache/sqoop/test/minicluster/RealSqoopCluster.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/sqoop/test/minicluster/RealSqoopCluster.java b/test/src/main/java/org/apache/sqoop/test/minicluster/RealSqoopCluster.java index cf19730..8bdf8b8 100644 --- a/test/src/main/java/org/apache/sqoop/test/minicluster/RealSqoopCluster.java +++ b/test/src/main/java/org/apache/sqoop/test/minicluster/RealSqoopCluster.java @@ -66,6 +66,7 @@ public class RealSqoopCluster extends SqoopMiniCluster { @Override public String getConfigurationPath() { - return "/etc/hadoop/conf/"; + return System.getProperty( + "sqoop.hadoop.config.path", "/etc/hadoop/conf"); } }
