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:04:49 UTC

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

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


##########
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:
   Should we recover the System properties to avoid that this operation affect other tests?



-- 
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