(labelSelector, container string, namespace string, filePath string, contents string)
| 156 | } |
| 157 | |
| 158 | func ExpectRemoteContainerFileContents(labelSelector, container string, namespace string, filePath string, contents string) { |
| 159 | kubeClient, err := kube.NewKubeHelper() |
| 160 | ExpectNoErrorWithOffset(1, err) |
| 161 | |
| 162 | err = wait.PollUntilContextTimeout(context.TODO(), time.Second, time.Minute*2, true, func(_ context.Context) (done bool, err error) { |
| 163 | out, err := kubeClient.ExecByContainer(labelSelector, container, namespace, []string{"cat", filePath}) |
| 164 | if err != nil { |
| 165 | return false, nil |
| 166 | } |
| 167 | return out == contents, nil |
| 168 | }) |
| 169 | ExpectNoErrorWithOffset(1, err) |
| 170 | } |
| 171 | |
| 172 | func ExpectLocalFileContentsImmediately(filePath string, contents string) { |
| 173 | out, err := os.ReadFile(filePath) |
no test coverage detected