Add clustering to config reload tests

This commit is contained in:
Tyler Treat
2017-06-19 14:40:57 -05:00
parent 564f498fe8
commit 2ea1afd82d
3 changed files with 25 additions and 0 deletions

View File

@@ -20,3 +20,8 @@ authorization {
password: T0pS3cr3t
timeout: 2
}
cluster {
listen: localhost:-1
no_advertise: true # enable on reload
}

View File

@@ -5,3 +5,8 @@ debug: false
trace: false
logtime: false
log_file: "/tmp/gnatsd.log"
cluster {
listen: localhost:-1
no_advertise: false
}

View File

@@ -48,6 +48,10 @@ func TestConfigReloadUnsupported(t *testing.T) {
PingInterval: 2 * time.Minute,
MaxPingsOut: 2,
WriteDeadline: 2 * time.Second,
Cluster: ClusterOpts{
Host: "localhost",
Port: -1,
},
}
processOptions(golden)
@@ -109,6 +113,10 @@ func TestConfigReloadInvalidConfig(t *testing.T) {
PingInterval: 2 * time.Minute,
MaxPingsOut: 2,
WriteDeadline: 2 * time.Second,
Cluster: ClusterOpts{
Host: "localhost",
Port: -1,
},
}
processOptions(golden)
@@ -170,6 +178,10 @@ func TestConfigReload(t *testing.T) {
PingInterval: 2 * time.Minute,
MaxPingsOut: 2,
WriteDeadline: 2 * time.Second,
Cluster: ClusterOpts{
Host: "localhost",
Port: -1,
},
}
processOptions(golden)
@@ -229,6 +241,9 @@ func TestConfigReload(t *testing.T) {
if !server.info.AuthRequired {
t.Fatal("Expected AuthRequired to be true")
}
if !updated.Cluster.NoAdvertise {
t.Fatal("Expected NoAdvertise to be true")
}
}
// Ensure Reload supports TLS config changes. Test this by starting a server