Fixing the scheduler tests
This commit is contained in:
parent
69efc89436
commit
babc68adfb
|
@ -397,9 +397,10 @@ func TestServiceSched_JobModify_InPlace(t *testing.T) {
|
||||||
h.AssertEvalStatus(t, structs.EvalStatusComplete)
|
h.AssertEvalStatus(t, structs.EvalStatusComplete)
|
||||||
|
|
||||||
// Verify the network did not change
|
// Verify the network did not change
|
||||||
|
rp := structs.Port{"main", 5000}
|
||||||
for _, alloc := range out {
|
for _, alloc := range out {
|
||||||
for _, resources := range alloc.TaskResources {
|
for _, resources := range alloc.TaskResources {
|
||||||
if resources.Networks[0].ReservedPorts[0] != 5000 {
|
if resources.Networks[0].ReservedPorts[0] != rp {
|
||||||
t.Fatalf("bad: %#v", alloc)
|
t.Fatalf("bad: %#v", alloc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -463,9 +463,10 @@ func TestSystemSched_JobModify_InPlace(t *testing.T) {
|
||||||
h.AssertEvalStatus(t, structs.EvalStatusComplete)
|
h.AssertEvalStatus(t, structs.EvalStatusComplete)
|
||||||
|
|
||||||
// Verify the network did not change
|
// Verify the network did not change
|
||||||
|
rp := structs.Port{"main", 5000}
|
||||||
for _, alloc := range out {
|
for _, alloc := range out {
|
||||||
for _, resources := range alloc.TaskResources {
|
for _, resources := range alloc.TaskResources {
|
||||||
if resources.Networks[0].ReservedPorts[0] != 5000 {
|
if resources.Networks[0].ReservedPorts[0] != rp {
|
||||||
t.Fatalf("bad: %#v", alloc)
|
t.Fatalf("bad: %#v", alloc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -343,7 +343,7 @@ func TestTasksUpdated(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
j6 := mock.Job()
|
j6 := mock.Job()
|
||||||
j6.TaskGroups[0].Tasks[0].Resources.Networks[0].DynamicPorts = []string{"http", "https", "admin"}
|
j6.TaskGroups[0].Tasks[0].Resources.Networks[0].DynamicPorts = []structs.Port{{"http", 0}, {"https", 0}, {"admin", 0}}
|
||||||
if !tasksUpdated(j1.TaskGroups[0], j6.TaskGroups[0]) {
|
if !tasksUpdated(j1.TaskGroups[0], j6.TaskGroups[0]) {
|
||||||
t.Fatalf("bad")
|
t.Fatalf("bad")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue