From 66b5b9b2f46e3d603c3ce6463f603376dd29dd4c Mon Sep 17 00:00:00 2001 From: TaEduard Date: Tue, 19 Jun 2018 09:19:47 +0000 Subject: [PATCH] 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. --- test/e2e/common/pods.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/e2e/common/pods.go b/test/e2e/common/pods.go index 2fa6fbc4204..5d2abbb3441 100644 --- a/test/e2e/common/pods.go +++ b/test/e2e/common/pods.go @@ -499,8 +499,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"}) @@ -536,8 +536,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())