HBASE-13280 TestSecureRPC failed

This commit is contained in:
zhangduo 2015-03-19 17:49:15 +08:00
parent 535ebbfde9
commit 27cf749af8
3 changed files with 3 additions and 9 deletions

View File

@ -26,7 +26,6 @@ import static org.junit.Assert.assertSame;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -72,7 +71,7 @@ public class TestSecureRPC {
private static MiniKdc KDC; private static MiniKdc KDC;
private static String HOST; private static String HOST = "localhost";
private static String PRINCIPAL; private static String PRINCIPAL;
@ -82,7 +81,6 @@ public class TestSecureRPC {
conf.put(MiniKdc.DEBUG, true); conf.put(MiniKdc.DEBUG, true);
KDC = new MiniKdc(conf, new File(TEST_UTIL.getDataTestDir("kdc").toUri().getPath())); KDC = new MiniKdc(conf, new File(TEST_UTIL.getDataTestDir("kdc").toUri().getPath()));
KDC.start(); KDC.start();
HOST = InetAddress.getLocalHost().getHostName();
PRINCIPAL = "hbase/" + HOST; PRINCIPAL = "hbase/" + HOST;
KDC.createPrincipal(KEYTAB_FILE, PRINCIPAL); KDC.createPrincipal(KEYTAB_FILE, PRINCIPAL);
HBaseKerberosUtils.setKeytabFileForTesting(KEYTAB_FILE.getAbsolutePath()); HBaseKerberosUtils.setKeytabFileForTesting(KEYTAB_FILE.getAbsolutePath());

View File

@ -28,7 +28,6 @@ import static org.junit.Assert.assertTrue;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.net.InetAddress;
import java.util.Properties; import java.util.Properties;
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
@ -51,7 +50,7 @@ public class TestUsersOperationsWithSecureHadoop {
private static MiniKdc KDC; private static MiniKdc KDC;
private static String HOST; private static String HOST = "localhost";
private static String PRINCIPAL; private static String PRINCIPAL;
@ -61,7 +60,6 @@ public class TestUsersOperationsWithSecureHadoop {
conf.put(MiniKdc.DEBUG, true); conf.put(MiniKdc.DEBUG, true);
KDC = new MiniKdc(conf, new File(TEST_UTIL.getDataTestDir("kdc").toUri().getPath())); KDC = new MiniKdc(conf, new File(TEST_UTIL.getDataTestDir("kdc").toUri().getPath()));
KDC.start(); KDC.start();
HOST = InetAddress.getLocalHost().getHostName();
PRINCIPAL = "hbase/" + HOST; PRINCIPAL = "hbase/" + HOST;
KDC.createPrincipal(KEYTAB_FILE, PRINCIPAL); KDC.createPrincipal(KEYTAB_FILE, PRINCIPAL);
HBaseKerberosUtils.setKeytabFileForTesting(KEYTAB_FILE.getAbsolutePath()); HBaseKerberosUtils.setKeytabFileForTesting(KEYTAB_FILE.getAbsolutePath());

View File

@ -22,7 +22,6 @@ import static org.junit.Assert.assertTrue;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.net.InetAddress;
import java.util.Properties; import java.util.Properties;
import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HBaseTestingUtility;
@ -70,7 +69,7 @@ public class TestGenerateDelegationToken {
.getPath()); .getPath());
private static MiniKdc KDC; private static MiniKdc KDC;
private static String HOST; private static String HOST = "localhost";
private static String USERNAME = System.getProperty("user.name"); private static String USERNAME = System.getProperty("user.name");
@ -82,7 +81,6 @@ public class TestGenerateDelegationToken {
conf.put(MiniKdc.DEBUG, true); conf.put(MiniKdc.DEBUG, true);
KDC = new MiniKdc(conf, new File(TEST_UTIL.getDataTestDir("kdc").toUri().getPath())); KDC = new MiniKdc(conf, new File(TEST_UTIL.getDataTestDir("kdc").toUri().getPath()));
KDC.start(); KDC.start();
HOST = InetAddress.getLocalHost().getHostName();
PRINCIPAL = USERNAME + "/" + HOST; PRINCIPAL = USERNAME + "/" + HOST;
KDC.createPrincipal(KEYTAB_FILE, PRINCIPAL); KDC.createPrincipal(KEYTAB_FILE, PRINCIPAL);
TEST_UTIL.getConfiguration().setBoolean("ipc.client.fallback-to-simple-auth-allowed", true); TEST_UTIL.getConfiguration().setBoolean("ipc.client.fallback-to-simple-auth-allowed", true);