func (s *ingManager) test(path string) error { url := fmt.Sprintf("%v/hostName", path) httpClient := &http.Client{} return wait.Poll(pollInterval, framework.ServiceRespondingTimeout, func() (bool, error) { body, err := framework.SimpleGET(httpClient, url, "") if err != nil { framework.Logf("%v\n%v\n%v", url, body, err) return false, nil } return true, nil }) }
// verifyURL polls for the given iterations, in intervals, and fails if the // given url returns a non-healthy http code even once. func (j *testJig) verifyURL(route, host string, iterations int, interval time.Duration, httpClient *http.Client) error { for i := 0; i < iterations; i++ { b, err := framework.SimpleGET(httpClient, route, host) if err != nil { framework.Logf(b) return err } framework.Logf("Verfied %v with host %v %d times, sleeping for %v", route, host, i, interval) time.Sleep(interval) } return nil }