summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-04-01 09:49:21 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-04-02 13:10:08 -0400
commit1f8569f7d768c411b5fed4446817c79b4b5337a0 (patch)
treeee743630732dcad0828ef4880c3c706e50d62c18 /test/e2e
parentc3c6a7c8236fb43c3bc7172257b7fb15921e1668 (diff)
downloadpodman-1f8569f7d768c411b5fed4446817c79b4b5337a0.tar.gz
podman-1f8569f7d768c411b5fed4446817c79b4b5337a0.tar.bz2
podman-1f8569f7d768c411b5fed4446817c79b4b5337a0.zip
Fix environment handling from containers.conf
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/build/basicalpine/Containerfile.path2
-rw-r--r--test/e2e/build_test.go20
2 files changed, 22 insertions, 0 deletions
diff --git a/test/e2e/build/basicalpine/Containerfile.path b/test/e2e/build/basicalpine/Containerfile.path
new file mode 100644
index 000000000..d2b03a6b8
--- /dev/null
+++ b/test/e2e/build/basicalpine/Containerfile.path
@@ -0,0 +1,2 @@
+FROM alpine
+ENV PATH=/tmp:/bin:/usr/bin:/usr/sbin
diff --git a/test/e2e/build_test.go b/test/e2e/build_test.go
index 8b03e9386..9e41fd231 100644
--- a/test/e2e/build_test.go
+++ b/test/e2e/build_test.go
@@ -175,4 +175,24 @@ var _ = Describe("Podman build", func() {
data := inspect.InspectImageJSON()
Expect(data[0].ID).To(Equal(string(id)))
})
+
+ It("podman Test PATH in built image", func() {
+ path := "/tmp:/bin:/usr/bin:/usr/sbin"
+ session := podmanTest.PodmanNoCache([]string{
+ "build", "-f", "build/basicalpine/Containerfile.path", "-t", "test-path",
+ })
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"run", "test-path", "printenv", "PATH"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ stdoutLines := session.OutputToStringArray()
+ Expect(stdoutLines[0]).Should(Equal(path))
+
+ session = podmanTest.PodmanNoCache([]string{"rmi", "-a", "-f"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ })
+
})