mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 22:06:20 +00:00
agent: Update config test to handle zero value CheckUpdateInterval
This commit is contained in:
parent
8a0b86df10
commit
a2ac2af087
@ -419,20 +419,21 @@ func TestDecodeConfig_Check(t *testing.T) {
|
||||
|
||||
func TestMergeConfig(t *testing.T) {
|
||||
a := &Config{
|
||||
Bootstrap: false,
|
||||
Datacenter: "dc1",
|
||||
DataDir: "/tmp/foo",
|
||||
DNSRecursor: "127.0.0.1:1001",
|
||||
Domain: "basic",
|
||||
LogLevel: "debug",
|
||||
NodeName: "foo",
|
||||
ClientAddr: "127.0.0.1",
|
||||
BindAddr: "127.0.0.1",
|
||||
AdvertiseAddr: "127.0.0.1",
|
||||
Server: false,
|
||||
LeaveOnTerm: false,
|
||||
SkipLeaveOnInt: false,
|
||||
EnableDebug: false,
|
||||
Bootstrap: false,
|
||||
Datacenter: "dc1",
|
||||
DataDir: "/tmp/foo",
|
||||
DNSRecursor: "127.0.0.1:1001",
|
||||
Domain: "basic",
|
||||
LogLevel: "debug",
|
||||
NodeName: "foo",
|
||||
ClientAddr: "127.0.0.1",
|
||||
BindAddr: "127.0.0.1",
|
||||
AdvertiseAddr: "127.0.0.1",
|
||||
Server: false,
|
||||
LeaveOnTerm: false,
|
||||
SkipLeaveOnInt: false,
|
||||
EnableDebug: false,
|
||||
CheckUpdateIntervalRaw: "8m",
|
||||
}
|
||||
|
||||
b := &Config{
|
||||
@ -462,22 +463,23 @@ func TestMergeConfig(t *testing.T) {
|
||||
SerfWan: 5,
|
||||
Server: 6,
|
||||
},
|
||||
Server: true,
|
||||
LeaveOnTerm: true,
|
||||
SkipLeaveOnInt: true,
|
||||
EnableDebug: true,
|
||||
VerifyIncoming: true,
|
||||
VerifyOutgoing: true,
|
||||
CAFile: "test/ca.pem",
|
||||
CertFile: "test/cert.pem",
|
||||
KeyFile: "test/key.pem",
|
||||
Checks: []*CheckDefinition{nil},
|
||||
Services: []*ServiceDefinition{nil},
|
||||
StartJoin: []string{"1.1.1.1"},
|
||||
UiDir: "/opt/consul-ui",
|
||||
EnableSyslog: true,
|
||||
RejoinAfterLeave: true,
|
||||
CheckUpdateInterval: 8 * time.Minute,
|
||||
Server: true,
|
||||
LeaveOnTerm: true,
|
||||
SkipLeaveOnInt: true,
|
||||
EnableDebug: true,
|
||||
VerifyIncoming: true,
|
||||
VerifyOutgoing: true,
|
||||
CAFile: "test/ca.pem",
|
||||
CertFile: "test/cert.pem",
|
||||
KeyFile: "test/key.pem",
|
||||
Checks: []*CheckDefinition{nil},
|
||||
Services: []*ServiceDefinition{nil},
|
||||
StartJoin: []string{"1.1.1.1"},
|
||||
UiDir: "/opt/consul-ui",
|
||||
EnableSyslog: true,
|
||||
RejoinAfterLeave: true,
|
||||
CheckUpdateInterval: 8 * time.Minute,
|
||||
CheckUpdateIntervalRaw: "8m",
|
||||
}
|
||||
|
||||
c := MergeConfig(a, b)
|
||||
|
Loading…
x
Reference in New Issue
Block a user