summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-04-03 01:02:57 +0200
committerGitHub <noreply@github.com>2020-04-03 01:02:57 +0200
commitccf0e0dd042d8a8d23dd0021ee267e7c9da9ff4a (patch)
treeee743630732dcad0828ef4880c3c706e50d62c18 /test
parentc3c6a7c8236fb43c3bc7172257b7fb15921e1668 (diff)
parent1f8569f7d768c411b5fed4446817c79b4b5337a0 (diff)
downloadpodman-ccf0e0dd042d8a8d23dd0021ee267e7c9da9ff4a.tar.gz
podman-ccf0e0dd042d8a8d23dd0021ee267e7c9da9ff4a.tar.bz2
podman-ccf0e0dd042d8a8d23dd0021ee267e7c9da9ff4a.zip
Merge pull request #5696 from rhatdan/cc
Fix environment handling from containers.conf
Diffstat (limited to 'test')
-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))
+ })
+
})