You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by jiangxb1987 <gi...@git.apache.org> on 2018/02/22 15:36:10 UTC

[GitHub] spark pull request #20652: [SPARK-23476][CORE] Generate secret in local mode...

Github user jiangxb1987 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20652#discussion_r169996395
  
    --- Diff: core/src/test/scala/org/apache/spark/SecurityManagerSuite.scala ---
    @@ -440,23 +440,41 @@ class SecurityManagerSuite extends SparkFunSuite with ResetSystemProperties {
         assert(keyFromEnv === new SecurityManager(conf2).getSecretKey())
       }
     
    -  test("secret key generation in yarn mode") {
    -    val conf = new SparkConf()
    -      .set(NETWORK_AUTH_ENABLED, true)
    -      .set(SparkLauncher.SPARK_MASTER, "yarn")
    -    val mgr = new SecurityManager(conf)
    -
    -    UserGroupInformation.createUserForTesting("authTest", Array()).doAs(
    -      new PrivilegedExceptionAction[Unit]() {
    -        override def run(): Unit = {
    -          mgr.initializeAuth()
    -          val creds = UserGroupInformation.getCurrentUser().getCredentials()
    -          val secret = creds.getSecretKey(SecurityManager.SECRET_LOOKUP_KEY)
    -          assert(secret != null)
    -          assert(new String(secret, UTF_8) === mgr.getSecretKey())
    +  test("secret key generation") {
    +    Seq(
    +      ("yarn", true),
    +      ("local", true),
    +      ("local[*]", true),
    +      ("local[1,2]", true),
    --- End diff --
    
    nit: `local[1,2]` -> `local[1, 2]`


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org