summaryrefslogtreecommitdiff
path: root/test/e2e/build_test.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-05-12 16:31:11 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2022-05-12 16:31:13 -0400
commitb8103640a26e807825e302a3eb025fdf6023ba29 (patch)
tree5b97e8c5813a0509bb402e8931104d9a5585233a /test/e2e/build_test.go
parent86314850511af5ab485a49eff9ab02c71736eb47 (diff)
downloadpodman-b8103640a26e807825e302a3eb025fdf6023ba29.tar.gz
podman-b8103640a26e807825e302a3eb025fdf6023ba29.tar.bz2
podman-b8103640a26e807825e302a3eb025fdf6023ba29.zip
Make sure tests are cleaned up when they complete
Fixes: https://github.com/containers/podman/issues/13789 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/e2e/build_test.go')
-rw-r--r--test/e2e/build_test.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/test/e2e/build_test.go b/test/e2e/build_test.go
index b5cec5fff..dcdd17143 100644
--- a/test/e2e/build_test.go
+++ b/test/e2e/build_test.go
@@ -786,17 +786,18 @@ RUN ls /dev/test1`, ALPINE)
It("podman build use absolute path even if given relative", func() {
containerFile := fmt.Sprintf(`FROM %s`, ALPINE)
- err = os.Mkdir("relative", 0755)
+ relativeDir := filepath.Join(podmanTest.TempDir, "relativeDir")
+ containerFilePath := filepath.Join(relativeDir, "Containerfile")
+ buildRoot := filepath.Join(relativeDir, "build-root")
+
+ err = os.Mkdir(relativeDir, 0755)
Expect(err).To(BeNil())
- containerFilePath := filepath.Join("relative", "Containerfile")
- err = os.Mkdir("relative/build-root", 0755)
+ err = os.Mkdir(buildRoot, 0755)
Expect(err).To(BeNil())
err = ioutil.WriteFile(containerFilePath, []byte(containerFile), 0755)
Expect(err).To(BeNil())
- build := podmanTest.Podman([]string{"build", "-f", "./relative/Containerfile", "./relative/build-root"})
+ build := podmanTest.Podman([]string{"build", "-f", containerFilePath, buildRoot})
build.WaitWithDefaultTimeout()
Expect(build).To(Exit(0))
- err = os.RemoveAll("relative")
- Expect(err).To(BeNil())
})
})