Fixing the scheduler tests

This commit is contained in:
Diptanu Choudhury 2015-11-14 22:28:11 -08:00 committed by Alex Dadgar
parent 69efc89436
commit babc68adfb
3 changed files with 5 additions and 3 deletions

View File

@ -397,9 +397,10 @@ func TestServiceSched_JobModify_InPlace(t *testing.T) {
h.AssertEvalStatus(t, structs.EvalStatusComplete)
// Verify the network did not change
rp := structs.Port{"main", 5000}
for _, alloc := range out {
for _, resources := range alloc.TaskResources {
if resources.Networks[0].ReservedPorts[0] != 5000 {
if resources.Networks[0].ReservedPorts[0] != rp {
t.Fatalf("bad: %#v", alloc)
}
}

View File

@ -463,9 +463,10 @@ func TestSystemSched_JobModify_InPlace(t *testing.T) {
h.AssertEvalStatus(t, structs.EvalStatusComplete)
// Verify the network did not change
rp := structs.Port{"main", 5000}
for _, alloc := range out {
for _, resources := range alloc.TaskResources {
if resources.Networks[0].ReservedPorts[0] != 5000 {
if resources.Networks[0].ReservedPorts[0] != rp {
t.Fatalf("bad: %#v", alloc)
}
}

View File

@ -343,7 +343,7 @@ func TestTasksUpdated(t *testing.T) {
}
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]) {
t.Fatalf("bad")
}