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_remote_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_remote_test.go')
-rw-r--r-- | test/e2e/libpod_suite_remote_test.go | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/test/e2e/libpod_suite_remote_test.go b/test/e2e/libpod_suite_remote_test.go index 2ecbd0eab..d60383029 100644 --- a/test/e2e/libpod_suite_remote_test.go +++ b/test/e2e/libpod_suite_remote_test.go @@ -148,7 +148,7 @@ func (p *PodmanTestIntegration) StopRemoteService() { //MakeOptions assembles all the podman main options func getRemoteOptions(p *PodmanTestIntegration, args []string) []string { podmanOptions := strings.Split(fmt.Sprintf("--root %s --runroot %s --runtime %s --conmon %s --cni-config-dir %s --cgroup-manager %s", - p.CrioRoot, p.RunRoot, p.OCIRuntime, p.ConmonBinary, p.CNIConfigDir, p.CgroupManager), " ") + p.Root, p.RunRoot, p.OCIRuntime, p.ConmonBinary, p.CNIConfigDir, p.CgroupManager), " ") if os.Getenv("HOOK_OPTION") != "" { podmanOptions = append(podmanOptions, os.Getenv("HOOK_OPTION")) } @@ -164,15 +164,16 @@ func (p *PodmanTestIntegration) SeedImages() error { // 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)) - args := []string{"load", "-q", "-i", destName} - podmanOptions := getRemoteOptions(p, args) - command := exec.Command(p.PodmanBinary, podmanOptions...) - fmt.Printf("Running: %s %s\n", p.PodmanBinary, strings.Join(podmanOptions, " ")) - command.Start() - command.Wait() + tarball := imageTarPath(image) + if _, err := os.Stat(tarball); err == nil { + fmt.Printf("Restoring %s...\n", image) + args := []string{"load", "-q", "-i", tarball} + podmanOptions := getRemoteOptions(p, args) + command := exec.Command(p.PodmanBinary, podmanOptions...) + fmt.Printf("Running: %s %s\n", p.PodmanBinary, strings.Join(podmanOptions, " ")) + command.Start() + command.Wait() + } return nil } |