2012-01-20 14:29:50 +01:00
|
|
|
/**
|
2013-01-09 01:47:48 +01:00
|
|
|
* Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>
|
2012-01-20 14:29:50 +01:00
|
|
|
*/
|
2011-11-22 13:04:10 +01:00
|
|
|
package akka.remote
|
2011-07-20 11:14:51 +03:00
|
|
|
|
2012-06-25 16:29:08 +02:00
|
|
|
import language.postfixOps
|
2011-10-11 16:05:48 +02:00
|
|
|
import akka.testkit.AkkaSpec
|
2012-01-25 16:50:06 +01:00
|
|
|
import akka.actor.ExtendedActorSystem
|
2012-09-21 14:50:06 +02:00
|
|
|
import scala.concurrent.duration._
|
2013-01-17 16:19:31 +01:00
|
|
|
import akka.remote.transport.AkkaProtocolSettings
|
|
|
|
|
import akka.util.{ Timeout, Helpers }
|
2013-02-11 13:33:21 +01:00
|
|
|
import akka.remote.transport.netty.SSLSettings
|
2011-07-20 11:14:51 +03:00
|
|
|
|
2011-10-21 17:01:22 +02:00
|
|
|
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
|
2012-01-25 16:50:06 +01:00
|
|
|
class RemoteConfigSpec extends AkkaSpec(
|
|
|
|
|
"""
|
2013-01-24 09:53:18 +01:00
|
|
|
akka.actor.provider = "akka.remote.RemoteActorRefProvider"
|
2013-01-17 16:19:31 +01:00
|
|
|
akka.remote.netty.tcp.port = 0
|
2012-01-25 16:50:06 +01:00
|
|
|
""") {
|
2011-07-20 11:14:51 +03:00
|
|
|
|
2012-12-18 12:54:17 +01:00
|
|
|
// FIXME: These tests are ignored as it tests configuration specific to the old remoting.
|
2012-01-30 11:48:02 +01:00
|
|
|
"Remoting" must {
|
|
|
|
|
|
2013-02-11 13:33:21 +01:00
|
|
|
"contain correct configuration values in reference.conf" in {
|
|
|
|
|
val remoteSettings = RARP(system).provider.remoteSettings
|
|
|
|
|
import remoteSettings._
|
|
|
|
|
|
|
|
|
|
LogReceive must be(false)
|
|
|
|
|
LogSend must be(false)
|
|
|
|
|
UntrustedMode must be(false)
|
2013-03-11 13:25:32 +01:00
|
|
|
LogRemoteLifecycleEvents must be(true)
|
2013-02-11 13:33:21 +01:00
|
|
|
ShutdownTimeout.duration must be(10 seconds)
|
|
|
|
|
FlushWait must be(2 seconds)
|
|
|
|
|
StartupTimeout.duration must be(10 seconds)
|
|
|
|
|
RetryGateClosedFor must be(Duration.Zero)
|
|
|
|
|
UnknownAddressGateClosedFor must be(1 minute)
|
|
|
|
|
UsePassiveConnections must be(true)
|
|
|
|
|
MaximumRetriesInWindow must be(5)
|
|
|
|
|
RetryWindow must be(3 seconds)
|
|
|
|
|
BackoffPeriod must be(10 millis)
|
|
|
|
|
CommandAckTimeout.duration must be(30 seconds)
|
|
|
|
|
Transports.size must be(1)
|
|
|
|
|
Transports.head._1 must be(classOf[akka.remote.transport.netty.NettyTransport].getName)
|
|
|
|
|
Transports.head._2 must be(Nil)
|
|
|
|
|
Adapters must be(Map(
|
|
|
|
|
"gremlin" -> classOf[akka.remote.transport.FailureInjectorProvider].getName,
|
|
|
|
|
"trttl" -> classOf[akka.remote.transport.ThrottlerProvider].getName))
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2013-03-11 13:25:32 +01:00
|
|
|
"be able to parse AkkaProtocol related config elements" in {
|
|
|
|
|
val settings = new AkkaProtocolSettings(RARP(system).provider.remoteSettings.config)
|
|
|
|
|
import settings._
|
|
|
|
|
|
|
|
|
|
WaitActivityEnabled must be(true)
|
|
|
|
|
FailureDetectorImplementationClass must be(classOf[PhiAccrualFailureDetector].getName)
|
|
|
|
|
AcceptableHeartBeatPause must be === 3.seconds
|
|
|
|
|
HeartBeatInterval must be === 1.seconds
|
|
|
|
|
RequireCookie must be(false)
|
|
|
|
|
SecureCookie must be === ""
|
|
|
|
|
|
|
|
|
|
FailureDetectorConfig.getDouble("threshold") must be(7.0 plusOrMinus 0.0001)
|
|
|
|
|
FailureDetectorConfig.getInt("max-sample-size") must be(100)
|
|
|
|
|
Duration(FailureDetectorConfig.getMilliseconds("min-std-deviation"), MILLISECONDS) must be(100 millis)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-11 13:33:21 +01:00
|
|
|
"contain correct socket worker pool configuration values in reference.conf" in {
|
2013-01-17 16:19:31 +01:00
|
|
|
val c = RARP(system).provider.remoteSettings.config.getConfig("akka.remote.netty.tcp")
|
2012-10-29 14:37:39 +01:00
|
|
|
|
|
|
|
|
// server-socket-worker-pool
|
|
|
|
|
{
|
|
|
|
|
val pool = c.getConfig("server-socket-worker-pool")
|
|
|
|
|
pool.getInt("pool-size-min") must equal(2)
|
2013-02-11 13:33:21 +01:00
|
|
|
|
2012-10-29 14:37:39 +01:00
|
|
|
pool.getDouble("pool-size-factor") must equal(1.0)
|
|
|
|
|
pool.getInt("pool-size-max") must equal(8)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// client-socket-worker-pool
|
|
|
|
|
{
|
|
|
|
|
val pool = c.getConfig("client-socket-worker-pool")
|
|
|
|
|
pool.getInt("pool-size-min") must equal(2)
|
|
|
|
|
pool.getDouble("pool-size-factor") must equal(1.0)
|
|
|
|
|
pool.getInt("pool-size-max") must equal(8)
|
|
|
|
|
}
|
2012-12-17 20:44:59 +01:00
|
|
|
|
2013-02-11 13:33:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
"contain correct ssl configuration values in reference.conf" in {
|
|
|
|
|
val sslSettings = new SSLSettings(system.settings.config.getConfig("akka.remote.netty.ssl.security"))
|
|
|
|
|
sslSettings.SSLKeyStore must be(Some("keystore"))
|
|
|
|
|
sslSettings.SSLKeyStorePassword must be(Some("changeme"))
|
2013-04-11 13:14:48 +02:00
|
|
|
sslSettings.SSLKeyPassword must be(Some("changeme"))
|
2013-02-11 13:33:21 +01:00
|
|
|
sslSettings.SSLTrustStore must be(Some("truststore"))
|
|
|
|
|
sslSettings.SSLTrustStorePassword must be(Some("changeme"))
|
|
|
|
|
sslSettings.SSLProtocol must be(Some("TLSv1"))
|
|
|
|
|
sslSettings.SSLEnabledAlgorithms must be(Set("TLS_RSA_WITH_AES_128_CBC_SHA"))
|
|
|
|
|
sslSettings.SSLRandomNumberGenerator must be(None)
|
2012-10-29 14:37:39 +01:00
|
|
|
}
|
2011-07-20 11:14:51 +03:00
|
|
|
}
|
|
|
|
|
}
|