summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCharlie Doern <cdoern@redhat.com>2022-08-22 14:25:10 -0400
committerCharlie Doern <cdoern@redhat.com>2022-08-22 14:27:42 -0400
commit53369aaa1575caa652461d3671713577fa0ac291 (patch)
treea01f400f5303871bcd39f6b36c4e401643c88bac /test
parentaefd0aed3990848e77b706d673c23108092594a0 (diff)
downloadpodman-53369aaa1575caa652461d3671713577fa0ac291.tar.gz
podman-53369aaa1575caa652461d3671713577fa0ac291.tar.bz2
podman-53369aaa1575caa652461d3671713577fa0ac291.zip
pass environment variables to container clone
the env vars are held in the spec rather than the config, so they need to be mapped manually. They are also of a different format so special handling needed to be added. All env from the parent container will now be passed to the clone. resolves #15242 Signed-off-by: Charlie Doern <cdoern@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/container_clone_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/e2e/container_clone_test.go b/test/e2e/container_clone_test.go
index 94ccd6ffe..b3c22470b 100644
--- a/test/e2e/container_clone_test.go
+++ b/test/e2e/container_clone_test.go
@@ -292,4 +292,20 @@ var _ = Describe("Podman container clone", func() {
Expect(ok).To(BeTrue())
})
+
+ It("podman container clone env test", func() {
+ session := podmanTest.Podman([]string{"run", "--name", "env_ctr", "-e", "ENV_TEST=123", ALPINE, "printenv", "ENV_TEST"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ session = podmanTest.Podman([]string{"container", "clone", "env_ctr"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ session = podmanTest.Podman([]string{"start", "-a", "env_ctr-clone"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.OutputToString()).Should(ContainSubstring("123"))
+
+ })
})