diff --git a/test/e2e/common.go b/test/e2e/common.go index f02a1857fb..3824d4d7b8 100644 --- a/test/e2e/common.go +++ b/test/e2e/common.go @@ -22,6 +22,7 @@ import ( ipamv1 "github.com/metal3-io/ip-address-manager/api/v1alpha1" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "github.com/pkg/errors" "golang.org/x/crypto/ssh" corev1 "k8s.io/api/core/v1" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" @@ -181,6 +182,9 @@ func DownloadFile(filePath string, url string) error { if err != nil { return err } + if resp.StatusCode != http.StatusOK { + return errors.Errorf("failed to download image from %s got %d", filePath, resp.StatusCode) + } defer resp.Body.Close() // Create the file