mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 17:35:43 +03:00
Test check header error conditions
This commit is contained in:
@@ -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",
|
||||
|
||||
28
jobspec/test-fixtures/service-check-bad-header-2.hcl
Normal file
28
jobspec/test-fixtures/service-check-bad-header-2.hcl
Normal 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]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
28
jobspec/test-fixtures/service-check-bad-header.hcl
Normal file
28
jobspec/test-fixtures/service-check-bad-header.hcl
Normal 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!"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user