(imageSelector string, namespace string, filePath string, contents string)
| 78 | } |
| 79 | |
| 80 | func ExpectRemoteFileContents(imageSelector string, namespace string, filePath string, contents string) { |
| 81 | kubeClient, err := kube.NewKubeHelper() |
| 82 | ExpectNoErrorWithOffset(1, err) |
| 83 | |
| 84 | err = wait.PollUntilContextTimeout(context.TODO(), time.Second, time.Minute*2, true, func(_ context.Context) (done bool, err error) { |
| 85 | out, err := kubeClient.ExecByImageSelector(imageSelector, namespace, []string{"cat", filePath}) |
| 86 | if err != nil { |
| 87 | return false, nil |
| 88 | } |
| 89 | |
| 90 | return strings.TrimSpace(out) == strings.TrimSpace(contents), nil |
| 91 | }) |
| 92 | ExpectNoErrorWithOffset(1, err) |
| 93 | } |
| 94 | |
| 95 | func ExpectLocalCurlContains(urlString string, contents string) { |
| 96 | client := resty.New() |
no test coverage detected