Skip to content

Commit

Permalink
agent: more tests for config
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanuber committed Jan 9, 2015
1 parent 59ab069 commit 4ec78a8
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion command/agent/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,17 @@ func TestDecodeConfig_Services(t *testing.T) {
"script": "/bin/check_redis -p 6000",
"interval": "5s",
"ttl": "20s"
}
},
"checks": [
{
"script": "/bin/check_redis_read",
"interval": "1m"
},
{
"script": "/bin/check_redis_write",
"interval": "1m"
}
]
},
{
"id": "red1",
Expand Down Expand Up @@ -661,6 +671,16 @@ func TestDecodeConfig_Services(t *testing.T) {
Script: "/bin/check_redis -p 6000",
TTL: 20 * time.Second,
},
Checks: CheckTypes{
&CheckType{
Interval: time.Minute,
Script: "/bin/check_redis_read",
},
&CheckType{
Interval: time.Minute,
Script: "/bin/check_redis_write",
},
},
ID: "red0",
Name: "redis",
Tags: []string{
Expand Down Expand Up @@ -704,6 +724,13 @@ func TestDecodeConfig_Checks(t *testing.T) {
"name": "cpu",
"script": "/bin/check_cpu",
"interval": "10s"
},
{
"id": "chk3",
"name": "service:redis:tx",
"script": "/bin/check_redis_tx",
"interval": "1m",
"service_id": "redis"
}
]
}`
Expand Down Expand Up @@ -731,6 +758,15 @@ func TestDecodeConfig_Checks(t *testing.T) {
Interval: 10 * time.Second,
},
},
&CheckDefinition{
ID: "chk3",
Name: "service:redis:tx",
ServiceID: "redis",
CheckType: CheckType{
Script: "/bin/check_redis_tx",
Interval: time.Minute,
},
},
},
}

Expand Down

0 comments on commit 4ec78a8

Please sign in to comment.