test, e2e: add tests for logs -f

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
k3s-v1.15.3
Giuseppe Scrivano 2019-03-30 18:45:14 +01:00
parent a561196bfe
commit 31397083b2
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED
1 changed files with 15 additions and 0 deletions

View File

@ -570,6 +570,21 @@ var _ = SIGDescribe("Kubectl client", func() {
gomega.Expect(c.BatchV1().Jobs(ns).Delete("run-test-3", nil)).To(gomega.BeNil())
})
ginkgo.It("should contain last line of the log", func() {
nsFlag := fmt.Sprintf("--namespace=%v", ns)
podName := "run-log-test"
ginkgo.By("executing a command with run")
framework.RunKubectlOrDie("run", podName, "--generator=run-pod/v1", "--image="+busyboxImage, "--restart=OnFailure", nsFlag, "--", "sh", "-c", "sleep 10; seq 100 | while read i; do echo $i; sleep 0.01; done; echo EOF")
if !framework.CheckPodsRunningReady(c, ns, []string{podName}, framework.PodStartTimeout) {
framework.Failf("Pod for run-log-test was not ready")
}
logOutput := framework.RunKubectlOrDie(nsFlag, "logs", "-f", "run-log-test")
gomega.Expect(logOutput).To(gomega.ContainSubstring("EOF"))
})
ginkgo.It("should support port-forward", func() {
ginkgo.By("forwarding the container port to a local port")
cmd := runPortForward(ns, simplePodName, simplePodPort)