@@ -20,11 +20,15 @@ package e2e
2020
2121import (
2222 "context"
23+ "fmt"
24+ "io/ioutil"
2325 "net"
26+ "regexp"
2427
2528 . "github.com/onsi/ginkgo"
2629 . "github.com/onsi/gomega"
2730
31+ retryablehttp "github.com/hashicorp/go-retryablehttp"
2832 appsv1 "k8s.io/api/apps/v1"
2933 batchv1 "k8s.io/api/batch/v1"
3034 corev1 "k8s.io/api/core/v1"
@@ -260,19 +264,18 @@ func AzureLBSpec(ctx context.Context, inputGetter func() AzureLBSpecInput) {
260264 }
261265 WaitForJobComplete (context .TODO (), elbJobInput , e2eConfig .GetIntervals (specName , "wait-job" )... )
262266
263- By ("SKIPPED: connecting directly to the external LB service" )
264- // Temporarily disabled while we investigate some frequent failures.
265- // url := fmt.Sprintf("http://%s", elbIP)
266- // resp, err := retryablehttp.Get(url)
267- // if resp != nil {
268- // defer resp.Body.Close()
269- // }
270- // Expect(err).NotTo(HaveOccurred())
271- // body, err := ioutil.ReadAll(resp.Body)
272- // Expect(err).NotTo(HaveOccurred())
273- // matched, err := regexp.MatchString("(Welcome to nginx)", string(body))
274- // Expect(err).NotTo(HaveOccurred())
275- // Expect(matched).To(BeTrue())
267+ By ("connecting directly to the external LB service" )
268+ url := fmt .Sprintf ("http://%s" , elbIP )
269+ resp , err := retryablehttp .Get (url )
270+ if resp != nil {
271+ defer resp .Body .Close ()
272+ }
273+ Expect (err ).NotTo (HaveOccurred ())
274+ body , err := ioutil .ReadAll (resp .Body )
275+ Expect (err ).NotTo (HaveOccurred ())
276+ matched , err := regexp .MatchString ("(Welcome to nginx)" , string (body ))
277+ Expect (err ).NotTo (HaveOccurred ())
278+ Expect (matched ).To (BeTrue ())
276279
277280 if input .SkipCleanup {
278281 return
0 commit comments