You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by GitBox <gi...@apache.org> on 2022/08/26 07:32:51 UTC

[GitHub] [incubator-uniffle] zuston commented on a diff in pull request #184: [FOLLOWUP] Add the conf of rss.security.hadoop.krb5-conf.file

zuston commented on code in PR #184:
URL: https://github.com/apache/incubator-uniffle/pull/184#discussion_r955746966


##########
common/src/test/java/org/apache/uniffle/common/security/HadoopSecurityContextTest.java:
##########
@@ -119,5 +117,28 @@ public void testCreateIllegalContext() throws Exception {
     } catch (Exception e) {
       assertTrue(e.getMessage().contains("refreshIntervalSec must be not negative"));
     }
+
+    // case4: lack krb5 conf, should throw exception
+    String krbConfFilePath = System.getProperty("java.security.krb5.conf");
+    System.clearProperty("java.security.krb5.conf");
+    try {
+      HadoopSecurityContext context = new HadoopSecurityContext(
+          null,
+          kerberizedHdfs.getHdfsKeytab(),
+          kerberizedHdfs.getHdfsPrincipal(),
+          100
+      );
+      fail();
+    } catch (Exception e) {
+      assertTrue(e.getMessage().contains("Cannot locate KDC"));
+    }
+
+    // case5: After setting the krb5 conf, it should pass
+    HadoopSecurityContext context = new HadoopSecurityContext(
+        krbConfFilePath,
+        kerberizedHdfs.getHdfsKeytab(),
+        kerberizedHdfs.getHdfsPrincipal(),
+        100
+    );

Review Comment:
   The System properties will been reset in HadoopSecurityContext. But I think explicitly recovering properties is also OK in this case.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org