jobspec: add test for types of nested configs

This commit is contained in:
Mitchell Hashimoto 2015-11-16 10:00:06 -08:00 committed by Alex Dadgar
parent c5102975e3
commit f9e7e974d7
2 changed files with 47 additions and 0 deletions

View File

@ -225,6 +225,43 @@ func TestParse(t *testing.T) {
},
false,
},
{
"task-nested-config.hcl",
&structs.Job{
Region: "global",
ID: "foo",
Name: "foo",
Type: "service",
Priority: 50,
TaskGroups: []*structs.TaskGroup{
&structs.TaskGroup{
Name: "bar",
Count: 1,
RestartPolicy: &structs.RestartPolicy{
Attempts: 2,
Interval: 1 * time.Minute,
Delay: 15 * time.Second,
},
Tasks: []*structs.Task{
&structs.Task{
Name: "bar",
Driver: "docker",
Config: map[string]interface{}{
"port_map": []map[string]interface{}{
map[string]interface{}{
"db": 1234,
},
},
},
},
},
},
},
},
false,
},
}
for _, tc := range cases {

View File

@ -0,0 +1,10 @@
job "foo" {
task "bar" {
driver = "docker"
config {
port_map {
db = 1234
}
}
}
}