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-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)
|
2013-03-27 17:47:56 +01:00
|
|
|
SysMsgAckTimeout must be(0.3 seconds)
|
|
|
|
|
SysResendTimeout must be(1 seconds)
|
|
|
|
|
SysMsgBufferSize must be(1000)
|
2013-04-18 17:35:43 +02:00
|
|
|
QuarantineDuration must be(60 seconds)
|
2013-02-11 13:33:21 +01:00
|
|
|
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-04-15 09:26:51 +02:00
|
|
|
WatchFailureDetectorImplementationClass must be(classOf[PhiAccrualFailureDetector].getName)
|
|
|
|
|
WatchHeartBeatInterval must be(1 seconds)
|
|
|
|
|
WatchHeartbeatExpectedResponseAfter must be(3 seconds)
|
|
|
|
|
WatchUnreachableReaperInterval must be(1 second)
|
|
|
|
|
WatchFailureDetectorConfig.getDouble("threshold") must be(10.0 plusOrMinus 0.0001)
|
|
|
|
|
WatchFailureDetectorConfig.getInt("max-sample-size") must be(200)
|
|
|
|
|
Duration(WatchFailureDetectorConfig.getMilliseconds("acceptable-heartbeat-pause"), MILLISECONDS) must be(4 seconds)
|
|
|
|
|
Duration(WatchFailureDetectorConfig.getMilliseconds("min-std-deviation"), MILLISECONDS) must be(100 millis)
|
|
|
|
|
|
2013-04-28 08:32:58 +02:00
|
|
|
remoteSettings.config.getString("akka.remote.log-frame-size-exceeding") must be("off")
|
2013-02-11 13:33:21 +01:00
|
|
|
}
|
|
|
|
|
|
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._
|
|
|
|
|
|
|
|
|
|
RequireCookie must be(false)
|
2013-03-27 17:47:56 +01:00
|
|
|
SecureCookie must be === None
|
2013-03-11 13:25:32 +01:00
|
|
|
|
2013-04-15 09:26:51 +02:00
|
|
|
TransportFailureDetectorImplementationClass must be(classOf[PhiAccrualFailureDetector].getName)
|
|
|
|
|
TransportHeartBeatInterval must be === 1.seconds
|
|
|
|
|
TransportFailureDetectorConfig.getDouble("threshold") must be(7.0 plusOrMinus 0.0001)
|
|
|
|
|
TransportFailureDetectorConfig.getInt("max-sample-size") must be(100)
|
|
|
|
|
Duration(TransportFailureDetectorConfig.getMilliseconds("acceptable-heartbeat-pause"), MILLISECONDS) must be(3 seconds)
|
|
|
|
|
Duration(TransportFailureDetectorConfig.getMilliseconds("min-std-deviation"), MILLISECONDS) must be(100 millis)
|
2013-03-11 13:25:32 +01:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2013-04-28 08:32:58 +02:00
|
|
|
"contain correct netty.tcp values in reference.conf" in {
|
|
|
|
|
val c = RARP(system).provider.remoteSettings.config.getConfig("akka.remote.netty.tcp")
|
|
|
|
|
|
|
|
|
|
c.getBytes("maximum-frame-size") must be(128000)
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
}
|