Skip to content

Commit

Permalink
add test to exercise deployment logs for multi-container pods
Browse files Browse the repository at this point in the history
  • Loading branch information
mfojtik committed Aug 19, 2016
1 parent b413e5b commit e63851e
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/extended/deployments/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ var _ = g.Describe("deploymentconfigs", func() {
historyLimitedDeploymentFixture = exutil.FixturePath("testdata", "deployment-history-limit.yaml")
minReadySecondsFixture = exutil.FixturePath("testdata", "deployment-min-ready-seconds.yaml")
multipleICTFixture = exutil.FixturePath("testdata", "deployment-example.yaml")
multiContainerFixture = exutil.FixturePath("testdata", "test-deployment-config-multicontainer.yaml")
)

g.Describe("when run iteratively", func() {
Expand Down Expand Up @@ -458,6 +459,24 @@ var _ = g.Describe("deploymentconfigs", func() {
})
})

g.Describe("with logging with multiple containers [Conformance]", func() {
g.AfterEach(func() {
failureTrap(oc, "test-deployment-config-multicontainer", g.CurrentGinkgoTestDescription().Failed)
})

g.It("should be able to get the logs from each container", func() {
_, name, err := createFixture(oc, multiContainerFixture)
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(waitForLatestCondition(oc, name, deploymentRunTimeout, deploymentReachedCompletion)).NotTo(o.HaveOccurred())

_, err = oc.Run("logs").Args("dc/"+name, "-c", "container1").Output()
o.Expect(err).NotTo(o.HaveOccurred())
_, err = oc.Run("logs").Args("dc/"+name, "-c", "container2").Output()
o.Expect(err).NotTo(o.HaveOccurred())
})

})

g.Describe("with failing hook", func() {
g.AfterEach(func() {
failureTrap(oc, "hook", g.CurrentGinkgoTestDescription().Failed)
Expand Down
27 changes: 27 additions & 0 deletions test/extended/testdata/test-deployment-config-multicontainer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: v1
kind: DeploymentConfig
metadata:
name: test-deployment-config-multicontainer
spec:
replicas: 1
selector:
name: test-deployment
strategy:
type: Recreate
template:
metadata:
labels:
name: test-deployment
spec:
containers:
- image: busybox:latest
imagePullPolicy: IfNotPresent
name: container1
command: ["tail", "-f", "/dev/null"]
- image: busybox:latest
imagePullPolicy: IfNotPresent
name: container2
command: ["tail", "-f", "/dev/null"]
triggers:
- type: ConfigChange
status: {}

0 comments on commit e63851e

Please sign in to comment.