Files
podman/test/e2e/export_test.go
Matt Heon 34166fc004 Bump Go version to v6
Tremendous amount of changes in here, but all should amount to
the same thing: changing Go import paths from v5 to v6.

Also bumped go.mod to github.com/containers/podman/v6 and updated
version to v6.0.0-dev.

Signed-off-by: Matt Heon <mheon@redhat.com>
2025-10-23 11:00:15 -04:00

56 lines
1.5 KiB
Go

//go:build linux || freebsd
package integration
import (
"os"
"path/filepath"
. "github.com/containers/podman/v6/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(125, "invalid filename (should not contain ':')"))
})
})