Merge pull request #65222 from adelina-t/make-e2e-test-platform-agnostic

Automatic merge from submit-queue (batch tested with PRs 67739, 65222). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Tests: Make e2e test platform-agnostic

The test:
[k8s.io] Pods should support remote command execution over websockets [NodeConformance]

  uses cat on /etc/resolv.conf and checks if the output from the container is  "namespace",
which is incompatible with windows containers as there is no such file.

  Since the test just check if remote command execution works, the command is
irrelevant as long as the output checks out. Switched to using echo "remote execution test",
and checking that output as it works for both windows and linux.
This commit is contained in:
Kubernetes Submit Queue 2018-08-28 12:31:04 -07:00 committed by GitHub
commit d46d67159f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -504,8 +504,8 @@ var _ = framework.KubeDescribe("Pods", func() {
Param("stderr", "1").
Param("stdout", "1").
Param("container", pod.Spec.Containers[0].Name).
Param("command", "cat").
Param("command", "/etc/resolv.conf")
Param("command", "echo").
Param("command", "remote execution test")
url := req.URL()
ws, err := framework.OpenWebSocketForURL(url, config, []string{"channel.k8s.io"})
@ -541,8 +541,8 @@ var _ = framework.KubeDescribe("Pods", func() {
if buf.Len() == 0 {
return fmt.Errorf("Unexpected output from server")
}
if !strings.Contains(buf.String(), "nameserver") {
return fmt.Errorf("Expected to find 'nameserver' in %q", buf.String())
if !strings.Contains(buf.String(), "remote execution test") {
return fmt.Errorf("Expected to find 'remote execution test' in %q", buf.String())
}
return nil
}, time.Minute, 10*time.Second).Should(BeNil())