agent: Update config test to handle zero value CheckUpdateInterval

This commit is contained in:
Armon Dadgar 2014-06-09 13:00:32 -07:00
parent bc9ea2af9a
commit ca0887b401
1 changed files with 32 additions and 30 deletions

View File

@ -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)