mirror of
https://github.com/containers/podman.git
synced 2025-06-23 18:59:30 +08:00
Merge pull request #20089 from edsantiago/e2e_check_stderr__more
e2e: ExitCleanly(): a few more
This commit is contained in:
@ -23,110 +23,110 @@ var _ = Describe("Podman load", func() {
|
||||
images.WaitWithDefaultTimeout()
|
||||
GinkgoWriter.Println(images.OutputToStringArray())
|
||||
|
||||
save := podmanTest.Podman([]string{"save", "-o", outfile, ALPINE})
|
||||
save := podmanTest.Podman([]string{"save", "-q", "-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 := podmanTest.Podman([]string{"load", "-q", "-i", outfile})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(result).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman load compressed tar file", func() {
|
||||
outfile := filepath.Join(podmanTest.TempDir, "alpine.tar")
|
||||
|
||||
save := podmanTest.Podman([]string{"save", "-o", outfile, ALPINE})
|
||||
save := podmanTest.Podman([]string{"save", "-q", "-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 := podmanTest.Podman([]string{"load", "-q", "-i", outfile})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(result).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman load oci-archive image", func() {
|
||||
outfile := filepath.Join(podmanTest.TempDir, "alpine.tar")
|
||||
|
||||
save := podmanTest.Podman([]string{"save", "-o", outfile, "--format", "oci-archive", ALPINE})
|
||||
save := podmanTest.Podman([]string{"save", "-q", "-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 := podmanTest.Podman([]string{"load", "-q", "-i", outfile})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(result).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman load oci-archive with signature", func() {
|
||||
outfile := filepath.Join(podmanTest.TempDir, "alpine.tar")
|
||||
|
||||
save := podmanTest.Podman([]string{"save", "-o", outfile, "--format", "oci-archive", ALPINE})
|
||||
save := podmanTest.Podman([]string{"save", "-q", "-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 := podmanTest.Podman([]string{"load", "-q", "--signature-policy", "/etc/containers/policy.json", "-i", outfile})
|
||||
result.WaitWithDefaultTimeout()
|
||||
if IsRemote() {
|
||||
Expect(result).To(ExitWithError())
|
||||
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())
|
||||
}
|
||||
})
|
||||
|
||||
It("podman load with quiet flag", func() {
|
||||
outfile := filepath.Join(podmanTest.TempDir, "alpine.tar")
|
||||
|
||||
save := podmanTest.Podman([]string{"save", "-o", outfile, ALPINE})
|
||||
save := podmanTest.Podman([]string{"save", "-q", "-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() {
|
||||
SkipIfRemote("Remote does not support loading directories")
|
||||
outdir := filepath.Join(podmanTest.TempDir, "alpine")
|
||||
|
||||
save := podmanTest.Podman([]string{"save", "--format", "oci-dir", "-o", outdir, ALPINE})
|
||||
save := podmanTest.Podman([]string{"save", "-q", "--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 := podmanTest.Podman([]string{"load", "-q", "-i", outdir})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(result).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman-remote load directory", func() {
|
||||
@ -157,47 +157,47 @@ var _ = Describe("Podman load", func() {
|
||||
outfile := filepath.Join(podmanTest.TempDir, "alpine.tar")
|
||||
alpVersion := "quay.io/libpod/alpine:3.2"
|
||||
|
||||
pull := podmanTest.Podman([]string{"pull", alpVersion})
|
||||
pull := podmanTest.Podman([]string{"pull", "-q", alpVersion})
|
||||
pull.WaitWithDefaultTimeout()
|
||||
Expect(pull).Should(Exit(0))
|
||||
Expect(pull).Should(ExitCleanly())
|
||||
|
||||
save := podmanTest.Podman([]string{"save", "-o", outfile, ALPINE, alpVersion})
|
||||
save := podmanTest.Podman([]string{"save", "-q", "-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 := podmanTest.Podman([]string{"load", "-q", "-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 = podmanTest.Podman([]string{"save", "-q", "-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 := podmanTest.Podman([]string{"load", "-q", "-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 = podmanTest.Podman([]string{"save", "-q", "-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 := podmanTest.Podman([]string{"load", "-q", "-i", outfile})
|
||||
load.WaitWithDefaultTimeout()
|
||||
Expect(load).Should(Exit(0))
|
||||
Expect(load).Should(ExitCleanly())
|
||||
|
||||
result := podmanTest.Podman([]string{"images", "hello:latest"})
|
||||
result.WaitWithDefaultTimeout()
|
||||
@ -236,38 +236,38 @@ 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 = podmanTest.Podman([]string{"save", "-q", "-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 := podmanTest.Podman([]string{"load", "-q", "-i", outfile})
|
||||
load.WaitWithDefaultTimeout()
|
||||
Expect(load).Should(Exit(0))
|
||||
Expect(load).Should(ExitCleanly())
|
||||
Expect(load.OutputToString()).To(ContainSubstring("Loaded image: sha256:"))
|
||||
})
|
||||
|
||||
It("podman load xz compressed image", func() {
|
||||
outfile := filepath.Join(podmanTest.TempDir, "alp.tar")
|
||||
|
||||
save := podmanTest.Podman([]string{"save", "-o", outfile, ALPINE})
|
||||
save := podmanTest.Podman([]string{"save", "-q", "-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 := podmanTest.Podman([]string{"load", "-q", "-i", outfile + ".xz"})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(result).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman load multi-image archive", func() {
|
||||
@ -276,5 +276,15 @@ var _ = Describe("Podman load", func() {
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(result.OutputToString()).To(ContainSubstring("example.com/empty:latest"))
|
||||
Expect(result.OutputToString()).To(ContainSubstring("example.com/empty/but:different"))
|
||||
|
||||
stderr := result.ErrorToString()
|
||||
if IsRemote() {
|
||||
Expect(stderr).To(BeEmpty(), "no stderr when running remote")
|
||||
} else {
|
||||
Expect(stderr).To(ContainSubstring("Getting image source signatures"))
|
||||
Expect(stderr).To(ContainSubstring("Copying blob"))
|
||||
Expect(stderr).To(ContainSubstring("Writing manifest to image destination"))
|
||||
Expect(stderr).To(ContainSubstring("Copying config sha256:"))
|
||||
}
|
||||
})
|
||||
})
|
||||
|
@ -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)
|
||||
@ -113,15 +112,15 @@ var _ = Describe("Podman login and logout", func() {
|
||||
// base64-encoded "podmantest:test"
|
||||
Expect(auths[server]).To(HaveKeyWithValue("auth", "cG9kbWFudGVzdDp0ZXN0"))
|
||||
|
||||
session = podmanTest.Podman([]string{"push", ALPINE, testImg})
|
||||
session = podmanTest.Podman([]string{"push", "-q", 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 = podmanTest.Podman([]string{"push", "-q", ALPINE, testImg})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).To(ExitWithError())
|
||||
Expect(session.ErrorToString()).To(ContainSubstring(": authentication required"))
|
||||
@ -150,34 +149,34 @@ 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)
|
||||
|
||||
// push should fail with nonexistent authfile
|
||||
session = podmanTest.Podman([]string{"push", "--authfile", "/tmp/nonexistent", ALPINE, testImg})
|
||||
session = podmanTest.Podman([]string{"push", "-q", "--authfile", "/tmp/nonexistent", ALPINE, testImg})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).To(ExitWithError())
|
||||
Expect(session.ErrorToString()).To(Equal("Error: checking authfile: stat /tmp/nonexistent: no such file or directory"))
|
||||
|
||||
session = podmanTest.Podman([]string{"push", "--authfile", authFile, ALPINE, testImg})
|
||||
session = podmanTest.Podman([]string{"push", "-q", "--authfile", authFile, ALPINE, testImg})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"run", "--authfile", authFile, testImg})
|
||||
session = podmanTest.Podman([]string{"run", "-q", "--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,27 +195,27 @@ 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 = podmanTest.Podman([]string{"manifest", "push", "-q", testImg})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).To(ExitWithError())
|
||||
Expect(session.ErrorToString()).To(ContainSubstring(": authentication required"))
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "push", "--authfile", authFile, testImg})
|
||||
session = podmanTest.Podman([]string{"manifest", "push", "-q", "--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 = podmanTest.Podman([]string{"push", "-q", 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 = podmanTest.Podman([]string{"push", "-q", "--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,56 +289,56 @@ 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 = podmanTest.Podman([]string{"push", "-q", ALPINE, testImg})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"push", ALPINE, "localhost:9001/test-alpine"})
|
||||
session = podmanTest.Podman([]string{"push", "-q", ALPINE, "localhost:9001/test-alpine"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).To(ExitWithError())
|
||||
Expect(session.ErrorToString()).To(ContainSubstring("/test-alpine: authentication required"))
|
||||
|
||||
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 = podmanTest.Podman([]string{"push", "-q", ALPINE, testImg})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"push", ALPINE, "localhost:9001/test-alpine"})
|
||||
session = podmanTest.Podman([]string{"push", "-q", 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 = podmanTest.Podman([]string{"push", "-q", ALPINE, testImg})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).To(ExitWithError())
|
||||
Expect(session.ErrorToString()).To(ContainSubstring("/test-alpine: authentication required"))
|
||||
|
||||
session = podmanTest.Podman([]string{"push", ALPINE, "localhost:9001/test-alpine"})
|
||||
session = podmanTest.Podman([]string{"push", "-q", 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 = podmanTest.Podman([]string{"push", "-q", ALPINE, testImg})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).To(ExitWithError())
|
||||
Expect(session.ErrorToString()).To(ContainSubstring("/test-alpine: authentication required"))
|
||||
|
||||
session = podmanTest.Podman([]string{"push", ALPINE, "localhost:9001/test-alpine"})
|
||||
session = podmanTest.Podman([]string{"push", "-q", ALPINE, "localhost:9001/test-alpine"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).To(ExitWithError())
|
||||
Expect(session.ErrorToString()).To(ContainSubstring("/test-alpine: authentication required"))
|
||||
@ -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,18 +385,18 @@ 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))
|
||||
|
||||
session = podmanTest.Podman([]string{
|
||||
"push",
|
||||
"push", "-q",
|
||||
"--authfile", authFile,
|
||||
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)
|
||||
@ -425,12 +424,12 @@ var _ = Describe("Podman login and logout", func() {
|
||||
Expect(authInfo).To(HaveKey(testRepos[1]))
|
||||
|
||||
session := podmanTest.Podman([]string{
|
||||
"push",
|
||||
"push", "-q",
|
||||
"--authfile", authFile,
|
||||
ALPINE, testRepos[0] + "/test-image-alpine",
|
||||
})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{
|
||||
"logout",
|
||||
@ -438,15 +437,15 @@ 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",
|
||||
"push", "-q",
|
||||
"--authfile", authFile,
|
||||
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())
|
||||
}
|
||||
})
|
||||
|
||||
@ -490,7 +489,7 @@ var _ = Describe("Podman login and logout", func() {
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
session := podmanTest.Podman([]string{
|
||||
"push",
|
||||
"push", "-q",
|
||||
"--authfile", authFile,
|
||||
ALPINE, server + "/podmantest/test-image",
|
||||
})
|
||||
@ -499,12 +498,12 @@ var _ = Describe("Podman login and logout", func() {
|
||||
Expect(session.ErrorToString()).To(ContainSubstring("/test-image: authentication required"))
|
||||
|
||||
session = podmanTest.Podman([]string{
|
||||
"push",
|
||||
"push", "-q",
|
||||
"--authfile", authFile,
|
||||
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,15 +518,15 @@ var _ = Describe("Podman login and logout", func() {
|
||||
testTarget,
|
||||
})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{
|
||||
"push",
|
||||
"push", "-q",
|
||||
"--authfile", authFile,
|
||||
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": {
|
||||
@ -538,7 +537,7 @@ var _ = Describe("Podman login and logout", func() {
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
session = podmanTest.Podman([]string{
|
||||
"pull",
|
||||
"pull", "-q",
|
||||
"--authfile", authFile,
|
||||
server + "/podmantest/test-alpine",
|
||||
})
|
||||
|
@ -15,9 +15,9 @@ import (
|
||||
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 := podmanTest.Podman([]string{"pull", "-q", "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,39 +27,41 @@ 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() {
|
||||
session := podmanTest.Podman([]string{"pull", "quay.io/ibetthis/doesntexistthere:foo"})
|
||||
session := podmanTest.Podman([]string{"pull", "quay.io/libpod/ibetthisdoesntexist:there"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).To(ExitWithError())
|
||||
// "Not authorized", not "Not Found", because that's how registries roll??
|
||||
Expect(session.ErrorToString()).To(ContainSubstring("unauthorized: access to the requested resource is not authorized"))
|
||||
})
|
||||
|
||||
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 := podmanTest.Podman([]string{"pull", "-q", "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 +71,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 := podmanTest.Podman([]string{"save", "-q", "-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 := podmanTest.Podman([]string{"load", "-q", "--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.
|
||||
@ -127,12 +129,14 @@ var _ = Describe("Podman pull", func() {
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session.OutputToString()).To(ContainSubstring("helloworld"))
|
||||
Expect(session.ErrorToString()).To(ContainSubstring("The storage 'driver' option should be set in "))
|
||||
Expect(session.ErrorToString()).To(ContainSubstring("A driver was picked automatically."))
|
||||
})
|
||||
|
||||
It("podman pull by digest", func() {
|
||||
session := podmanTest.Podman([]string{"pull", "quay.io/libpod/testdigest_v2s2@sha256:755f4d90b3716e2bf57060d249e2cd61c9ac089b1233465c5c2cb2d7ee550fdb"})
|
||||
session := podmanTest.Podman([]string{"pull", "-q", "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,82 +145,83 @@ 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 := podmanTest.Podman([]string{"pull", "-q", "--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 = podmanTest.Podman([]string{"pull", "-q", "-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")
|
||||
})
|
||||
|
||||
It("podman pull from docker with nonexistent --authfile", func() {
|
||||
session := podmanTest.Podman([]string{"pull", "--authfile", "/tmp/nonexistent", ALPINE})
|
||||
session := podmanTest.Podman([]string{"pull", "-q", "--authfile", "/tmp/nonexistent", ALPINE})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).To(ExitWithError())
|
||||
Expect(session.ErrorToString()).To(Equal("Error: checking authfile: stat /tmp/nonexistent: no such file or directory"))
|
||||
})
|
||||
|
||||
It("podman pull by digest (image list)", func() {
|
||||
session := podmanTest.Podman([]string{"pull", "--arch=arm64", ALPINELISTDIGEST})
|
||||
session := podmanTest.Podman([]string{"pull", "-q", "--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 := podmanTest.Podman([]string{"pull", "-q", "--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 +233,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 := podmanTest.Podman([]string{"pull", "-q", "--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() {
|
||||
@ -312,24 +317,24 @@ var _ = Describe("Podman pull", func() {
|
||||
|
||||
podmanTest.AddImageToRWStore(CIRROS_IMAGE)
|
||||
tarfn := filepath.Join(podmanTest.TempDir, "cirros.tar")
|
||||
session := podmanTest.Podman([]string{"save", "-o", tarfn, "cirros"})
|
||||
session := podmanTest.Podman([]string{"save", "-q", "-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))
|
||||
session = podmanTest.Podman([]string{"pull", fmt.Sprintf("docker-archive:%s", tarfn)})
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"pull", "-q", 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
|
||||
// image.
|
||||
session = podmanTest.Podman([]string{"pull", "docker-archive:./testdata/docker-two-images.tar.xz"})
|
||||
session = podmanTest.Podman([]string{"pull", "-q", "docker-archive:./testdata/docker-two-images.tar.xz"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(125))
|
||||
expectedError := "Unexpected tar manifest.json: expected 1 item, got 2"
|
||||
@ -337,30 +342,30 @@ var _ = Describe("Podman pull", func() {
|
||||
|
||||
// Now pull _one_ image from a multi-image archive via the name
|
||||
// and index syntax.
|
||||
session = podmanTest.Podman([]string{"pull", "docker-archive:./testdata/docker-two-images.tar.xz:@0"})
|
||||
session = podmanTest.Podman([]string{"pull", "-q", "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 = podmanTest.Podman([]string{"pull", "-q", "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 = podmanTest.Podman([]string{"pull", "-q", "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 = podmanTest.Podman([]string{"pull", "-q", "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"})
|
||||
session = podmanTest.Podman([]string{"pull", "-q", "docker-archive:./testdata/docker-two-images.tar.xz:foo.com/does/not/exist:latest"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(125))
|
||||
expectedError = "Tag \"foo.com/does/not/exist:latest\" not found"
|
||||
Expect(session.ErrorToString()).To(ContainSubstring(expectedError))
|
||||
|
||||
session = podmanTest.Podman([]string{"pull", "docker-archive:./testdata/docker-two-images.tar.xz:@2"})
|
||||
session = podmanTest.Podman([]string{"pull", "-q", "docker-archive:./testdata/docker-two-images.tar.xz:@2"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(125))
|
||||
expectedError = "Invalid source index @2, only 2 manifest items available"
|
||||
@ -372,19 +377,19 @@ var _ = Describe("Podman pull", func() {
|
||||
|
||||
podmanTest.AddImageToRWStore(CIRROS_IMAGE)
|
||||
tarfn := filepath.Join(podmanTest.TempDir, "oci-cirrus.tar")
|
||||
session := podmanTest.Podman([]string{"save", "--format", "oci-archive", "-o", tarfn, "cirros"})
|
||||
session := podmanTest.Podman([]string{"save", "-q", "--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))
|
||||
session = podmanTest.Podman([]string{"pull", fmt.Sprintf("oci-archive:%s", tarfn)})
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"pull", "-q", 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() {
|
||||
@ -396,15 +401,17 @@ var _ = Describe("Podman pull", func() {
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
imgPath := fmt.Sprintf("dir:%s", dirpath)
|
||||
|
||||
session := podmanTest.Podman([]string{"push", "cirros", imgPath})
|
||||
session := podmanTest.Podman([]string{"push", "-q", "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.ErrorToString()).To(ContainSubstring("Copying blob"), "Image is pulled on run")
|
||||
|
||||
// Note that reference is not preserved in dir.
|
||||
session = podmanTest.Podman([]string{"image", "exists", "cirros"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
@ -421,18 +428,18 @@ var _ = Describe("Podman pull", func() {
|
||||
imgName := "localhost/name:tag"
|
||||
imgPath := fmt.Sprintf("oci:%s:%s", dirpath, imgName)
|
||||
|
||||
session := podmanTest.Podman([]string{"push", "cirros", imgPath})
|
||||
session := podmanTest.Podman([]string{"push", "-q", "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))
|
||||
session = podmanTest.Podman([]string{"pull", imgPath})
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"pull", "-q", 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 +463,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 +473,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 +487,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 +531,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))
|
||||
@ -535,13 +542,13 @@ var _ = Describe("Podman pull", func() {
|
||||
})
|
||||
|
||||
It("podman pull --platform", func() {
|
||||
session := podmanTest.Podman([]string{"pull", "--platform=linux/bogus", ALPINE})
|
||||
session := podmanTest.Podman([]string{"pull", "-q", "--platform=linux/bogus", ALPINE})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(125))
|
||||
expectedError := "no image found in manifest list for architecture bogus"
|
||||
Expect(session.ErrorToString()).To(ContainSubstring(expectedError))
|
||||
|
||||
session = podmanTest.Podman([]string{"pull", "--platform=linux/arm64", "--os", "windows", ALPINE})
|
||||
session = podmanTest.Podman([]string{"pull", "-q", "--platform=linux/arm64", "--os", "windows", ALPINE})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(125))
|
||||
expectedError = "--platform option can not be specified with --arch or --os"
|
||||
@ -549,11 +556,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))
|
||||
@ -562,13 +569,13 @@ var _ = Describe("Podman pull", func() {
|
||||
})
|
||||
|
||||
It("podman pull --arch", func() {
|
||||
session := podmanTest.Podman([]string{"pull", "--arch=bogus", ALPINE})
|
||||
session := podmanTest.Podman([]string{"pull", "-q", "--arch=bogus", ALPINE})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(125))
|
||||
expectedError := "no image found in manifest list for architecture bogus"
|
||||
Expect(session.ErrorToString()).To(ContainSubstring(expectedError))
|
||||
|
||||
session = podmanTest.Podman([]string{"pull", "--arch=arm64", "--os", "windows", ALPINE})
|
||||
session = podmanTest.Podman([]string{"pull", "-q", "--arch=arm64", "--os", "windows", ALPINE})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(125))
|
||||
expectedError = "no image found in manifest list for architecture"
|
||||
@ -576,11 +583,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))
|
||||
@ -598,8 +605,7 @@ var _ = Describe("Podman pull", func() {
|
||||
|
||||
session = podmanTest.Podman([]string{"pull", "-q", ALPINE})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session.ErrorToString()).To(BeEmpty())
|
||||
Expect(session).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
Describe("podman pull and decrypt", func() {
|
||||
@ -614,12 +620,12 @@ var _ = Describe("Podman pull", func() {
|
||||
_, wrongPrivateKeyFileName, err := WriteRSAKeyPair(wrongKeyFileName, bitSize)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
session := podmanTest.Podman([]string{"push", "--encryption-key", "jwe:" + publicKeyFileName, "--tls-verify=false", "--remove-signatures", ALPINE, imgPath})
|
||||
session := podmanTest.Podman([]string{"push", "-q", "--encryption-key", "jwe:" + publicKeyFileName, "--tls-verify=false", "--remove-signatures", ALPINE, imgPath})
|
||||
session.WaitWithDefaultTimeout()
|
||||
|
||||
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})
|
||||
@ -627,17 +633,17 @@ var _ = Describe("Podman pull", func() {
|
||||
Expect(session).Should(Exit(125))
|
||||
|
||||
// Pulling encrypted image with wrong key should fail
|
||||
session = podmanTest.Podman([]string{"pull", "--decryption-key", wrongPrivateKeyFileName, imgPath})
|
||||
session = podmanTest.Podman([]string{"pull", "-q", "--decryption-key", wrongPrivateKeyFileName, imgPath})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(125))
|
||||
|
||||
// Pulling encrypted image with correct key should pass
|
||||
session = podmanTest.Podman([]string{"pull", "--decryption-key", privateKeyFileName, imgPath})
|
||||
session = podmanTest.Podman([]string{"pull", "-q", "--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 +679,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.")
|
||||
|
@ -22,28 +22,28 @@ var _ = Describe("Podman push", func() {
|
||||
|
||||
It("podman push to containers/storage", func() {
|
||||
SkipIfRemote("Remote push does not support containers-storage transport")
|
||||
session := podmanTest.Podman([]string{"push", ALPINE, "containers-storage:busybox:test"})
|
||||
session := podmanTest.Podman([]string{"push", "-q", 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() {
|
||||
SkipIfRemote("Remote push does not support dir transport")
|
||||
bbdir := filepath.Join(podmanTest.TempDir, "busybox")
|
||||
session := podmanTest.Podman([]string{"push", "--remove-signatures", ALPINE,
|
||||
session := podmanTest.Podman([]string{"push", "-q", "--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,
|
||||
session = podmanTest.Podman([]string{"push", "-q", "--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() {
|
||||
@ -51,16 +51,16 @@ var _ = Describe("Podman push", func() {
|
||||
bbdir := filepath.Join(podmanTest.TempDir, "busybox-oci")
|
||||
|
||||
// Invalid compression format specified, it must fail
|
||||
session := podmanTest.Podman([]string{"push", "--compression-format=gzip", "--compression-level=40", ALPINE, fmt.Sprintf("oci:%s", bbdir)})
|
||||
session := podmanTest.Podman([]string{"push", "-q", "--compression-format=gzip", "--compression-level=40", ALPINE, fmt.Sprintf("oci:%s", bbdir)})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(125))
|
||||
output := session.ErrorToString()
|
||||
Expect(output).To(ContainSubstring("invalid compression level"))
|
||||
|
||||
session = podmanTest.Podman([]string{"push", "--compression-format=zstd", "--remove-signatures", ALPINE,
|
||||
session = podmanTest.Podman([]string{"push", "-q", "--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,39 +104,40 @@ 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 := podmanTest.Podman([]string{"push", "-q", "--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))
|
||||
output := session.OutputToString()
|
||||
skopeoInspect := []string{"inspect", "--tls-verify=false", "--raw", "docker://localhost:5000/image:latest"}
|
||||
skopeo := SystemExec("skopeo", skopeoInspect)
|
||||
skopeo.WaitWithDefaultTimeout()
|
||||
Expect(skopeo).Should(ExitCleanly())
|
||||
output := skopeo.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 = podmanTest.Podman([]string{"push", "-q", "--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))
|
||||
output = session.OutputToString()
|
||||
skopeo = SystemExec("skopeo", skopeoInspect)
|
||||
skopeo.WaitWithDefaultTimeout()
|
||||
Expect(skopeo).Should(ExitCleanly())
|
||||
output = skopeo.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.
|
||||
Expect(output).ToNot(ContainSubstring("zstd"))
|
||||
|
||||
push = podmanTest.Podman([]string{"push", "--tls-verify=false", "--compression-format", "zstd", "--force-compression", "--remove-signatures", "imageone", "localhost:5000/image"})
|
||||
push = podmanTest.Podman([]string{"push", "-q", "--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))
|
||||
output = session.OutputToString()
|
||||
skopeo = SystemExec("skopeo", skopeoInspect)
|
||||
skopeo.WaitWithDefaultTimeout()
|
||||
Expect(skopeo).Should(ExitCleanly())
|
||||
output = skopeo.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 +154,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,8 +162,7 @@ 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.ErrorToString()).To(BeEmpty())
|
||||
Expect(push).Should(ExitCleanly())
|
||||
|
||||
push = podmanTest.Podman([]string{"push", "--compression-format=gzip", "--compression-level=1", "--tls-verify=false", "--remove-signatures", ALPINE, "localhost:5000/my-alpine"})
|
||||
push.WaitWithDefaultTimeout()
|
||||
@ -178,19 +178,19 @@ var _ = Describe("Podman push", func() {
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
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 = podmanTest.Podman([]string{"push", "-q", "--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
|
||||
digestFile := filepath.Join(podmanTest.TempDir, "digestfile.txt")
|
||||
push2 := podmanTest.Podman([]string{"push", "--tls-verify=false", "--digestfile=" + digestFile, "--remove-signatures", ALPINE, "localhost:5000/my-alpine"})
|
||||
push2 := podmanTest.Podman([]string{"push", "-q", "--tls-verify=false", "--digestfile=" + digestFile, "--remove-signatures", ALPINE, "localhost:5000/my-alpine"})
|
||||
push2.WaitWithDefaultTimeout()
|
||||
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,8 +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.ErrorToString()).To(BeEmpty())
|
||||
Expect(push).Should(ExitCleanly())
|
||||
|
||||
pull := podmanTest.Podman([]string{"pull", "-q", "--tls-verify=false", "--signature-policy", policyPath, "localhost:5000/sigstore-signed"})
|
||||
pull.WaitWithDefaultTimeout()
|
||||
@ -225,21 +224,19 @@ 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.ErrorToString()).To(BeEmpty())
|
||||
Expect(push).Should(ExitCleanly())
|
||||
|
||||
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.ErrorToString()).To(BeEmpty())
|
||||
Expect(push).Should(ExitCleanly())
|
||||
|
||||
pull = podmanTest.Podman([]string{"pull", "--tls-verify=false", "--signature-policy", policyPath, "localhost:5000/sigstore-signed-params"})
|
||||
pull = podmanTest.Podman([]string{"pull", "-q", "--tls-verify=false", "--signature-policy", policyPath, "localhost:5000/sigstore-signed-params"})
|
||||
pull.WaitWithDefaultTimeout()
|
||||
Expect(pull).To(ExitWithError())
|
||||
Expect(pull.ErrorToString()).To(ContainSubstring("A signature was required, but no signature exists"))
|
||||
@ -247,12 +244,11 @@ 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.ErrorToString()).To(BeEmpty())
|
||||
Expect(push).Should(ExitCleanly())
|
||||
|
||||
pull = podmanTest.Podman([]string{"pull", "--tls-verify=false", "--signature-policy", policyPath, "localhost:5000/sigstore-signed-params"})
|
||||
pull = podmanTest.Podman([]string{"pull", "-q", "--tls-verify=false", "--signature-policy", policyPath, "localhost:5000/sigstore-signed-params"})
|
||||
pull.WaitWithDefaultTimeout()
|
||||
Expect(pull).Should(Exit(0))
|
||||
Expect(pull).Should(ExitCleanly())
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -263,13 +259,13 @@ 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()
|
||||
|
||||
// FIXME FIXME
|
||||
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.ErrorToString()).To(BeEmpty())
|
||||
Expect(push).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman push to local registry with authorization", func() {
|
||||
@ -291,7 +287,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())
|
||||
@ -303,19 +299,14 @@ var _ = Describe("Podman push", func() {
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
session := podmanTest.Podman([]string{"run", "-d", "-p", "5000:5000", "--name", "registry", "-v",
|
||||
strings.Join([]string{authPath, "/auth"}, ":"), "-e", "REGISTRY_AUTH=htpasswd", "-e",
|
||||
strings.Join([]string{authPath, "/auth", "z"}, ":"), "-e", "REGISTRY_AUTH=htpasswd", "-e",
|
||||
"REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm", "-e", "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd",
|
||||
"-v", strings.Join([]string{certPath, "/certs"}, ":"), "-e", "REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt",
|
||||
"-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.")
|
||||
}
|
||||
|
||||
session = podmanTest.Podman([]string{"logs", "registry"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(WaitContainerReady(podmanTest, "registry", "listening on", 20, 1)).To(BeTrue(), "registry container ready")
|
||||
|
||||
push := podmanTest.Podman([]string{"push", "--tls-verify=true", "--format=v2s2", "--creds=podmantest:test", ALPINE, "localhost:5000/tlstest"})
|
||||
push.WaitWithDefaultTimeout()
|
||||
@ -328,7 +319,7 @@ var _ = Describe("Podman push", func() {
|
||||
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()
|
||||
@ -351,7 +342,7 @@ var _ = Describe("Podman push", func() {
|
||||
// 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()
|
||||
@ -369,22 +360,22 @@ var _ = Describe("Podman push", func() {
|
||||
publicKeyFileName, _, err := WriteRSAKeyPair(keyFileName, bitSize)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
session := podmanTest.Podman([]string{"push", "--encryption-key", "jwe:" + publicKeyFileName, ALPINE, fmt.Sprintf("oci:%s", bbdir)})
|
||||
session := podmanTest.Podman([]string{"push", "-q", "--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() {
|
||||
SkipIfRemote("Remote push does not support docker-archive transport")
|
||||
tarfn := filepath.Join(podmanTest.TempDir, "alp.tar")
|
||||
session := podmanTest.Podman([]string{"push", ALPINE,
|
||||
session := podmanTest.Podman([]string{"push", "-q", 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,7 +385,7 @@ 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))
|
||||
@ -403,44 +394,44 @@ var _ = Describe("Podman push", func() {
|
||||
Skip("Docker is not available")
|
||||
}
|
||||
|
||||
session := podmanTest.Podman([]string{"push", ALPINE, "docker-daemon:alpine:podmantest"})
|
||||
session := podmanTest.Podman([]string{"push", "-q", 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() {
|
||||
SkipIfRemote("Remote push does not support oci-archive transport")
|
||||
tarfn := filepath.Join(podmanTest.TempDir, "alp.tar")
|
||||
session := podmanTest.Podman([]string{"push", ALPINE,
|
||||
session := podmanTest.Podman([]string{"push", "-q", 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() {
|
||||
SkipIfRemote("Remote push does not support docker-archive transport")
|
||||
tarfn := filepath.Join(podmanTest.TempDir, "alp.tar")
|
||||
session := podmanTest.Podman([]string{"push", ALPINE,
|
||||
session := podmanTest.Podman([]string{"push", "-q", 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() {
|
||||
SkipIfRemote("Remote push does not support oci-archive transport")
|
||||
ociarc := filepath.Join(podmanTest.TempDir, "alp-oci")
|
||||
session := podmanTest.Podman([]string{"push", ALPINE,
|
||||
session := podmanTest.Podman([]string{"push", "-q", ALPINE,
|
||||
fmt.Sprintf("oci-archive:%s", ociarc)})
|
||||
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
})
|
||||
|
@ -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() {
|
||||
@ -18,26 +17,26 @@ var _ = Describe("Podman save", func() {
|
||||
It("podman save output flag", func() {
|
||||
outfile := filepath.Join(podmanTest.TempDir, "alpine.tar")
|
||||
|
||||
save := podmanTest.Podman([]string{"save", "-o", outfile, ALPINE})
|
||||
save := podmanTest.Podman([]string{"save", "-q", "-o", outfile, ALPINE})
|
||||
save.WaitWithDefaultTimeout()
|
||||
Expect(save).Should(Exit(0))
|
||||
Expect(save).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman save signature-policy flag", func() {
|
||||
SkipIfRemote("--signature-policy N/A for remote")
|
||||
outfile := filepath.Join(podmanTest.TempDir, "alpine.tar")
|
||||
|
||||
save := podmanTest.Podman([]string{"save", "--signature-policy", "/etc/containers/policy.json", "-o", outfile, ALPINE})
|
||||
save := podmanTest.Podman([]string{"save", "-q", "--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() {
|
||||
outfile := filepath.Join(podmanTest.TempDir, "alpine.tar")
|
||||
|
||||
save := podmanTest.Podman([]string{"save", "-o", outfile, "--format", "oci-archive", ALPINE})
|
||||
save := podmanTest.Podman([]string{"save", "-q", "-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,13 +53,13 @@ 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() {
|
||||
outfile := filepath.Join(podmanTest.TempDir, "alpine.tar")
|
||||
|
||||
save := podmanTest.Podman([]string{"save", "-o", outfile, "FOOBAR"})
|
||||
save := podmanTest.Podman([]string{"save", "-q", "-o", outfile, "FOOBAR"})
|
||||
save.WaitWithDefaultTimeout()
|
||||
Expect(save).To(ExitWithError())
|
||||
})
|
||||
@ -68,9 +67,9 @@ var _ = Describe("Podman save", func() {
|
||||
It("podman save to directory with oci format", func() {
|
||||
outdir := filepath.Join(podmanTest.TempDir, "save")
|
||||
|
||||
save := podmanTest.Podman([]string{"save", "--format", "oci-dir", "-o", outdir, ALPINE})
|
||||
save := podmanTest.Podman([]string{"save", "-q", "--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())
|
||||
@ -81,9 +80,9 @@ var _ = Describe("Podman save", func() {
|
||||
It("podman save to directory with v2s2 docker format", func() {
|
||||
outdir := filepath.Join(podmanTest.TempDir, "save")
|
||||
|
||||
save := podmanTest.Podman([]string{"save", "--format", "docker-dir", "-o", outdir, ALPINE})
|
||||
save := podmanTest.Podman([]string{"save", "-q", "--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())
|
||||
@ -92,20 +91,20 @@ var _ = Describe("Podman save", func() {
|
||||
It("podman save to directory with docker format and compression", func() {
|
||||
outdir := filepath.Join(podmanTest.TempDir, "save")
|
||||
|
||||
save := podmanTest.Podman([]string{"save", "--compress", "--format", "docker-dir", "-o", outdir, ALPINE})
|
||||
save := podmanTest.Podman([]string{"save", "-q", "--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() {
|
||||
outdir := filepath.Join(podmanTest.TempDir, "save")
|
||||
|
||||
save := podmanTest.Podman([]string{"save", "--compress", "--format", "docker-archive", "-o", outdir, ALPINE})
|
||||
save := podmanTest.Podman([]string{"save", "-q", "--compress", "--format", "docker-archive", "-o", outdir, ALPINE})
|
||||
save.WaitWithDefaultTimeout()
|
||||
// should not be 0
|
||||
Expect(save).To(ExitWithError())
|
||||
|
||||
save = podmanTest.Podman([]string{"save", "--compress", "--format", "oci-archive", "-o", outdir, ALPINE})
|
||||
save = podmanTest.Podman([]string{"save", "-q", "--compress", "--format", "oci-archive", "-o", outdir, ALPINE})
|
||||
save.WaitWithDefaultTimeout()
|
||||
// should not be 0
|
||||
Expect(save).To(ExitWithError())
|
||||
@ -115,7 +114,7 @@ var _ = Describe("Podman save", func() {
|
||||
It("podman save bad filename", func() {
|
||||
outdir := filepath.Join(podmanTest.TempDir, "save:colon")
|
||||
|
||||
save := podmanTest.Podman([]string{"save", "--compress", "--format", "docker-dir", "-o", outdir, ALPINE})
|
||||
save := podmanTest.Podman([]string{"save", "-q", "--compress", "--format", "docker-dir", "-o", outdir, ALPINE})
|
||||
save.WaitWithDefaultTimeout()
|
||||
Expect(save).To(ExitWithError())
|
||||
})
|
||||
@ -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,27 +175,27 @@ 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 = podmanTest.Podman([]string{"push", "-q", "--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
|
||||
policyPath := generatePolicyFile(podmanTest.TempDir)
|
||||
defer os.Remove(policyPath)
|
||||
|
||||
session = podmanTest.Podman([]string{"pull", "--tls-verify=false", "--signature-policy", policyPath, "localhost:5000/alpine"})
|
||||
session = podmanTest.Podman([]string{"pull", "-q", "--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"})
|
||||
save := podmanTest.Podman([]string{"save", "-q", "remove-signatures=true", "-o", outfile, "localhost:5000/alpine"})
|
||||
save.WaitWithDefaultTimeout()
|
||||
Expect(save).To(ExitWithError())
|
||||
}
|
||||
@ -204,15 +203,15 @@ default-docker:
|
||||
|
||||
It("podman save image with digest reference", func() {
|
||||
// pull a digest reference
|
||||
session := podmanTest.Podman([]string{"pull", ALPINELISTDIGEST})
|
||||
session := podmanTest.Podman([]string{"pull", "-q", 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 := podmanTest.Podman([]string{"save", "-q", "-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")
|
||||
@ -240,19 +239,19 @@ default-docker:
|
||||
func multiImageSave(podmanTest *PodmanTestIntegration, images []string) {
|
||||
// Create the archive.
|
||||
outfile := filepath.Join(podmanTest.TempDir, "temp.tar")
|
||||
session := podmanTest.Podman(append([]string{"save", "-o", outfile, "--multi-image-archive"}, images...))
|
||||
session := podmanTest.Podman(append([]string{"save", "-q", "-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 = podmanTest.Podman([]string{"load", "-q", "-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())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user