summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-01-20 10:56:50 -0500
committerGitHub <noreply@github.com>2021-01-20 10:56:50 -0500
commitfe4f9ba303affde0b838e19c862b45206ae2feed (patch)
treed9eff7fd8d15272bdfb0069b28407ec65554b6ac /test/e2e
parentd6711a2929576bcda41e6b07a12fa309db56ba5d (diff)
parentc3cbaa355cde1eb07466f553d01765589fb6aeef (diff)
downloadpodman-fe4f9ba303affde0b838e19c862b45206ae2feed.tar.gz
podman-fe4f9ba303affde0b838e19c862b45206ae2feed.tar.bz2
podman-fe4f9ba303affde0b838e19c862b45206ae2feed.zip
Merge pull request #9035 from Luap99/fix-9034
Make generate systemd --new robust against double curly braces
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/generate_systemd_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/e2e/generate_systemd_test.go b/test/e2e/generate_systemd_test.go
index be9727591..606d756b0 100644
--- a/test/e2e/generate_systemd_test.go
+++ b/test/e2e/generate_systemd_test.go
@@ -355,4 +355,25 @@ var _ = Describe("Podman generate systemd", func() {
Expect(session.ExitCode()).To(Equal(0))
Expect(session.IsJSONOutputValid()).To(BeTrue())
})
+
+ It("podman generate systemd --new create command with double curly braces", func() {
+ // Regression test for #9034
+ session := podmanTest.Podman([]string{"create", "--name", "foo", "--log-driver=journald", "--log-opt=tag={{.Name}}", ALPINE})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"generate", "systemd", "--new", "foo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(ContainSubstring(" --log-opt=tag={{.Name}} "))
+
+ session = podmanTest.Podman([]string{"pod", "create", "--name", "pod", "--label", "key={{someval}}"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"generate", "systemd", "--new", "pod"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(ContainSubstring(" --label key={{someval}}"))
+ })
})