diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-12-02 14:28:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-02 14:28:46 +0100 |
commit | 6b5ecde76ebb177b1ab1dd9e9555fc198ad90858 (patch) | |
tree | a39af2c8c8bd0db477e70913878b83110730955d /test/e2e/libpod_suite_test.go | |
parent | eeb71490e57047202410821fe98fa4332371cb03 (diff) | |
parent | 65109494bca511fbcfd36c8d5b2f70e33c210409 (diff) | |
download | podman-6b5ecde76ebb177b1ab1dd9e9555fc198ad90858.tar.gz podman-6b5ecde76ebb177b1ab1dd9e9555fc198ad90858.tar.bz2 podman-6b5ecde76ebb177b1ab1dd9e9555fc198ad90858.zip |
Merge pull request #12471 from edsantiago/e2e_tmpdir_cleanup
e2e tmpdir cleanup
Diffstat (limited to 'test/e2e/libpod_suite_test.go')
-rw-r--r-- | test/e2e/libpod_suite_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/e2e/libpod_suite_test.go b/test/e2e/libpod_suite_test.go index 001a869b1..4147ba2c3 100644 --- a/test/e2e/libpod_suite_test.go +++ b/test/e2e/libpod_suite_test.go @@ -7,7 +7,6 @@ import ( "io/ioutil" "os" "path/filepath" - "strings" "github.com/containers/podman/v3/pkg/rootless" ) @@ -59,11 +58,12 @@ func PodmanTestCreate(tempDir string) *PodmanTestIntegration { // RestoreArtifact puts the cached image into our test store func (p *PodmanTestIntegration) RestoreArtifact(image string) error { - fmt.Printf("Restoring %s...\n", image) - dest := strings.Split(image, "/") - destName := fmt.Sprintf("/tmp/%s.tar", strings.Replace(strings.Join(strings.Split(dest[len(dest)-1], "/"), ""), ":", "-", -1)) - restore := p.PodmanNoEvents([]string{"load", "-q", "-i", destName}) - restore.Wait(90) + tarball := imageTarPath(image) + if _, err := os.Stat(tarball); err == nil { + fmt.Printf("Restoring %s...\n", image) + restore := p.PodmanNoEvents([]string{"load", "-q", "-i", tarball}) + restore.Wait(90) + } return nil } |