summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2019-07-11 09:25:38 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2019-07-11 13:25:47 -0400
commitdf75fc62c8316bce058bbdda29f66af9dcc5573a (patch)
tree88d3cddc663a057c14b9f9b65707cb3d2f6c1def /test/e2e
parent144567b42dba2c8c426538a4b5fe7d718b43284a (diff)
downloadpodman-df75fc62c8316bce058bbdda29f66af9dcc5573a.tar.gz
podman-df75fc62c8316bce058bbdda29f66af9dcc5573a.tar.bz2
podman-df75fc62c8316bce058bbdda29f66af9dcc5573a.zip
Add support for -env-host
This flag passes the host environment into the container. The basic idea is to leak all environment variables from the host into the container. Environment variables from the image, and passed in via --env and --env-file will override the host environment. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/run_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 3fc628589..623e08c2a 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -224,6 +224,22 @@ var _ = Describe("Podman run", func() {
Expect(match).Should(BeTrue())
})
+ It("podman run --host-env environment test", func() {
+ os.Setenv("FOO", "BAR")
+ session := podmanTest.Podman([]string{"run", "--rm", "--env-host", ALPINE, "printenv", "FOO"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ match, _ := session.GrepString("BAR")
+ Expect(match).Should(BeTrue())
+
+ session = podmanTest.Podman([]string{"run", "--rm", "--env", "FOO=BAR1", "--env-host", ALPINE, "printenv", "FOO"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ match, _ = session.GrepString("BAR1")
+ Expect(match).Should(BeTrue())
+ os.Unsetenv("FOO")
+ })
+
It("podman run limits test", func() {
SkipIfRootless()
session := podmanTest.Podman([]string{"run", "--rm", "--ulimit", "rtprio=99", "--cap-add=sys_nice", fedoraMinimal, "cat", "/proc/self/sched"})