agent: tests for DNS truncate config

pull/378/head
Armon Dadgar 2014-09-30 13:04:31 -07:00
parent 365f7de415
commit 77436a15fd
1 changed files with 14 additions and 2 deletions

View File

@ -346,6 +346,17 @@ func TestDecodeConfig(t *testing.T) {
t.Fatalf("bad: %#v", config) t.Fatalf("bad: %#v", config)
} }
// DNS enable truncate
input = `{"dns_config": {"enable_truncate": true}}`
config, err = DecodeConfig(bytes.NewReader([]byte(input)))
if err != nil {
t.Fatalf("err: %s", err)
}
if !config.DNSConfig.EnableTruncate {
t.Fatalf("bad: %#v", config)
}
// CheckUpdateInterval // CheckUpdateInterval
input = `{"check_update_interval": "10m"}` input = `{"check_update_interval": "10m"}`
config, err = DecodeConfig(bytes.NewReader([]byte(input))) config, err = DecodeConfig(bytes.NewReader([]byte(input)))
@ -574,8 +585,9 @@ func TestMergeConfig(t *testing.T) {
ServiceTTL: map[string]time.Duration{ ServiceTTL: map[string]time.Duration{
"api": 10 * time.Second, "api": 10 * time.Second,
}, },
AllowStale: true, AllowStale: true,
MaxStale: 30 * time.Second, MaxStale: 30 * time.Second,
EnableTruncate: true,
}, },
Domain: "other", Domain: "other",
LogLevel: "info", LogLevel: "info",