Test check header error conditions

This commit is contained in:
Michael Schurter
2017-08-17 15:25:51 -07:00
parent f41475e9dd
commit 42041e5666
3 changed files with 66 additions and 0 deletions

View File

@@ -469,6 +469,16 @@ func TestParse(t *testing.T) {
},
false,
},
{
"service-check-bad-header.hcl",
nil,
true,
},
{
"service-check-bad-header-2.hcl",
nil,
true,
},
{
// TODO This should be pushed into the API
"vault_inheritance.hcl",

View File

@@ -0,0 +1,28 @@
job "check_bad_header" {
type = "service"
group "group" {
count = 1
task "task" {
service {
tags = ["bar"]
port = "http"
check {
name = "check-name"
type = "http"
path = "/"
method = "POST"
interval = "10s"
timeout = "2s"
initial_status = "passing"
header {
Authorization = ["ok", 840]
}
}
}
}
}
}

View File

@@ -0,0 +1,28 @@
job "check_bad_header" {
type = "service"
group "group" {
count = 1
task "task" {
service {
tags = ["bar"]
port = "http"
check {
name = "check-name"
type = "http"
path = "/"
method = "POST"
interval = "10s"
timeout = "2s"
initial_status = "passing"
header {
Authorization = "Should be a []string!"
}
}
}
}
}
}