You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by gr...@apache.org on 2018/05/03 22:04:15 UTC

kudu git commit: [Java] Fix TestSecurity tests on Mac

Repository: kudu
Updated Branches:
  refs/heads/branch-1.7.x ffc01ab72 -> fb4bc2f64


[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/10299
Reviewed-by: Dan Burkert <da...@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/fb4bc2f6
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/fb4bc2f6
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/fb4bc2f6

Branch: refs/heads/branch-1.7.x
Commit: fb4bc2f6422b122b23ca0329c87378546b5f4556
Parents: ffc01ab
Author: Grant Henke <gr...@apache.org>
Authored: Thu May 3 15:42:26 2018 -0500
Committer: Grant Henke <gr...@apache.org>
Committed: Thu May 3 22:04:05 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/fb4bc2f6/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 762d12c..833d649 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) {