summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorDivyansh Kamboj <kambojdivyansh2000@gmail.com>2019-05-16 20:57:39 +0530
committerDivyansh Kamboj <kambojdivyansh2000@gmail.com>2019-05-19 06:51:30 +0530
commitee3381f8f2471513dd258dcb64568b57ad4e30d5 (patch)
treec32e794337fb3a4ab30c2aa28c186761cb45fd7e /test/e2e
parent00ecbfc1315a62940202574fb45f2ae2f4c48b63 (diff)
downloadpodman-ee3381f8f2471513dd258dcb64568b57ad4e30d5.tar.gz
podman-ee3381f8f2471513dd258dcb64568b57ad4e30d5.tar.bz2
podman-ee3381f8f2471513dd258dcb64568b57ad4e30d5.zip
Minor fix splitting env vars in podman-commit
`string.Split()` splits into slice of size greater than 2 which may result in loss of environment variables fixes #3132 Signed-off-by: Divyansh Kamboj <kambojdivyansh2000@gmail.com>
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/commit_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/e2e/commit_test.go b/test/e2e/commit_test.go
index 3ece4887e..bf20ac999 100644
--- a/test/e2e/commit_test.go
+++ b/test/e2e/commit_test.go
@@ -194,4 +194,24 @@ var _ = Describe("Podman commit", func() {
Expect(r.ExitCode()).To(Equal(0))
})
+ It("podman commit container check env variables", func() {
+ s := podmanTest.Podman([]string{"run", "--name", "test1", "-e", "TEST=1=1-01=9.01", "-it", "alpine", "true"})
+ s.WaitWithDefaultTimeout()
+ Expect(s.ExitCode()).To(Equal(0))
+
+ c := podmanTest.Podman([]string{"commit", "test1", "newimage"})
+ c.WaitWithDefaultTimeout()
+ Expect(c.ExitCode()).To(Equal(0))
+
+ inspect := podmanTest.Podman([]string{"inspect", "newimage"})
+ inspect.WaitWithDefaultTimeout()
+ Expect(inspect.ExitCode()).To(Equal(0))
+ image := inspect.InspectImageJSON()
+
+ envMap := make(map[string]bool)
+ for _, v := range image[0].Config.Env {
+ envMap[v] = true
+ }
+ Expect(envMap["TEST=1=1-01=9.01"]).To(BeTrue())
+ })
})