Repository: kudu Updated Branches: refs/heads/master 06afa8f04 -> eb4d88f0a
[Java] Fix TestSecurity tests on Mac TestSecurity tests were failing because InetAddress.getCanonicalHostName was returning localhost for the 127.0.0.1 IP address which results Kerberos rejecting as not kinitâd. Other tests donât have this issue because they extend BaseKuduTest which installs the FakeDNS workaround for 127.* IP addresses. This patch adds the FakeDNS setup to the TestSecurity class. Change-Id: Ic61680f37c2d589ae4f5b553e69bc0b9eb15588d Reviewed-on: http://gerrit.cloudera.org:8080/10298 Reviewed-by: Dan Burkert <danburk...@apache.org> Tested-by: Kudu Jenkins Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/ff4b67e3 Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/ff4b67e3 Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/ff4b67e3 Branch: refs/heads/master Commit: ff4b67e3b72f08d0e77d1803027ebaad965f6403 Parents: 06afa8f Author: Grant Henke <granthe...@apache.org> Authored: Thu May 3 15:42:26 2018 -0500 Committer: Grant Henke <granthe...@apache.org> Committed: Thu May 3 21:40:58 2018 +0000 ---------------------------------------------------------------------- .../src/test/java/org/apache/kudu/client/TestSecurity.java | 6 ++++++ 1 file changed, 6 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/ff4b67e3/java/kudu-client/src/test/java/org/apache/kudu/client/TestSecurity.java ---------------------------------------------------------------------- diff --git a/java/kudu-client/src/test/java/org/apache/kudu/client/TestSecurity.java b/java/kudu-client/src/test/java/org/apache/kudu/client/TestSecurity.java index 76e59cc..fc851e2 100644 --- a/java/kudu-client/src/test/java/org/apache/kudu/client/TestSecurity.java +++ b/java/kudu-client/src/test/java/org/apache/kudu/client/TestSecurity.java @@ -36,6 +36,7 @@ import org.apache.kudu.util.SecurityUtil; import org.hamcrest.CoreMatchers; import org.junit.After; import org.junit.Assert; +import org.junit.BeforeClass; import org.junit.Test; import com.google.common.base.Preconditions; @@ -83,6 +84,11 @@ public class TestSecurity { client.listTabletServers(); } + @BeforeClass + public static void setUpBeforeClass() throws Exception { + FakeDNS.getInstance().install(); + } + @After public void reset() throws IOException, InterruptedException { if (client != null) {