mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Merge pull request #106001 from NikhilSharmaWe/betterOutputKubectl
Changed code to improve output for files under test/e2e/kubectl
This commit is contained in:
commit
d8b6dc3e06
@ -505,7 +505,9 @@ var _ = SIGDescribe("Kubectl client", func() {
|
|||||||
ginkgo.It("execing into a container with a failing command", func() {
|
ginkgo.It("execing into a container with a failing command", func() {
|
||||||
_, err := framework.NewKubectlCommand(ns, "exec", "httpd", podRunningTimeoutArg, "--", "/bin/sh", "-c", "exit 42").Exec()
|
_, err := framework.NewKubectlCommand(ns, "exec", "httpd", podRunningTimeoutArg, "--", "/bin/sh", "-c", "exit 42").Exec()
|
||||||
ee, ok := err.(uexec.ExitError)
|
ee, ok := err.(uexec.ExitError)
|
||||||
framework.ExpectEqual(ok, true)
|
if !ok {
|
||||||
|
framework.Failf("Got unexpected error type, expected uexec.ExitError, got %T: %v", err, err)
|
||||||
|
}
|
||||||
framework.ExpectEqual(ee.ExitStatus(), 42)
|
framework.ExpectEqual(ee.ExitStatus(), 42)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -517,7 +519,9 @@ var _ = SIGDescribe("Kubectl client", func() {
|
|||||||
ginkgo.It("running a failing command", func() {
|
ginkgo.It("running a failing command", func() {
|
||||||
_, err := framework.NewKubectlCommand(ns, "run", "-i", "--image="+busyboxImage, "--restart=Never", podRunningTimeoutArg, "failure-1", "--", "/bin/sh", "-c", "exit 42").Exec()
|
_, err := framework.NewKubectlCommand(ns, "run", "-i", "--image="+busyboxImage, "--restart=Never", podRunningTimeoutArg, "failure-1", "--", "/bin/sh", "-c", "exit 42").Exec()
|
||||||
ee, ok := err.(uexec.ExitError)
|
ee, ok := err.(uexec.ExitError)
|
||||||
framework.ExpectEqual(ok, true)
|
if !ok {
|
||||||
|
framework.Failf("Got unexpected error type, expected uexec.ExitError, got %T: %v", err, err)
|
||||||
|
}
|
||||||
framework.ExpectEqual(ee.ExitStatus(), 42)
|
framework.ExpectEqual(ee.ExitStatus(), 42)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -526,7 +530,9 @@ var _ = SIGDescribe("Kubectl client", func() {
|
|||||||
WithStdinData("abcd1234").
|
WithStdinData("abcd1234").
|
||||||
Exec()
|
Exec()
|
||||||
ee, ok := err.(uexec.ExitError)
|
ee, ok := err.(uexec.ExitError)
|
||||||
framework.ExpectEqual(ok, true)
|
if !ok {
|
||||||
|
framework.Failf("Got unexpected error type, expected uexec.ExitError, got %T: %v", err, err)
|
||||||
|
}
|
||||||
if !strings.Contains(ee.String(), "timed out") {
|
if !strings.Contains(ee.String(), "timed out") {
|
||||||
framework.Failf("Missing expected 'timed out' error, got: %#v", ee)
|
framework.Failf("Missing expected 'timed out' error, got: %#v", ee)
|
||||||
}
|
}
|
||||||
@ -537,7 +543,9 @@ var _ = SIGDescribe("Kubectl client", func() {
|
|||||||
WithStdinData("abcd1234").
|
WithStdinData("abcd1234").
|
||||||
Exec()
|
Exec()
|
||||||
ee, ok := err.(uexec.ExitError)
|
ee, ok := err.(uexec.ExitError)
|
||||||
framework.ExpectEqual(ok, true)
|
if !ok {
|
||||||
|
framework.Failf("Got unexpected error type, expected uexec.ExitError, got %T: %v", err, err)
|
||||||
|
}
|
||||||
if !strings.Contains(ee.String(), "timed out") {
|
if !strings.Contains(ee.String(), "timed out") {
|
||||||
framework.Failf("Missing expected 'timed out' error, got: %#v", ee)
|
framework.Failf("Missing expected 'timed out' error, got: %#v", ee)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user