mirror of
https://github.com/containers/podman.git
synced 2025-06-24 19:42:56 +08:00
test: build with TMPDIR as relative
Test edge-case described here: https://github.com/containers/buildah/pull/5084 Test case in: RHEL-2598 Signed-off-by: Aditya R <arajan@redhat.com>
This commit is contained in:
2
test/e2e/build/basicrun/Containerfile
Normal file
2
test/e2e/build/basicrun/Containerfile
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
FROM quay.io/libpod/alpine:latest
|
||||||
|
RUN echo hello
|
@ -39,6 +39,22 @@ var _ = Describe("Podman build", func() {
|
|||||||
Expect(session).Should(ExitCleanly())
|
Expect(session).Should(ExitCleanly())
|
||||||
})
|
})
|
||||||
|
|
||||||
|
It("podman build and remove basic alpine with TMPDIR as relative", func() {
|
||||||
|
// preserve TMPDIR if it was originally set
|
||||||
|
if cacheDir, found := os.LookupEnv("TMPDIR"); found {
|
||||||
|
defer os.Setenv("TMPDIR", cacheDir)
|
||||||
|
os.Unsetenv("TMPDIR")
|
||||||
|
} else {
|
||||||
|
defer os.Unsetenv("TMPDIR")
|
||||||
|
}
|
||||||
|
// Test case described here: https://github.com/containers/buildah/pull/5084
|
||||||
|
os.Setenv("TMPDIR", ".")
|
||||||
|
podmanTest.AddImageToRWStore(ALPINE)
|
||||||
|
session := podmanTest.Podman([]string{"build", "--pull-never", "build/basicrun"})
|
||||||
|
session.WaitWithDefaultTimeout()
|
||||||
|
Expect(session).Should(ExitCleanly())
|
||||||
|
})
|
||||||
|
|
||||||
It("podman build with a secret from file", func() {
|
It("podman build with a secret from file", func() {
|
||||||
session := podmanTest.Podman([]string{"build", "-f", "build/Containerfile.with-secret", "-t", "secret-test", "--secret", "id=mysecret,src=build/secret.txt", "build/"})
|
session := podmanTest.Podman([]string{"build", "-f", "build/Containerfile.with-secret", "-t", "secret-test", "--secret", "id=mysecret,src=build/secret.txt", "build/"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
|
Reference in New Issue
Block a user