(imageSelector string, namespace string, urlString string, contents string)
| 119 | } |
| 120 | |
| 121 | func ExpectRemoteCurlContains(imageSelector string, namespace string, urlString string, contents string) { |
| 122 | kubeClient, err := kube.NewKubeHelper() |
| 123 | ExpectNoErrorWithOffset(1, err) |
| 124 | err = wait.PollUntilContextTimeout(context.TODO(), time.Second, time.Minute*2, true, func(_ context.Context) (done bool, err error) { |
| 125 | out, err := kubeClient.ExecByImageSelector(imageSelector, namespace, []string{"curl", urlString}) |
| 126 | if err != nil { |
| 127 | return false, nil |
| 128 | } |
| 129 | return strings.Contains(strings.TrimSpace(out), strings.TrimSpace(contents)), nil |
| 130 | }) |
| 131 | ExpectNoErrorWithOffset(1, err) |
| 132 | } |
| 133 | |
| 134 | func ExpectRemoteFileNotFound(imageSelector string, namespace string, filePath string) { |
| 135 | kubeClient, err := kube.NewKubeHelper() |
no test coverage detected