test/e2e: do not use /tmp for podman commands

Using the OS tempdir here is not good. This defaults to /tmp which means
the inital podman test setup uses these paths:
`--root /tmp/root --runroot /tmp/runroot and --tmpdir /tmp`

Thus we create many files directly under /tmp. Also they were never
removed thus leaked out. When running as root and then later as rooltess
this would fail to permission problems.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2023-07-04 15:37:36 +02:00
parent db7cb1dbfc
commit ff77900387

View File

@ -137,7 +137,7 @@ var _ = SynchronizedBeforeSuite(func() []byte {
// Cache images
cwd, _ := os.Getwd()
INTEGRATION_ROOT = filepath.Join(cwd, "../../")
podman := PodmanTestSetup(os.TempDir())
podman := PodmanTestSetup(GinkgoT().TempDir())
// Pull cirros but don't put it into the cache
pullImages := []string{CIRROS_IMAGE, fedoraToolbox, volumeTest}
@ -180,6 +180,9 @@ var _ = SynchronizedBeforeSuite(func() []byte {
podman.StopRemoteService()
}
// remove temporary podman files, images are now cached in ImageCacheDir
podman.removeCache(podman.TempDir)
return []byte(path)
}, func(data []byte) {
cwd, _ := os.Getwd()