add more details to failure

pull/6/head
Daniel Smith 2016-09-08 17:14:59 -07:00
parent 0037b67cdf
commit 2d6dd159d2
1 changed files with 9 additions and 1 deletions

View File

@ -465,7 +465,15 @@ func TestServiceAlloc(t *testing.T) {
t.Errorf("unexpected error text: %v", err)
}
} else {
t.Fatalf("unexpected sucess")
svcs, err := client.Services(api.NamespaceAll).List(api.ListOptions{})
if err != nil {
t.Fatalf("unexpected success, and error getting the services: %v", err)
}
allIPs := []string{}
for _, s := range svcs.Items {
allIPs = append(allIPs, s.Spec.ClusterIP)
}
t.Fatalf("unexpected creation success. The following IPs exist: %#v. It should only be possible to allocate 2 IP addresses in this cluster.\n\n%#v", allIPs, svcs)
}
// Delete the first service.