mirror of
https://github.com/containers/podman.git
synced 2025-08-01 07:40:22 +08:00

Final push on RUN-1907. Commit 1 of 2. This is the final set of test/e2e/*_test.go files to be converted from Exit(0) to ExitCleanly(). This commit is a mix of automated string-replace with manual revert-back: tests that did not pass with ExitCleanly() are reverted back to Exit(0), so they will not show up as diffs in this commit. When possible, I address those in my next commit. My goal was to make this commit a don't-bother-reviewing one that will also pass tests (so as not to break git-bisect). The next commit is the important one to review. Signed-off-by: Ed Santiago <santiago@redhat.com>
54 lines
1.4 KiB
Go
54 lines
1.4 KiB
Go
package integration
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
|
|
. "github.com/containers/podman/v4/test/utils"
|
|
. "github.com/onsi/ginkgo/v2"
|
|
. "github.com/onsi/gomega"
|
|
)
|
|
|
|
var _ = Describe("Podman export", func() {
|
|
|
|
It("podman export output flag", func() {
|
|
_, ec, cid := podmanTest.RunLsContainer("")
|
|
Expect(ec).To(Equal(0))
|
|
|
|
outfile := filepath.Join(podmanTest.TempDir, "container.tar")
|
|
result := podmanTest.Podman([]string{"export", "-o", outfile, cid})
|
|
result.WaitWithDefaultTimeout()
|
|
Expect(result).Should(ExitCleanly())
|
|
_, err := os.Stat(outfile)
|
|
Expect(err).ToNot(HaveOccurred())
|
|
|
|
err = os.Remove(outfile)
|
|
Expect(err).ToNot(HaveOccurred())
|
|
})
|
|
|
|
It("podman container export output flag", func() {
|
|
_, ec, cid := podmanTest.RunLsContainer("")
|
|
Expect(ec).To(Equal(0))
|
|
|
|
outfile := filepath.Join(podmanTest.TempDir, "container.tar")
|
|
result := podmanTest.Podman([]string{"container", "export", "-o", outfile, cid})
|
|
result.WaitWithDefaultTimeout()
|
|
Expect(result).Should(ExitCleanly())
|
|
_, err := os.Stat(outfile)
|
|
Expect(err).ToNot(HaveOccurred())
|
|
|
|
err = os.Remove(outfile)
|
|
Expect(err).ToNot(HaveOccurred())
|
|
})
|
|
|
|
It("podman export bad filename", func() {
|
|
_, ec, cid := podmanTest.RunLsContainer("")
|
|
Expect(ec).To(Equal(0))
|
|
|
|
outfile := filepath.Join(podmanTest.TempDir, "container:with:colon.tar")
|
|
result := podmanTest.Podman([]string{"export", "-o", outfile, cid})
|
|
result.WaitWithDefaultTimeout()
|
|
Expect(result).To(ExitWithError())
|
|
})
|
|
})
|