From ca0887b4018977e42918b5b62db66b0cf756c03c Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Mon, 9 Jun 2014 13:00:32 -0700 Subject: [PATCH] agent: Update config test to handle zero value CheckUpdateInterval --- command/agent/config_test.go | 62 +++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/command/agent/config_test.go b/command/agent/config_test.go index b1e2ef4c2..45da38354 100644 --- a/command/agent/config_test.go +++ b/command/agent/config_test.go @@ -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)