Browse Source

agent: tests for DNS truncate config

pull/378/head
Armon Dadgar 10 years ago
parent
commit
77436a15fd
  1. 12
      command/agent/config_test.go

12
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)))
@ -576,6 +587,7 @@ func TestMergeConfig(t *testing.T) {
},
AllowStale: true,
MaxStale: 30 * time.Second,
EnableTruncate: true,
},
Domain: "other",
LogLevel: "info",

Loading…
Cancel
Save