Example #1
0
						Expect(output.Contents()).To(ContainSubstring("ENV2=val2"))
					})

					It("saves the succeeded run result", func() {
						Eventually(containerStatePoller(guid)).Should(Equal(executor.StateCompleted))

						container := getContainer(guid)
						Expect(container.RunResult.Failed).To(BeFalse())
						Expect(container.RunResult.FailureReason).To(BeEmpty())
					})

					Context("when created without a monitor action", func() {
						BeforeEach(func() {
							container.Action = models.WrapAction(&models.RunAction{
								Path: "sh",
								User: "******",
								Args: []string{"-c", "while true; do sleep 1; done"},
							})
						})

						It("reports the state as 'running'", func() {
							Eventually(containerStatePoller(guid)).Should(Equal(executor.StateRunning))
							Consistently(containerStatePoller(guid)).Should(Equal(executor.StateRunning))
						})
					})

					Context("when created with a monitor action", func() {
						itFailsOnlyIfMonitoringSucceedsAndThenFails := func() {
							Context("when monitoring succeeds", func() {
								BeforeEach(func() {
									container.Monitor = models.WrapAction(&models.RunAction{