mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 11:48:43 -07:00
Add clustering to config reload tests
This commit is contained in:
@@ -20,3 +20,8 @@ authorization {
|
||||
password: T0pS3cr3t
|
||||
timeout: 2
|
||||
}
|
||||
|
||||
cluster {
|
||||
listen: localhost:-1
|
||||
no_advertise: true # enable on reload
|
||||
}
|
||||
|
||||
@@ -5,3 +5,8 @@ debug: false
|
||||
trace: false
|
||||
logtime: false
|
||||
log_file: "/tmp/gnatsd.log"
|
||||
|
||||
cluster {
|
||||
listen: localhost:-1
|
||||
no_advertise: false
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user