From 1419182a5c5b5d88a3f99b3851451349d0fa8868 Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Tue, 30 Sep 2014 13:04:31 -0700 Subject: [PATCH] agent: tests for DNS truncate config --- command/agent/config_test.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/command/agent/config_test.go b/command/agent/config_test.go index e12178af2..a5a521fc0 100644 --- a/command/agent/config_test.go +++ b/command/agent/config_test.go @@ -346,6 +346,17 @@ func TestDecodeConfig(t *testing.T) { 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 input = `{"check_update_interval": "10m"}` config, err = DecodeConfig(bytes.NewReader([]byte(input))) @@ -574,8 +585,9 @@ func TestMergeConfig(t *testing.T) { ServiceTTL: map[string]time.Duration{ "api": 10 * time.Second, }, - AllowStale: true, - MaxStale: 30 * time.Second, + AllowStale: true, + MaxStale: 30 * time.Second, + EnableTruncate: true, }, Domain: "other", LogLevel: "info",