forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
debug.go
53 lines (43 loc) · 2.17 KB
/
debug.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package cli
import (
g "github.com/onsi/ginkgo"
o "github.com/onsi/gomega"
exutil "github.com/openshift/origin/test/extended/util"
)
var _ = g.Describe("[cli][Slow] oc debug", func() {
oc := exutil.NewCLI("oc-debug", exutil.KubeConfigPath())
templatePath := exutil.FixturePath("testdata", "test-cli-debug.yaml")
g.JustBeforeEach(func() {
g.By("waiting for default service account")
err := exutil.WaitForServiceAccount(oc.KubeClient().Core().ServiceAccounts(oc.Namespace()), "default")
o.Expect(err).NotTo(o.HaveOccurred())
g.By("waiting for builder service account")
err = exutil.WaitForServiceAccount(oc.KubeClient().Core().ServiceAccounts(oc.Namespace()), "builder")
o.Expect(err).NotTo(o.HaveOccurred())
g.By("calling oc create -f " + templatePath)
err = oc.Run("create").Args("-f", templatePath).Execute()
o.Expect(err).NotTo(o.HaveOccurred())
exutil.WaitForAnImageStreamTag(oc, oc.Namespace(), "local-busybox", "latest")
o.Expect(err).NotTo(o.HaveOccurred())
})
g.It("should print the imagestream-based container entrypoint/command", func() {
out, err := oc.Run("debug").Args("dc/local-busybox1").Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(out).To(o.ContainSubstring("Debugging with pod/local-busybox1-debug, original command: sh\n"))
})
g.It("should print the overridden imagestream-based container entrypoint/command", func() {
out, err := oc.Run("debug").Args("dc/local-busybox2").Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(out).To(o.ContainSubstring("Debugging with pod/local-busybox2-debug, original command: foo bar baz qux\n"))
})
g.It("should print the docker image-based container entrypoint/command", func() {
out, err := oc.Run("debug").Args("dc/busybox1").Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(out).To(o.ContainSubstring("Debugging with pod/busybox1-debug, original command: sh\n"))
})
g.It("should print the overridden docker image-based container entrypoint/command", func() {
out, err := oc.Run("debug").Args("dc/busybox2").Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(out).To(o.ContainSubstring("Debugging with pod/busybox2-debug, original command: foo bar baz qux\n"))
})
})