Skip to content

Commit

Permalink
test: build with TMPDIR as relative
Browse files Browse the repository at this point in the history
Test edge-case described here: containers/buildah#5084
Test case in: RHEL-2598

Signed-off-by: Aditya R <arajan@redhat.com>
  • Loading branch information
flouthoc committed Oct 16, 2023
1 parent b949336 commit 64b60fa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/e2e/build/basicrun/Containerfile
@@ -0,0 +1,2 @@
FROM quay.io/libpod/alpine:latest
RUN echo hello
16 changes: 16 additions & 0 deletions test/e2e/build_test.go
Expand Up @@ -39,6 +39,22 @@ var _ = Describe("Podman build", func() {
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() {
session := podmanTest.Podman([]string{"build", "-f", "build/Containerfile.with-secret", "-t", "secret-test", "--secret", "id=mysecret,src=build/secret.txt", "build/"})
session.WaitWithDefaultTimeout()
Expand Down

0 comments on commit 64b60fa

Please sign in to comment.