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

    https://github.com/apache/spark/pull/3571#discussion_r23138756
  
    --- Diff: core/src/test/scala/org/apache/spark/util/AkkaUtilsSuite.scala ---
    @@ -209,4 +213,171 @@ class AkkaUtilsSuite extends FunSuite with 
LocalSparkContext with ResetSystemPro
         slaveSystem.shutdown()
       }
     
    +  test("remote fetch ssl on") {
    +    val conf = sparkSSLConfig()
    +    val securityManager = new SecurityManager(conf)
    +
    +    val hostname = "localhost"
    +    val (actorSystem, boundPort) = AkkaUtils.createActorSystem("spark", 
hostname, 0,
    +      conf = conf, securityManager = securityManager)
    +    System.setProperty("spark.hostPort", hostname + ":" + boundPort)
    +
    +    assert(securityManager.isAuthenticationEnabled() === false)
    +
    +    val masterTracker = new MapOutputTrackerMaster(conf)
    +    masterTracker.trackerActor = actorSystem.actorOf(
    +      Props(new MapOutputTrackerMasterActor(masterTracker, conf)), 
"MapOutputTracker")
    +
    +    val slaveConf = sparkSSLConfig()
    +    val securityManagerBad = new SecurityManager(slaveConf)
    +
    +    val (slaveSystem, _) = AkkaUtils.createActorSystem("spark-slave", 
hostname, 0,
    +      conf = slaveConf, securityManager = securityManagerBad)
    +    val slaveTracker = new MapOutputTrackerWorker(conf)
    +    val selection = slaveSystem.actorSelection(
    +      AkkaUtils.address("spark", "localhost", boundPort, 
"MapOutputTracker", conf))
    +    val timeout = AkkaUtils.lookupTimeout(conf)
    +    slaveTracker.trackerActor = 
Await.result(selection.resolveOne(timeout), timeout)
    +
    +    assert(securityManagerBad.isAuthenticationEnabled() === false)
    +
    +    masterTracker.registerShuffle(10, 1)
    +    masterTracker.incrementEpoch()
    +    slaveTracker.updateEpoch(masterTracker.getEpoch)
    +
    +    val size1000 = MapStatus.decompressSize(MapStatus.compressSize(1000L))
    +    masterTracker.registerMapOutput(10, 0,
    +      MapStatus(BlockManagerId("a", "hostA", 1000), Array(1000L)))
    +    masterTracker.incrementEpoch()
    +    slaveTracker.updateEpoch(masterTracker.getEpoch)
    +
    +    // this should succeed since security off
    +    assert(slaveTracker.getServerStatuses(10, 0).toSeq ===
    +      Seq((BlockManagerId("a", "hostA", 1000), size1000)))
    +
    +    actorSystem.shutdown()
    +    slaveSystem.shutdown()
    +  }
    +
    +
    +  test("remote fetch ssl on and security enabled") {
    +    val conf = sparkSSLConfig()
    +    conf.set("spark.authenticate", "true")
    +    conf.set("spark.authenticate.secret", "good")
    +    val securityManager = new SecurityManager(conf)
    +
    +    val hostname = "localhost"
    +    val (actorSystem, boundPort) = AkkaUtils.createActorSystem("spark", 
hostname, 0,
    +      conf = conf, securityManager = securityManager)
    +    System.setProperty("spark.hostPort", hostname + ":" + boundPort)
    +
    +    assert(securityManager.isAuthenticationEnabled() === true)
    +
    +    val masterTracker = new MapOutputTrackerMaster(conf)
    +    masterTracker.trackerActor = actorSystem.actorOf(
    +      Props(new MapOutputTrackerMasterActor(masterTracker, conf)), 
"MapOutputTracker")
    +
    +    val slaveConf = sparkSSLConfig()
    +    slaveConf.set("spark.authenticate", "true")
    +    slaveConf.set("spark.authenticate.secret", "good")
    +    val securityManagerBad = new SecurityManager(slaveConf)
    +
    +    val (slaveSystem, _) = AkkaUtils.createActorSystem("spark-slave", 
hostname, 0,
    +      conf = slaveConf, securityManager = securityManagerBad)
    +    val slaveTracker = new MapOutputTrackerWorker(conf)
    +    val selection = slaveSystem.actorSelection(
    +      AkkaUtils.address("spark", "localhost", boundPort, 
"MapOutputTracker", conf))
    +    val timeout = AkkaUtils.lookupTimeout(conf)
    +    slaveTracker.trackerActor = 
Await.result(selection.resolveOne(timeout), timeout)
    +
    +    assert(securityManagerBad.isAuthenticationEnabled() === true)
    +
    +    masterTracker.registerShuffle(10, 1)
    +    masterTracker.incrementEpoch()
    +    slaveTracker.updateEpoch(masterTracker.getEpoch)
    +
    +    val size1000 = MapStatus.decompressSize(MapStatus.compressSize(1000L))
    +    masterTracker.registerMapOutput(10, 0,
    +      MapStatus(BlockManagerId("a", "hostA", 1000), Array(1000L)))
    +    masterTracker.incrementEpoch()
    +    slaveTracker.updateEpoch(masterTracker.getEpoch)
    +
    +    // this should succeed since security off
    --- End diff --
    
    This is the "remote fetch ssl on and security enabled" test, so this 
comment seems wrong.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to