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 62f93fe6..a7616124 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 void stop() { @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); } 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 00000000..76f03637 --- /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 prepareSqoopConfiguration(Map 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 + } +} 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 cf19730c..8bdf8b82 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 String getServerUrl() { @Override public String getConfigurationPath() { - return "/etc/hadoop/conf/"; + return System.getProperty( + "sqoop.hadoop.config.path", "/etc/hadoop/conf"); } }