Просмотр исходного кода

Add err checks for port allocator tests

Docker-DCO-1.1-Signed-off-by: Andy Kipp <andy@rstudio.com> (github: kippandrew)
Andy Kipp 11 лет назад
Родитель
Сommit
555416fd02
1 измененных файлов с 9 добавлено и 0 удалено
  1. 9 0
      runtime/networkdriver/portallocator/portallocator_test.go

+ 9 - 0
runtime/networkdriver/portallocator/portallocator_test.go

@@ -183,8 +183,17 @@ func TestPortAllocation(t *testing.T) {
 	}
 
 	port, err = RequestPort(ip, "tcp", 0)
+	if err != nil {
+		t.Fatal(err)
+	}
 	port2, err := RequestPort(ip, "tcp", port+1)
+	if err != nil {
+		t.Fatal(err)
+	}
 	port3, err := RequestPort(ip, "tcp", 0)
+	if err != nil {
+		t.Fatal(err)
+	}
 	if port3 == port2 {
 		t.Fatal("Requesting a dynamic port should never allocate a used port")
 	}