summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-08-10 12:50:37 -0400
committerGitHub <noreply@github.com>2020-08-10 12:50:37 -0400
commit5ba21849a517659203a5879553f5dfb20963b7b5 (patch)
tree44a59a165de27275077ac540d0b3e1be3e3ead29 /test
parent162625f2e74c8ad9bf9a7337baaa2621bbf0a26e (diff)
parent6865058f2fa9faac5ee8db6b616c0734b1bb5805 (diff)
downloadpodman-5ba21849a517659203a5879553f5dfb20963b7b5.tar.gz
podman-5ba21849a517659203a5879553f5dfb20963b7b5.tar.bz2
podman-5ba21849a517659203a5879553f5dfb20963b7b5.zip
Merge pull request #7272 from vrothberg/issue-7271
generate systemd: fix error handling
Diffstat (limited to 'test')
-rw-r--r--test/e2e/generate_systemd_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/e2e/generate_systemd_test.go b/test/e2e/generate_systemd_test.go
index d114744c4..60d9162d1 100644
--- a/test/e2e/generate_systemd_test.go
+++ b/test/e2e/generate_systemd_test.go
@@ -53,6 +53,18 @@ var _ = Describe("Podman generate systemd", func() {
Expect(session).To(ExitWithError())
})
+ It("podman generate systemd bad restart-policy value", func() {
+ session := podmanTest.Podman([]string{"create", "--name", "foobar", "alpine", "top"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"generate", "systemd", "--restart-policy", "bogus", "foobar"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).To(ExitWithError())
+ found, _ := session.ErrorGrepString("Error: bogus is not a valid restart policy")
+ Expect(found).Should(BeTrue())
+ })
+
It("podman generate systemd good timeout value", func() {
session := podmanTest.Podman([]string{"create", "--name", "foobar", "alpine", "top"})
session.WaitWithDefaultTimeout()