e2e: ExitCleanly(): a few more

Commit 1 of 2: automated string replace Exit(0) -> ExitCleanly()

Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
Ed Santiago
2023-09-21 06:18:58 -06:00
parent 5a3a9ce9c7
commit 8e743fa1dd
5 changed files with 233 additions and 235 deletions

View File

@ -25,15 +25,15 @@ var _ = Describe("Podman load", func() {
save := podmanTest.Podman([]string{"save", "-o", outfile, ALPINE})
save.WaitWithDefaultTimeout()
Expect(save).Should(Exit(0))
Expect(save).Should(ExitCleanly())
rmi := podmanTest.Podman([]string{"rmi", ALPINE})
rmi.WaitWithDefaultTimeout()
Expect(rmi).Should(Exit(0))
Expect(rmi).Should(ExitCleanly())
result := podmanTest.Podman([]string{"load", "-i", outfile})
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
Expect(result).Should(ExitCleanly())
})
It("podman load compressed tar file", func() {
@ -41,19 +41,19 @@ var _ = Describe("Podman load", func() {
save := podmanTest.Podman([]string{"save", "-o", outfile, ALPINE})
save.WaitWithDefaultTimeout()
Expect(save).Should(Exit(0))
Expect(save).Should(ExitCleanly())
compress := SystemExec("gzip", []string{outfile})
Expect(compress).Should(Exit(0))
Expect(compress).Should(ExitCleanly())
outfile += ".gz"
rmi := podmanTest.Podman([]string{"rmi", ALPINE})
rmi.WaitWithDefaultTimeout()
Expect(rmi).Should(Exit(0))
Expect(rmi).Should(ExitCleanly())
result := podmanTest.Podman([]string{"load", "-i", outfile})
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
Expect(result).Should(ExitCleanly())
})
It("podman load oci-archive image", func() {
@ -61,15 +61,15 @@ var _ = Describe("Podman load", func() {
save := podmanTest.Podman([]string{"save", "-o", outfile, "--format", "oci-archive", ALPINE})
save.WaitWithDefaultTimeout()
Expect(save).Should(Exit(0))
Expect(save).Should(ExitCleanly())
rmi := podmanTest.Podman([]string{"rmi", ALPINE})
rmi.WaitWithDefaultTimeout()
Expect(rmi).Should(Exit(0))
Expect(rmi).Should(ExitCleanly())
result := podmanTest.Podman([]string{"load", "-i", outfile})
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
Expect(result).Should(ExitCleanly())
})
It("podman load oci-archive with signature", func() {
@ -77,11 +77,11 @@ var _ = Describe("Podman load", func() {
save := podmanTest.Podman([]string{"save", "-o", outfile, "--format", "oci-archive", ALPINE})
save.WaitWithDefaultTimeout()
Expect(save).Should(Exit(0))
Expect(save).Should(ExitCleanly())
rmi := podmanTest.Podman([]string{"rmi", ALPINE})
rmi.WaitWithDefaultTimeout()
Expect(rmi).Should(Exit(0))
Expect(rmi).Should(ExitCleanly())
result := podmanTest.Podman([]string{"load", "--signature-policy", "/etc/containers/policy.json", "-i", outfile})
result.WaitWithDefaultTimeout()
@ -90,9 +90,9 @@ var _ = Describe("Podman load", func() {
Expect(result.ErrorToString()).To(ContainSubstring("unknown flag"))
result = podmanTest.Podman([]string{"load", "-i", outfile})
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
Expect(result).Should(ExitCleanly())
} else {
Expect(result).Should(Exit(0))
Expect(result).Should(ExitCleanly())
}
})
@ -101,15 +101,15 @@ var _ = Describe("Podman load", func() {
save := podmanTest.Podman([]string{"save", "-o", outfile, ALPINE})
save.WaitWithDefaultTimeout()
Expect(save).Should(Exit(0))
Expect(save).Should(ExitCleanly())
rmi := podmanTest.Podman([]string{"rmi", ALPINE})
rmi.WaitWithDefaultTimeout()
Expect(rmi).Should(Exit(0))
Expect(rmi).Should(ExitCleanly())
result := podmanTest.Podman([]string{"load", "-q", "-i", outfile})
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
Expect(result).Should(ExitCleanly())
})
It("podman load directory", func() {
@ -118,15 +118,15 @@ var _ = Describe("Podman load", func() {
save := podmanTest.Podman([]string{"save", "--format", "oci-dir", "-o", outdir, ALPINE})
save.WaitWithDefaultTimeout()
Expect(save).Should(Exit(0))
Expect(save).Should(ExitCleanly())
rmi := podmanTest.Podman([]string{"rmi", ALPINE})
rmi.WaitWithDefaultTimeout()
Expect(rmi).Should(Exit(0))
Expect(rmi).Should(ExitCleanly())
result := podmanTest.Podman([]string{"load", "-i", outdir})
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
Expect(result).Should(ExitCleanly())
})
It("podman-remote load directory", func() {
@ -159,45 +159,45 @@ var _ = Describe("Podman load", func() {
pull := podmanTest.Podman([]string{"pull", alpVersion})
pull.WaitWithDefaultTimeout()
Expect(pull).Should(Exit(0))
Expect(pull).Should(ExitCleanly())
save := podmanTest.Podman([]string{"save", "-o", outfile, ALPINE, alpVersion})
save.WaitWithDefaultTimeout()
Expect(save).Should(Exit(0))
Expect(save).Should(ExitCleanly())
rmi := podmanTest.Podman([]string{"rmi", ALPINE, alpVersion})
rmi.WaitWithDefaultTimeout()
Expect(rmi).Should(Exit(0))
Expect(rmi).Should(ExitCleanly())
result := podmanTest.Podman([]string{"load", "-i", outfile})
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
Expect(result).Should(ExitCleanly())
inspect := podmanTest.Podman([]string{"inspect", ALPINE})
inspect.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
Expect(result).Should(ExitCleanly())
inspect = podmanTest.Podman([]string{"inspect", alpVersion})
inspect.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
Expect(result).Should(ExitCleanly())
})
It("podman load localhost registry from scratch", func() {
outfile := filepath.Join(podmanTest.TempDir, "load_test.tar.gz")
setup := podmanTest.Podman([]string{"tag", ALPINE, "hello:world"})
setup.WaitWithDefaultTimeout()
Expect(setup).Should(Exit(0))
Expect(setup).Should(ExitCleanly())
setup = podmanTest.Podman([]string{"save", "-o", outfile, "--format", "oci-archive", "hello:world"})
setup.WaitWithDefaultTimeout()
Expect(setup).Should(Exit(0))
Expect(setup).Should(ExitCleanly())
setup = podmanTest.Podman([]string{"rmi", "hello:world"})
setup.WaitWithDefaultTimeout()
Expect(setup).Should(Exit(0))
Expect(setup).Should(ExitCleanly())
load := podmanTest.Podman([]string{"load", "-i", outfile})
load.WaitWithDefaultTimeout()
Expect(load).Should(Exit(0))
Expect(load).Should(ExitCleanly())
result := podmanTest.Podman([]string{"images", "hello:world"})
result.WaitWithDefaultTimeout()
@ -210,19 +210,19 @@ var _ = Describe("Podman load", func() {
setup := podmanTest.Podman([]string{"tag", ALPINE, "hello"})
setup.WaitWithDefaultTimeout()
Expect(setup).Should(Exit(0))
Expect(setup).Should(ExitCleanly())
setup = podmanTest.Podman([]string{"save", "-o", outfile, "--format", "oci-archive", "hello"})
setup.WaitWithDefaultTimeout()
Expect(setup).Should(Exit(0))
Expect(setup).Should(ExitCleanly())
setup = podmanTest.Podman([]string{"rmi", "hello"})
setup.WaitWithDefaultTimeout()
Expect(setup).Should(Exit(0))
Expect(setup).Should(ExitCleanly())
load := podmanTest.Podman([]string{"load", "-i", outfile})
load.WaitWithDefaultTimeout()
Expect(load).Should(Exit(0))
Expect(load).Should(ExitCleanly())
result := podmanTest.Podman([]string{"images", "hello:latest"})
result.WaitWithDefaultTimeout()
@ -236,19 +236,19 @@ var _ = Describe("Podman load", func() {
setup := podmanTest.Podman([]string{"tag", ALPINE, "hello:world"})
setup.WaitWithDefaultTimeout()
Expect(setup).Should(Exit(0))
Expect(setup).Should(ExitCleanly())
setup = podmanTest.Podman([]string{"save", "-o", outfile, "--format", "oci-dir", "hello:world"})
setup.WaitWithDefaultTimeout()
Expect(setup).Should(Exit(0))
Expect(setup).Should(ExitCleanly())
setup = podmanTest.Podman([]string{"rmi", "hello:world"})
setup.WaitWithDefaultTimeout()
Expect(setup).Should(Exit(0))
Expect(setup).Should(ExitCleanly())
load := podmanTest.Podman([]string{"load", "-i", outfile})
load.WaitWithDefaultTimeout()
Expect(load).Should(Exit(0))
Expect(load).Should(ExitCleanly())
Expect(load.OutputToString()).To(ContainSubstring("Loaded image: sha256:"))
})
@ -257,23 +257,23 @@ var _ = Describe("Podman load", func() {
save := podmanTest.Podman([]string{"save", "-o", outfile, ALPINE})
save.WaitWithDefaultTimeout()
Expect(save).Should(Exit(0))
Expect(save).Should(ExitCleanly())
session := SystemExec("xz", []string{outfile})
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
rmi := podmanTest.Podman([]string{"rmi", ALPINE})
rmi.WaitWithDefaultTimeout()
Expect(rmi).Should(Exit(0))
Expect(rmi).Should(ExitCleanly())
result := podmanTest.Podman([]string{"load", "-i", outfile + ".xz"})
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
Expect(result).Should(ExitCleanly())
})
It("podman load multi-image archive", func() {
result := podmanTest.Podman([]string{"load", "-i", "./testdata/docker-two-images.tar.xz"})
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
Expect(result).Should(ExitCleanly())
Expect(result.OutputToString()).To(ContainSubstring("example.com/empty:latest"))
Expect(result.OutputToString()).To(ContainSubstring("example.com/empty/but:different"))
})

View File

@ -11,7 +11,6 @@ import (
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec"
)
var _ = Describe("Podman login and logout", func() {
@ -32,7 +31,7 @@ var _ = Describe("Podman login and logout", func() {
htpasswd := SystemExec("htpasswd", []string{"-Bbn", "podmantest", "test"})
htpasswd.WaitWithDefaultTimeout()
Expect(htpasswd).Should(Exit(0))
Expect(htpasswd).Should(ExitCleanly())
f, err := os.Create(filepath.Join(authPath, "htpasswd"))
Expect(err).ToNot(HaveOccurred())
@ -65,7 +64,7 @@ var _ = Describe("Podman login and logout", func() {
"-v", strings.Join([]string{certPath, "/certs:Z"}, ":"), "-e", "REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt",
"-e", "REGISTRY_HTTP_TLS_KEY=/certs/domain.key", REGISTRY_IMAGE})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
if !WaitContainerReady(podmanTest, "registry", "listening on", 20, 1) {
Skip("Cannot start docker registry.")
@ -105,7 +104,7 @@ var _ = Describe("Podman login and logout", func() {
session := podmanTest.Podman([]string{"login", "-u", "podmantest", "-p", "test", server})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
// Confirm that file was created, with the desired credentials
auths := readAuthInfo(authFile)
@ -115,11 +114,11 @@ var _ = Describe("Podman login and logout", func() {
session = podmanTest.Podman([]string{"push", ALPINE, testImg})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"logout", server})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"push", ALPINE, testImg})
session.WaitWithDefaultTimeout()
@ -150,18 +149,18 @@ var _ = Describe("Podman login and logout", func() {
session := podmanTest.Podman([]string{"login", "-u", "podmantest", "-p", "test"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"logout"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("podman login and logout with flag --authfile", func() {
authFile := filepath.Join(podmanTest.TempDir, "auth.json")
session := podmanTest.Podman([]string{"login", "--username", "podmantest", "--password", "test", "--authfile", authFile, server})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
readAuthInfo(authFile)
@ -173,11 +172,11 @@ var _ = Describe("Podman login and logout", func() {
session = podmanTest.Podman([]string{"push", "--authfile", authFile, ALPINE, testImg})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"run", "--authfile", authFile, testImg})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
// logout should fail with nonexistent authfile
session = podmanTest.Podman([]string{"logout", "--authfile", "/tmp/nonexistent", server})
@ -187,7 +186,7 @@ var _ = Describe("Podman login and logout", func() {
session = podmanTest.Podman([]string{"logout", "--authfile", authFile, server})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("podman manifest with --authfile", func() {
@ -196,13 +195,13 @@ var _ = Describe("Podman login and logout", func() {
authFile := filepath.Join(podmanTest.TempDir, "auth.json")
session := podmanTest.Podman([]string{"login", "--username", "podmantest", "--password", "test", "--authfile", authFile, server})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
readAuthInfo(authFile)
session = podmanTest.Podman([]string{"manifest", "create", testImg})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"manifest", "push", testImg})
session.WaitWithDefaultTimeout()
@ -211,12 +210,12 @@ var _ = Describe("Podman login and logout", func() {
session = podmanTest.Podman([]string{"manifest", "push", "--authfile", authFile, testImg})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
// Now remove the local manifest to trigger remote inspection
session = podmanTest.Podman([]string{"manifest", "rm", testImg})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"manifest", "inspect", testImg})
session.WaitWithDefaultTimeout()
@ -225,21 +224,21 @@ var _ = Describe("Podman login and logout", func() {
session = podmanTest.Podman([]string{"manifest", "inspect", "--authfile", authFile, testImg})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("podman login and logout with --tls-verify", func() {
session := podmanTest.Podman([]string{"login", "--username", "podmantest", "--password", "test", "--tls-verify=false", server})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"push", ALPINE, testImg})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"logout", server})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("podman login and logout with --cert-dir", func() {
certDir := filepath.Join(podmanTest.TempDir, "certs")
@ -251,15 +250,15 @@ var _ = Describe("Podman login and logout", func() {
session := podmanTest.Podman([]string{"login", "--username", "podmantest", "--password", "test", "--cert-dir", certDir, server})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"push", "--cert-dir", certDir, ALPINE, testImg})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"logout", server})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("podman login and logout with multi registry", func() {
certDir := filepath.Join(os.Getenv("HOME"), ".config/containers/certs.d", "localhost:9001")
@ -282,7 +281,7 @@ var _ = Describe("Podman login and logout", func() {
"-v", strings.Join([]string{certPath, "/certs:z"}, ":"), "-e", "REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt",
"-e", "REGISTRY_HTTP_TLS_KEY=/certs/domain.key", REGISTRY_IMAGE})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
if !WaitContainerReady(podmanTest, "registry1", "listening on", 20, 1) {
Skip("Cannot start docker registry.")
@ -290,11 +289,11 @@ var _ = Describe("Podman login and logout", func() {
session = podmanTest.Podman([]string{"login", "--username", "podmantest", "--password", "test", server})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"push", ALPINE, testImg})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"push", ALPINE, "localhost:9001/test-alpine"})
session.WaitWithDefaultTimeout()
@ -303,19 +302,19 @@ var _ = Describe("Podman login and logout", func() {
session = podmanTest.Podman([]string{"login", "--username", "podmantest", "--password", "test", "localhost:9001"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"push", ALPINE, testImg})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"push", ALPINE, "localhost:9001/test-alpine"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"logout", server})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"push", ALPINE, testImg})
session.WaitWithDefaultTimeout()
@ -324,15 +323,15 @@ var _ = Describe("Podman login and logout", func() {
session = podmanTest.Podman([]string{"push", ALPINE, "localhost:9001/test-alpine"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"login", "--username", "podmantest", "--password", "test", "localhost:9001"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"logout", "-a"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"push", ALPINE, testImg})
session.WaitWithDefaultTimeout()
@ -357,7 +356,7 @@ var _ = Describe("Podman login and logout", func() {
testRepository,
})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
authInfo := readAuthInfo(authFile)
Expect(authInfo).To(HaveKey(testRepository))
@ -368,7 +367,7 @@ var _ = Describe("Podman login and logout", func() {
testRepository,
})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
authInfo = readAuthInfo(authFile)
Expect(authInfo).NotTo(HaveKey(testRepository))
@ -386,7 +385,7 @@ var _ = Describe("Podman login and logout", func() {
testTarget,
})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
authInfo := readAuthInfo(authFile)
Expect(authInfo).To(HaveKey(testTarget))
@ -397,7 +396,7 @@ var _ = Describe("Podman login and logout", func() {
ALPINE, testTarget,
})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
@ -417,7 +416,7 @@ var _ = Describe("Podman login and logout", func() {
testRepo,
})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
}
authInfo := readAuthInfo(authFile)
@ -430,7 +429,7 @@ var _ = Describe("Podman login and logout", func() {
ALPINE, testRepos[0] + "/test-image-alpine",
})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{
"logout",
@ -438,7 +437,7 @@ var _ = Describe("Podman login and logout", func() {
testRepos[0],
})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{
"push",
@ -446,7 +445,7 @@ var _ = Describe("Podman login and logout", func() {
ALPINE, testRepos[0] + "/test-image-alpine",
})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{
"logout",
@ -454,7 +453,7 @@ var _ = Describe("Podman login and logout", func() {
testRepos[1],
})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
authInfo = readAuthInfo(authFile)
Expect(authInfo).NotTo(HaveKey(testRepos[0]))
@ -476,7 +475,7 @@ var _ = Describe("Podman login and logout", func() {
invalidArg,
})
session.WaitWithDefaultTimeout()
Expect(session).To(Exit(0))
Expect(session).To(ExitCleanly())
}
})
@ -504,7 +503,7 @@ var _ = Describe("Podman login and logout", func() {
ALPINE, server + "/test-image",
})
session.WaitWithDefaultTimeout()
Expect(session).To(Exit(0))
Expect(session).To(ExitCleanly())
})
It("podman login and logout with repository pull with wrong auth.json credentials", func() {
@ -519,7 +518,7 @@ var _ = Describe("Podman login and logout", func() {
testTarget,
})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{
"push",
@ -527,7 +526,7 @@ var _ = Describe("Podman login and logout", func() {
ALPINE, testTarget,
})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
// only `server + /podmantest` and `server` have the correct login data
err := os.WriteFile(authFile, []byte(fmt.Sprintf(`{"auths": {

View File

@ -17,7 +17,7 @@ var _ = Describe("Podman pull", func() {
It("podman pull multiple images with/without tag/digest", func() {
session := podmanTest.Podman([]string{"pull", "busybox:musl", "alpine", "alpine:latest", "quay.io/libpod/cirros", "quay.io/libpod/testdigest_v2s2@sha256:755f4d90b3716e2bf57060d249e2cd61c9ac089b1233465c5c2cb2d7ee550fdb"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"pull", "busybox:latest", "docker.io/library/ibetthisdoesnotexistfr:random", "alpine"})
session.WaitWithDefaultTimeout()
@ -27,7 +27,7 @@ var _ = Describe("Podman pull", func() {
session = podmanTest.Podman([]string{"rmi", "busybox:musl", "alpine", "quay.io/libpod/cirros", "testdigest_v2s2@sha256:755f4d90b3716e2bf57060d249e2cd61c9ac089b1233465c5c2cb2d7ee550fdb"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("podman pull bogus image", func() {
@ -39,27 +39,27 @@ var _ = Describe("Podman pull", func() {
It("podman pull with tag --quiet", func() {
session := podmanTest.Podman([]string{"pull", "-q", "quay.io/libpod/testdigest_v2s2:20200210"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
quietOutput := session.OutputToString()
session = podmanTest.Podman([]string{"inspect", "testdigest_v2s2:20200210", "--format", "{{.ID}}"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.OutputToString()).To(Equal(quietOutput))
session = podmanTest.Podman([]string{"rmi", "testdigest_v2s2:20200210"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("podman pull without tag", func() {
session := podmanTest.Podman([]string{"pull", "quay.io/libpod/testdigest_v2s2"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"rmi", "testdigest_v2s2"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("podman pull and run on split imagestore", func() {
@ -69,44 +69,44 @@ var _ = Describe("Podman pull", func() {
// Make alpine write-able
session := podmanTest.Podman([]string{"build", "--pull=never", "--tag", imgName, "build/basicalpine"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
tmpDir := filepath.Join(podmanTest.TempDir, "splitstore")
outfile := filepath.Join(podmanTest.TempDir, "image.tar")
save := podmanTest.Podman([]string{"save", "-o", outfile, "--format", "oci-archive", imgName})
save.WaitWithDefaultTimeout()
Expect(save).Should(Exit(0))
Expect(save).Should(ExitCleanly())
rmi := podmanTest.Podman([]string{"rmi", imgName})
rmi.WaitWithDefaultTimeout()
Expect(rmi).Should(Exit(0))
Expect(rmi).Should(ExitCleanly())
// load to splitstore
result := podmanTest.Podman([]string{"load", "--imagestore", tmpDir, "-q", "-i", outfile})
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
Expect(result).Should(ExitCleanly())
// tag busybox to busybox-test in graphroot since we can delete readonly busybox
session = podmanTest.Podman([]string{"tag", "quay.io/libpod/busybox:latest", "busybox-test"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"images", "--imagestore", tmpDir})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.OutputToString()).To(ContainSubstring(imgName))
Expect(session.OutputToString()).To(ContainSubstring("busybox-test"))
// Test deleting image in graphroot even when `--imagestore` is set
session = podmanTest.Podman([]string{"rmi", "--imagestore", tmpDir, "busybox-test"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
// Images without --imagestore should not contain alpine
session = podmanTest.Podman([]string{"images"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.OutputToString()).To(Not(ContainSubstring(imgName)))
// Set `imagestore` in `storage.conf` and container should run.
@ -125,14 +125,14 @@ var _ = Describe("Podman pull", func() {
session = podmanTest.Podman([]string{"run", "--name", "test", "--rm",
imgName, "echo", "helloworld"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.OutputToString()).To(ContainSubstring("helloworld"))
})
It("podman pull by digest", func() {
session := podmanTest.Podman([]string{"pull", "quay.io/libpod/testdigest_v2s2@sha256:755f4d90b3716e2bf57060d249e2cd61c9ac089b1233465c5c2cb2d7ee550fdb"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
// Without a tag/digest the input is normalized with the "latest" tag, see #11964
session = podmanTest.Podman([]string{"rmi", "testdigest_v2s2"})
@ -141,26 +141,26 @@ var _ = Describe("Podman pull", func() {
session = podmanTest.Podman([]string{"rmi", "testdigest_v2s2@sha256:755f4d90b3716e2bf57060d249e2cd61c9ac089b1233465c5c2cb2d7ee550fdb"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("podman pull check all tags", func() {
session := podmanTest.Podman([]string{"pull", "--all-tags", "quay.io/libpod/testdigest_v2s2"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"images"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(len(session.OutputToStringArray())).To(BeNumerically(">=", 2), "Expected at least two images")
session = podmanTest.Podman([]string{"pull", "-a", "quay.io/libpod/testdigest_v2s2"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"images"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(len(session.OutputToStringArray())).To(BeNumerically(">=", 2), "Expected at least two images")
})
@ -173,50 +173,50 @@ var _ = Describe("Podman pull", func() {
It("podman pull by digest (image list)", func() {
session := podmanTest.Podman([]string{"pull", "--arch=arm64", ALPINELISTDIGEST})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
// inspect using the digest of the list
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoTags}}", ALPINELISTDIGEST})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(string(session.Out.Contents())).To(HavePrefix("[]"))
// inspect using the digest of the list
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINELISTDIGEST})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
// inspect using the digest of the arch-specific image's manifest
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoTags}}", ALPINEARM64DIGEST})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(string(session.Out.Contents())).To(HavePrefix("[]"))
// inspect using the digest of the arch-specific image's manifest
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINEARM64DIGEST})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
// inspect using the image ID
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoTags}}", ALPINEARM64ID})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(string(session.Out.Contents())).To(HavePrefix("[]"))
// inspect using the image ID
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINEARM64ID})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
// remove using the digest of the list
session = podmanTest.Podman([]string{"rmi", ALPINELISTDIGEST})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("podman pull by instance digest (image list)", func() {
session := podmanTest.Podman([]string{"pull", "--arch=arm64", ALPINEARM64DIGEST})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
// inspect using the digest of the list
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoTags}}", ALPINELISTDIGEST})
session.WaitWithDefaultTimeout()
@ -228,83 +228,83 @@ var _ = Describe("Podman pull", func() {
// inspect using the digest of the arch-specific image's manifest
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoTags}}", ALPINEARM64DIGEST})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(string(session.Out.Contents())).To(HavePrefix("[]"))
// inspect using the digest of the arch-specific image's manifest
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINEARM64DIGEST})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(string(session.Out.Contents())).To(Not(ContainSubstring(ALPINELISTDIGEST)))
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
// inspect using the image ID
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoTags}}", ALPINEARM64ID})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(string(session.Out.Contents())).To(HavePrefix("[]"))
// inspect using the image ID
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINEARM64ID})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(string(session.Out.Contents())).To(Not(ContainSubstring(ALPINELISTDIGEST)))
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
// remove using the digest of the instance
session = podmanTest.Podman([]string{"rmi", ALPINEARM64DIGEST})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("podman pull by tag (image list)", func() {
session := podmanTest.Podman([]string{"pull", "--arch=arm64", ALPINELISTTAG})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
// inspect using the tag we used for pulling
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoTags}}", ALPINELISTTAG})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTTAG))
// inspect using the tag we used for pulling
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINELISTTAG})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
// inspect using the digest of the list
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoTags}}", ALPINELISTDIGEST})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTTAG))
// inspect using the digest of the list
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINELISTDIGEST})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
// inspect using the digest of the arch-specific image's manifest
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoTags}}", ALPINEARM64DIGEST})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTTAG))
// inspect using the digest of the arch-specific image's manifest
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINEARM64DIGEST})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
// inspect using the image ID
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoTags}}", ALPINEARM64ID})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTTAG))
// inspect using the image ID
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINEARM64ID})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
// remove using the tag
session = podmanTest.Podman([]string{"rmi", ALPINELISTTAG})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("podman pull from docker-archive", func() {
@ -315,16 +315,16 @@ var _ = Describe("Podman pull", func() {
session := podmanTest.Podman([]string{"save", "-o", tarfn, "cirros"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"rmi", "cirros"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"pull", fmt.Sprintf("docker-archive:%s", tarfn)})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"rmi", "cirros"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
// Pulling a multi-image archive without further specifying
// which image _must_ error out. Pulling is restricted to one
@ -339,19 +339,19 @@ var _ = Describe("Podman pull", func() {
// and index syntax.
session = podmanTest.Podman([]string{"pull", "docker-archive:./testdata/docker-two-images.tar.xz:@0"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"pull", "docker-archive:./testdata/docker-two-images.tar.xz:example.com/empty:latest"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"pull", "docker-archive:./testdata/docker-two-images.tar.xz:@1"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"pull", "docker-archive:./testdata/docker-two-images.tar.xz:example.com/empty/but:different"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
// Now check for some errors.
session = podmanTest.Podman([]string{"pull", "docker-archive:./testdata/docker-two-images.tar.xz:foo.com/does/not/exist:latest"})
@ -375,16 +375,16 @@ var _ = Describe("Podman pull", func() {
session := podmanTest.Podman([]string{"save", "--format", "oci-archive", "-o", tarfn, "cirros"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"rmi", "cirros"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"pull", fmt.Sprintf("oci-archive:%s", tarfn)})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"rmi", "cirros"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("podman pull from local directory", func() {
@ -398,13 +398,13 @@ var _ = Describe("Podman pull", func() {
session := podmanTest.Podman([]string{"push", "cirros", imgPath})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"rmi", "cirros"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"run", imgPath, "ls"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
// Note that reference is not preserved in dir.
session = podmanTest.Podman([]string{"image", "exists", "cirros"})
session.WaitWithDefaultTimeout()
@ -423,16 +423,16 @@ var _ = Describe("Podman pull", func() {
session := podmanTest.Podman([]string{"push", "cirros", imgPath})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"rmi", "cirros"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"pull", imgPath})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"image", "exists", imgName})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("podman pull + inspect from unqualified-search registry", func() {
@ -456,7 +456,7 @@ var _ = Describe("Podman pull", func() {
getID := func(image string) string {
setup := podmanTest.Podman([]string{"image", "inspect", image})
setup.WaitWithDefaultTimeout()
Expect(setup).Should(Exit(0))
Expect(setup).Should(ExitCleanly())
data := setup.InspectImageJSON() // returns []inspect.ImageData
Expect(data).To(HaveLen(1))
@ -466,11 +466,11 @@ var _ = Describe("Podman pull", func() {
untag := func(image string) {
setup := podmanTest.Podman([]string{"untag", image})
setup.WaitWithDefaultTimeout()
Expect(setup).Should(Exit(0))
Expect(setup).Should(ExitCleanly())
setup = podmanTest.Podman([]string{"image", "inspect", image})
setup.WaitWithDefaultTimeout()
Expect(setup).Should(Exit(0))
Expect(setup).Should(ExitCleanly())
data := setup.InspectImageJSON() // returns []inspect.ImageData
Expect(data).To(HaveLen(1))
@ -480,10 +480,10 @@ var _ = Describe("Podman pull", func() {
tag := func(image, tag string) {
setup := podmanTest.Podman([]string{"tag", image, tag})
setup.WaitWithDefaultTimeout()
Expect(setup).Should(Exit(0))
Expect(setup).Should(ExitCleanly())
setup = podmanTest.Podman([]string{"image", "exists", tag})
setup.WaitWithDefaultTimeout()
Expect(setup).Should(Exit(0))
Expect(setup).Should(ExitCleanly())
}
image1 := getID(ALPINE)
@ -524,7 +524,7 @@ var _ = Describe("Podman pull", func() {
setup := podmanTest.Podman([]string{"image", "inspect", name})
setup.WaitWithDefaultTimeout()
Expect(setup).Should(Exit(0))
Expect(setup).Should(ExitCleanly())
data := setup.InspectImageJSON() // returns []inspect.ImageData
Expect(data).To(HaveLen(1))
@ -549,11 +549,11 @@ var _ = Describe("Podman pull", func() {
session = podmanTest.Podman([]string{"pull", "-q", "--platform=linux/arm64", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
setup := podmanTest.Podman([]string{"image", "inspect", session.OutputToString()})
setup.WaitWithDefaultTimeout()
Expect(setup).Should(Exit(0))
Expect(setup).Should(ExitCleanly())
data := setup.InspectImageJSON() // returns []inspect.ImageData
Expect(data).To(HaveLen(1))
@ -576,11 +576,11 @@ var _ = Describe("Podman pull", func() {
session = podmanTest.Podman([]string{"pull", "-q", "--arch=arm64", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
setup := podmanTest.Podman([]string{"image", "inspect", session.OutputToString()})
setup.WaitWithDefaultTimeout()
Expect(setup).Should(Exit(0))
Expect(setup).Should(ExitCleanly())
data := setup.InspectImageJSON() // returns []inspect.ImageData
Expect(data).To(HaveLen(1))
@ -591,14 +591,14 @@ var _ = Describe("Podman pull", func() {
It("podman pull progress", func() {
session := podmanTest.Podman([]string{"pull", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
output := session.ErrorToString()
Expect(output).To(ContainSubstring("Getting image source signatures"))
Expect(output).To(ContainSubstring("Copying blob "))
session = podmanTest.Podman([]string{"pull", "-q", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.ErrorToString()).To(BeEmpty())
})
@ -619,7 +619,7 @@ var _ = Describe("Podman pull", func() {
session = podmanTest.Podman([]string{"rmi", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
// Pulling encrypted image without key should fail
session = podmanTest.Podman([]string{"pull", imgPath})
@ -634,10 +634,10 @@ var _ = Describe("Podman pull", func() {
// Pulling encrypted image with correct key should pass
session = podmanTest.Podman([]string{"pull", "--decryption-key", privateKeyFileName, imgPath})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"images"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
return session
}
@ -673,7 +673,7 @@ var _ = Describe("Podman pull", func() {
defer lock.Unlock()
session := podmanTest.Podman([]string{"run", "-d", "--name", "registry", "-p", "5000:5000", REGISTRY_IMAGE, "/entrypoint.sh", "/etc/docker/registry/config.yml"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
if !WaitContainerReady(podmanTest, "registry", "listening on", 20, 1) {
Skip("Cannot start docker registry.")

View File

@ -24,11 +24,11 @@ var _ = Describe("Podman push", func() {
SkipIfRemote("Remote push does not support containers-storage transport")
session := podmanTest.Podman([]string{"push", ALPINE, "containers-storage:busybox:test"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"rmi", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("podman push to dir", func() {
@ -37,13 +37,13 @@ var _ = Describe("Podman push", func() {
session := podmanTest.Podman([]string{"push", "--remove-signatures", ALPINE,
fmt.Sprintf("dir:%s", bbdir)})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
bbdir = filepath.Join(podmanTest.TempDir, "busybox")
session = podmanTest.Podman([]string{"push", "--format", "oci", ALPINE,
fmt.Sprintf("dir:%s", bbdir)})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("podman push to oci with compression-format and compression-level", func() {
@ -60,7 +60,7 @@ var _ = Describe("Podman push", func() {
session = podmanTest.Podman([]string{"push", "--compression-format=zstd", "--remove-signatures", ALPINE,
fmt.Sprintf("oci:%s", bbdir)})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
foundZstdFile := false
@ -96,7 +96,7 @@ var _ = Describe("Podman push", func() {
defer lock.Unlock()
session := podmanTest.Podman([]string{"run", "-d", "--name", "registry", "-p", "5000:5000", REGISTRY_IMAGE, "/entrypoint.sh", "/etc/docker/registry/config.yml"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
if !WaitContainerReady(podmanTest, "registry", "listening on", 20, 1) {
Skip("Cannot start docker registry.")
@ -104,26 +104,26 @@ var _ = Describe("Podman push", func() {
session = podmanTest.Podman([]string{"build", "-t", "imageone", "build/basicalpine"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
push := podmanTest.Podman([]string{"push", "--tls-verify=false", "--remove-signatures", "imageone", "localhost:5000/image"})
push.WaitWithDefaultTimeout()
Expect(push).Should(Exit(0))
Expect(push).Should(ExitCleanly())
session = podmanTest.Podman([]string{"run", "--rm", "--net", "host", "quay.io/skopeo/stable", "inspect", "--tls-verify=false", "--raw", "docker://localhost:5000/image:latest"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
output := session.OutputToString()
// Default compression is gzip and push with `--force-compression=false` no traces of `zstd` should be there.
Expect(output).ToNot(ContainSubstring("zstd"))
push = podmanTest.Podman([]string{"push", "--tls-verify=false", "--force-compression=false", "--compression-format", "zstd", "--remove-signatures", "imageone", "localhost:5000/image"})
push.WaitWithDefaultTimeout()
Expect(push).Should(Exit(0))
Expect(push).Should(ExitCleanly())
session = podmanTest.Podman([]string{"run", "--rm", "--net", "host", "quay.io/skopeo/stable", "inspect", "--tls-verify=false", "--raw", "docker://localhost:5000/image:latest"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
output = session.OutputToString()
// Although `--compression-format` is `zstd` but still no traces of `zstd` should be in image
// since blobs must be reused from last `gzip` image.
@ -131,11 +131,11 @@ var _ = Describe("Podman push", func() {
push = podmanTest.Podman([]string{"push", "--tls-verify=false", "--compression-format", "zstd", "--force-compression", "--remove-signatures", "imageone", "localhost:5000/image"})
push.WaitWithDefaultTimeout()
Expect(push).Should(Exit(0))
Expect(push).Should(ExitCleanly())
session = podmanTest.Podman([]string{"run", "--rm", "--net", "host", "quay.io/skopeo/stable", "inspect", "--tls-verify=false", "--raw", "docker://localhost:5000/image:latest"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
output = session.OutputToString()
// Should contain `zstd` layer, substring `zstd` is enough to confirm in skopeo inspect output that `zstd` layer is present.
Expect(output).To(ContainSubstring("zstd"))
@ -153,7 +153,7 @@ var _ = Describe("Podman push", func() {
defer lock.Unlock()
session := podmanTest.Podman([]string{"run", "-d", "--name", "registry", "-p", "5000:5000", REGISTRY_IMAGE, "/entrypoint.sh", "/etc/docker/registry/config.yml"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
if !WaitContainerReady(podmanTest, "registry", "listening on", 20, 1) {
Skip("Cannot start docker registry.")
@ -161,12 +161,12 @@ var _ = Describe("Podman push", func() {
push := podmanTest.Podman([]string{"push", "-q", "--tls-verify=false", "--remove-signatures", ALPINE, "localhost:5000/my-alpine"})
push.WaitWithDefaultTimeout()
Expect(push).Should(Exit(0))
Expect(push).Should(ExitCleanly())
Expect(push.ErrorToString()).To(BeEmpty())
push = podmanTest.Podman([]string{"push", "--compression-format=gzip", "--compression-level=1", "--tls-verify=false", "--remove-signatures", ALPINE, "localhost:5000/my-alpine"})
push.WaitWithDefaultTimeout()
Expect(push).Should(Exit(0))
Expect(push).Should(ExitCleanly())
output := push.ErrorToString()
Expect(output).To(ContainSubstring("Copying blob "))
Expect(output).To(ContainSubstring("Copying config "))
@ -180,7 +180,7 @@ var _ = Describe("Podman push", func() {
if !IsRemote() { // Remote does not support --encryption-key
push = podmanTest.Podman([]string{"push", "--encryption-key", "jwe:" + publicKeyFileName, "--tls-verify=false", "--remove-signatures", ALPINE, "localhost:5000/my-alpine"})
push.WaitWithDefaultTimeout()
Expect(push).Should(Exit(0))
Expect(push).Should(ExitCleanly())
}
// Test --digestfile option
@ -190,7 +190,7 @@ var _ = Describe("Podman push", func() {
fi, err := os.Lstat(digestFile)
Expect(err).ToNot(HaveOccurred())
Expect(fi.Name()).To(Equal("digestfile.txt"))
Expect(push2).Should(Exit(0))
Expect(push2).Should(ExitCleanly())
if !IsRemote() { // Remote does not support signing
By("pushing and pulling with --sign-by-sigstore-private-key")
@ -214,7 +214,7 @@ var _ = Describe("Podman push", func() {
// Verify that the policy rejects unsigned images
push := podmanTest.Podman([]string{"push", "-q", "--tls-verify=false", "--remove-signatures", ALPINE, "localhost:5000/sigstore-signed"})
push.WaitWithDefaultTimeout()
Expect(push).Should(Exit(0))
Expect(push).Should(ExitCleanly())
Expect(push.ErrorToString()).To(BeEmpty())
pull := podmanTest.Podman([]string{"pull", "-q", "--tls-verify=false", "--signature-policy", policyPath, "localhost:5000/sigstore-signed"})
@ -225,18 +225,18 @@ var _ = Describe("Podman push", func() {
// Sign an image, and verify it is accepted.
push = podmanTest.Podman([]string{"push", "-q", "--tls-verify=false", "--remove-signatures", "--sign-by-sigstore-private-key", "testdata/sigstore-key.key", "--sign-passphrase-file", "testdata/sigstore-key.key.pass", ALPINE, "localhost:5000/sigstore-signed"})
push.WaitWithDefaultTimeout()
Expect(push).Should(Exit(0))
Expect(push).Should(ExitCleanly())
Expect(push.ErrorToString()).To(BeEmpty())
pull = podmanTest.Podman([]string{"pull", "-q", "--tls-verify=false", "--signature-policy", policyPath, "localhost:5000/sigstore-signed"})
pull.WaitWithDefaultTimeout()
Expect(pull).Should(Exit(0))
Expect(pull).Should(ExitCleanly())
By("pushing and pulling with --sign-by-sigstore")
// Verify that the policy rejects unsigned images
push = podmanTest.Podman([]string{"push", "-q", "--tls-verify=false", "--remove-signatures", ALPINE, "localhost:5000/sigstore-signed-params"})
push.WaitWithDefaultTimeout()
Expect(push).Should(Exit(0))
Expect(push).Should(ExitCleanly())
Expect(push.ErrorToString()).To(BeEmpty())
pull = podmanTest.Podman([]string{"pull", "--tls-verify=false", "--signature-policy", policyPath, "localhost:5000/sigstore-signed-params"})
@ -247,12 +247,12 @@ var _ = Describe("Podman push", func() {
// Sign an image, and verify it is accepted.
push = podmanTest.Podman([]string{"push", "-q", "--tls-verify=false", "--remove-signatures", "--sign-by-sigstore", "testdata/sigstore-signing-params.yaml", ALPINE, "localhost:5000/sigstore-signed-params"})
push.WaitWithDefaultTimeout()
Expect(push).Should(Exit(0))
Expect(push).Should(ExitCleanly())
Expect(push.ErrorToString()).To(BeEmpty())
pull = podmanTest.Podman([]string{"pull", "--tls-verify=false", "--signature-policy", policyPath, "localhost:5000/sigstore-signed-params"})
pull.WaitWithDefaultTimeout()
Expect(pull).Should(Exit(0))
Expect(pull).Should(ExitCleanly())
}
}
})
@ -263,12 +263,12 @@ var _ = Describe("Podman push", func() {
inspect := podmanTest.Podman([]string{"inspect", "--format={{.ID}}", ALPINE})
inspect.WaitWithDefaultTimeout()
Expect(inspect).Should(Exit(0))
Expect(inspect).Should(ExitCleanly())
imageID := inspect.OutputToString()
push := podmanTest.Podman([]string{"push", "--signature-policy", denyAllPolicy, "-q", imageID, "dir:" + filepath.Join(podmanTest.TempDir, imageID)})
push.WaitWithDefaultTimeout()
Expect(push).Should(Exit(0))
Expect(push).Should(ExitCleanly())
Expect(push.ErrorToString()).To(BeEmpty())
})
@ -291,7 +291,7 @@ var _ = Describe("Podman push", func() {
defer lock.Unlock()
htpasswd := SystemExec("htpasswd", []string{"-Bbn", "podmantest", "test"})
htpasswd.WaitWithDefaultTimeout()
Expect(htpasswd).Should(Exit(0))
Expect(htpasswd).Should(ExitCleanly())
f, err := os.Create(filepath.Join(authPath, "htpasswd"))
Expect(err).ToNot(HaveOccurred())
@ -308,7 +308,7 @@ var _ = Describe("Podman push", func() {
"-v", strings.Join([]string{certPath, "/certs"}, ":"), "-e", "REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt",
"-e", "REGISTRY_HTTP_TLS_KEY=/certs/domain.key", REGISTRY_IMAGE})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
if !WaitContainerReady(podmanTest, "registry", "listening on", 20, 1) {
Skip("Cannot start docker registry.")
@ -324,11 +324,11 @@ var _ = Describe("Podman push", func() {
push = podmanTest.Podman([]string{"push", "--creds=podmantest:test", "--tls-verify=false", ALPINE, "localhost:5000/tlstest"})
push.WaitWithDefaultTimeout()
Expect(push).Should(Exit(0))
Expect(push).Should(ExitCleanly())
Expect(push.ErrorToString()).To(ContainSubstring("Writing manifest to image destination"))
setup := SystemExec("cp", []string{filepath.Join(certPath, "domain.crt"), "/etc/containers/certs.d/localhost:5000/ca.crt"})
Expect(setup).Should(Exit(0))
Expect(setup).Should(ExitCleanly())
push = podmanTest.Podman([]string{"push", "--creds=podmantest:wrongpasswd", ALPINE, "localhost:5000/credstest"})
push.WaitWithDefaultTimeout()
@ -345,17 +345,17 @@ var _ = Describe("Podman push", func() {
push = podmanTest.Podman([]string{"push", "--creds=podmantest:test", ALPINE, "localhost:5000/defaultflags"})
push.WaitWithDefaultTimeout()
Expect(push).Should(Exit(0))
Expect(push).Should(ExitCleanly())
Expect(push.ErrorToString()).To(ContainSubstring("Writing manifest to image destination"))
// create and push manifest
session = podmanTest.Podman([]string{"manifest", "create", "localhost:5000/manifesttest"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"manifest", "push", "--creds=podmantest:test", "--tls-verify=false", "--all", "localhost:5000/manifesttest"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
Expect(session.ErrorToString()).To(ContainSubstring("Writing manifest list to image destination"))
})
@ -371,11 +371,11 @@ var _ = Describe("Podman push", func() {
session := podmanTest.Podman([]string{"push", "--encryption-key", "jwe:" + publicKeyFileName, ALPINE, fmt.Sprintf("oci:%s", bbdir)})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"rmi", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("podman push to docker-archive", func() {
@ -384,7 +384,7 @@ var _ = Describe("Podman push", func() {
session := podmanTest.Podman([]string{"push", ALPINE,
fmt.Sprintf("docker-archive:%s:latest", tarfn)})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("podman push to docker daemon", func() {
@ -394,10 +394,10 @@ var _ = Describe("Podman push", func() {
if setup.LineInOutputContains("Active: inactive") {
setup = SystemExec("systemctl", []string{"start", "docker"})
Expect(setup).Should(Exit(0))
Expect(setup).Should(ExitCleanly())
defer func() {
stop := SystemExec("systemctl", []string{"stop", "docker"})
Expect(stop).Should(Exit(0))
Expect(stop).Should(ExitCleanly())
}()
} else if setup.ExitCode() != 0 {
Skip("Docker is not available")
@ -405,14 +405,14 @@ var _ = Describe("Podman push", func() {
session := podmanTest.Podman([]string{"push", ALPINE, "docker-daemon:alpine:podmantest"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
check := SystemExec("docker", []string{"images", "--format", "{{.Repository}}:{{.Tag}}"})
Expect(check).Should(Exit(0))
Expect(check).Should(ExitCleanly())
Expect(check.OutputToString()).To(ContainSubstring("alpine:podmantest"))
clean := SystemExec("docker", []string{"rmi", "alpine:podmantest"})
Expect(clean).Should(Exit(0))
Expect(clean).Should(ExitCleanly())
})
It("podman push to oci-archive", func() {
@ -421,7 +421,7 @@ var _ = Describe("Podman push", func() {
session := podmanTest.Podman([]string{"push", ALPINE,
fmt.Sprintf("oci-archive:%s:latest", tarfn)})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("podman push to docker-archive no reference", func() {
@ -430,7 +430,7 @@ var _ = Describe("Podman push", func() {
session := podmanTest.Podman([]string{"push", ALPINE,
fmt.Sprintf("docker-archive:%s", tarfn)})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
It("podman push to oci-archive no reference", func() {
@ -440,7 +440,7 @@ var _ = Describe("Podman push", func() {
fmt.Sprintf("oci-archive:%s", ociarc)})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
})
})

View File

@ -10,7 +10,6 @@ import (
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec"
)
var _ = Describe("Podman save", func() {
@ -20,7 +19,7 @@ var _ = Describe("Podman save", func() {
save := podmanTest.Podman([]string{"save", "-o", outfile, ALPINE})
save.WaitWithDefaultTimeout()
Expect(save).Should(Exit(0))
Expect(save).Should(ExitCleanly())
})
It("podman save signature-policy flag", func() {
@ -29,7 +28,7 @@ var _ = Describe("Podman save", func() {
save := podmanTest.Podman([]string{"save", "--signature-policy", "/etc/containers/policy.json", "-o", outfile, ALPINE})
save.WaitWithDefaultTimeout()
Expect(save).Should(Exit(0))
Expect(save).Should(ExitCleanly())
})
It("podman save oci flag", func() {
@ -37,7 +36,7 @@ var _ = Describe("Podman save", func() {
save := podmanTest.Podman([]string{"save", "-o", outfile, "--format", "oci-archive", ALPINE})
save.WaitWithDefaultTimeout()
Expect(save).Should(Exit(0))
Expect(save).Should(ExitCleanly())
})
It("podman save with stdout", func() {
@ -46,7 +45,7 @@ var _ = Describe("Podman save", func() {
save := podmanTest.Podman([]string{"save", ALPINE, ">", outfile})
save.WaitWithDefaultTimeout()
Expect(save).Should(Exit(0))
Expect(save).Should(ExitCleanly())
})
It("podman save quiet flag", func() {
@ -54,7 +53,7 @@ var _ = Describe("Podman save", func() {
save := podmanTest.Podman([]string{"save", "-q", "-o", outfile, ALPINE})
save.WaitWithDefaultTimeout()
Expect(save).Should(Exit(0))
Expect(save).Should(ExitCleanly())
})
It("podman save bogus image", func() {
@ -70,7 +69,7 @@ var _ = Describe("Podman save", func() {
save := podmanTest.Podman([]string{"save", "--format", "oci-dir", "-o", outdir, ALPINE})
save.WaitWithDefaultTimeout()
Expect(save).Should(Exit(0))
Expect(save).Should(ExitCleanly())
// Smoke test if it looks like an OCI dir
Expect(filepath.Join(outdir, "oci-layout")).Should(BeAnExistingFile())
@ -83,7 +82,7 @@ var _ = Describe("Podman save", func() {
save := podmanTest.Podman([]string{"save", "--format", "docker-dir", "-o", outdir, ALPINE})
save.WaitWithDefaultTimeout()
Expect(save).Should(Exit(0))
Expect(save).Should(ExitCleanly())
// Smoke test if it looks like a docker dir
Expect(filepath.Join(outdir, "version")).Should(BeAnExistingFile())
@ -94,7 +93,7 @@ var _ = Describe("Podman save", func() {
save := podmanTest.Podman([]string{"save", "--compress", "--format", "docker-dir", "-o", outdir, ALPINE})
save.WaitWithDefaultTimeout()
Expect(save).Should(Exit(0))
Expect(save).Should(ExitCleanly())
})
It("podman save to directory with --compress but not use docker-dir and oci-dir", func() {
@ -140,7 +139,7 @@ var _ = Describe("Podman save", func() {
session := podmanTest.Podman([]string{"run", "-d", "--name", "registry", "-p", strings.Join([]string{strconv.Itoa(port), strconv.Itoa(port)}, ":"), REGISTRY_IMAGE})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
if !WaitContainerReady(podmanTest, "registry", "listening on", 20, 1) {
Skip("Cannot start docker registry.")
}
@ -176,15 +175,15 @@ default-docker:
session = podmanTest.Podman([]string{"tag", ALPINE, "localhost:5000/alpine"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"push", "--tls-verify=false", "--sign-by", "foo@bar.com", "localhost:5000/alpine"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"rmi", ALPINE, "localhost:5000/alpine"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
if !IsRemote() {
// Generate a signature verification policy file
@ -193,7 +192,7 @@ default-docker:
session = podmanTest.Podman([]string{"pull", "--tls-verify=false", "--signature-policy", policyPath, "localhost:5000/alpine"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
outfile := filepath.Join(podmanTest.TempDir, "temp.tar")
save := podmanTest.Podman([]string{"save", "remove-signatures=true", "-o", outfile, "localhost:5000/alpine"})
@ -206,13 +205,13 @@ default-docker:
// pull a digest reference
session := podmanTest.Podman([]string{"pull", ALPINELISTDIGEST})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
// save a digest reference should exit without error.
outfile := filepath.Join(podmanTest.TempDir, "temp.tar")
save := podmanTest.Podman([]string{"save", "-o", outfile, ALPINELISTDIGEST})
save.WaitWithDefaultTimeout()
Expect(save).Should(Exit(0))
Expect(save).Should(ExitCleanly())
})
It("podman save --multi-image-archive (tagged images)", func() {
@ -224,7 +223,7 @@ default-docker:
// most three images and sort them by size.
session := podmanTest.Podman([]string{"images", "--sort", "size", "--format", "{{.ID}}"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
ids := session.OutputToStringArray()
Expect(len(ids)).To(BeNumerically(">", 1), "We need to have *some* images to save")
@ -242,17 +241,17 @@ func multiImageSave(podmanTest *PodmanTestIntegration, images []string) {
outfile := filepath.Join(podmanTest.TempDir, "temp.tar")
session := podmanTest.Podman(append([]string{"save", "-o", outfile, "--multi-image-archive"}, images...))
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
// Remove all images.
session = podmanTest.Podman([]string{"rmi", "-af"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
// Now load the archive.
session = podmanTest.Podman([]string{"load", "-i", outfile})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
// Grep for each image in the `podman load` output.
for _, image := range images {
Expect(session.OutputToString()).To(ContainSubstring(image))
@ -262,6 +261,6 @@ func multiImageSave(podmanTest *PodmanTestIntegration, images []string) {
for _, image := range images {
session = podmanTest.Podman([]string{"image", "exists", image})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session).Should(ExitCleanly())
}
}