-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-29957][TEST] Reset MiniKDC's default enctypes to fit jdk8/jdk11 #26594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
e9ef3ba
3ec2891
2e282f2
a224fad
3456ff9
dfdf589
7ab6192
476d60e
b782e99
10a0006
03f7fb1
e252dd0
4facbee
223533f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,14 +17,15 @@ | |
|
|
||
| package org.apache.spark.sql.kafka010 | ||
|
|
||
| import java.io.{File, IOException} | ||
| import java.io.{File, IOException, PrintWriter} | ||
| import java.net.{InetAddress, InetSocketAddress} | ||
| import java.nio.charset.StandardCharsets | ||
| import java.util.{Collections, Properties, UUID} | ||
| import java.util.concurrent.TimeUnit | ||
| import javax.security.auth.login.Configuration | ||
|
|
||
| import scala.collection.JavaConverters._ | ||
| import scala.io.Source | ||
| import scala.util.Random | ||
|
|
||
| import com.google.common.io.Files | ||
|
|
@@ -136,6 +137,20 @@ class KafkaTestUtils( | |
| kdcConf.setProperty(MiniKdc.DEBUG, "true") | ||
| kdc = new MiniKdc(kdcConf, kdcDir) | ||
| kdc.start() | ||
| val krb5Conf = Source.fromFile(kdc.getKrb5conf, "UTF-8").getLines() | ||
|
dongjoon-hyun marked this conversation as resolved.
|
||
| val rewriteKrb5Conf = krb5Conf.map(s => if (s.contains("libdefaults")) { | ||
|
AngersZhuuuu marked this conversation as resolved.
Outdated
|
||
| s + "\n" + | ||
|
AngersZhuuuu marked this conversation as resolved.
Outdated
|
||
| " default_tkt_enctypes=aes128-cts-hmac-sha1-96\n" + | ||
| " default_tgs_enctypes=aes128-cts-hmac-sha1-96 " | ||
|
AngersZhuuuu marked this conversation as resolved.
Outdated
|
||
| } else { | ||
| s | ||
| }) | ||
| kdc.getKrb5conf.delete() | ||
| val writer = new PrintWriter(kdc.getKrb5conf) | ||
| // scalastyle:off | ||
|
AngersZhuuuu marked this conversation as resolved.
Outdated
|
||
| rewriteKrb5Conf.foreach(writer.println) | ||
| writer.flush() | ||
|
AngersZhuuuu marked this conversation as resolved.
Outdated
|
||
| writer.close() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shall we use
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. - val writer = new PrintWriter(kdc.getKrb5conf)
- // scalastyle:off println
- writer.println(krb5confStr)
- // scalastyle:on println
- writer.close()
+ Files.write(krb5confStr, kdc.getKrb5conf, StandardCharsets.UTF_8)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Done thanks. |
||
| kdcReady = true | ||
| } | ||
|
|
||
|
|
@@ -171,6 +186,7 @@ class KafkaTestUtils( | |
| | useKeyTab=true | ||
| | storeKey=true | ||
| | useTicketCache=false | ||
| | refreshKrb5Config=true | ||
|
AngersZhuuuu marked this conversation as resolved.
|
||
| | keyTab="${zkServerKeytabFile.getAbsolutePath()}" | ||
| | principal="$zkServerUser@$realm"; | ||
| |}; | ||
|
|
@@ -180,6 +196,7 @@ class KafkaTestUtils( | |
| | useKeyTab=true | ||
| | storeKey=true | ||
| | useTicketCache=false | ||
| | refreshKrb5Config=true | ||
| | keyTab="${zkClientKeytabFile.getAbsolutePath()}" | ||
| | principal="$zkClientUser@$realm"; | ||
| |}; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.