e2e: ExitCleanly(): manual fixes to get tests passing

Commit 2 of 2: steps to make tests work under ExitCleanly()

Mostly adding "-q" to push/pull, but also:

 - revert ExitCleanly(), and add error-message checks
   if absent;

 - fix a test that was completely nonfunctional from
   Day One: test was getting skipped because registry
   couldn't start, because of missing ":z"s in mount option.
   Fixed, and removed the bypass;

 - use built-in skopeo, not pulled-container skopeo. Skopeo
   is already a requirement for system tests.

Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
Ed Santiago
2023-09-21 06:31:26 -06:00
parent 8e743fa1dd
commit 4916f7d771
5 changed files with 157 additions and 150 deletions

View File

@ -23,7 +23,7 @@ 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(ExitCleanly())
@ -31,7 +31,7 @@ var _ = Describe("Podman load", func() {
rmi.WaitWithDefaultTimeout()
Expect(rmi).Should(ExitCleanly())
result := podmanTest.Podman([]string{"load", "-i", outfile})
result := podmanTest.Podman([]string{"load", "-q", "-i", outfile})
result.WaitWithDefaultTimeout()
Expect(result).Should(ExitCleanly())
})
@ -39,7 +39,7 @@ var _ = Describe("Podman load", func() {
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(ExitCleanly())
@ -51,7 +51,7 @@ var _ = Describe("Podman load", func() {
rmi.WaitWithDefaultTimeout()
Expect(rmi).Should(ExitCleanly())
result := podmanTest.Podman([]string{"load", "-i", outfile})
result := podmanTest.Podman([]string{"load", "-q", "-i", outfile})
result.WaitWithDefaultTimeout()
Expect(result).Should(ExitCleanly())
})
@ -59,7 +59,7 @@ var _ = Describe("Podman load", func() {
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(ExitCleanly())
@ -67,7 +67,7 @@ var _ = Describe("Podman load", func() {
rmi.WaitWithDefaultTimeout()
Expect(rmi).Should(ExitCleanly())
result := podmanTest.Podman([]string{"load", "-i", outfile})
result := podmanTest.Podman([]string{"load", "-q", "-i", outfile})
result.WaitWithDefaultTimeout()
Expect(result).Should(ExitCleanly())
})
@ -75,7 +75,7 @@ var _ = Describe("Podman load", func() {
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(ExitCleanly())
@ -83,7 +83,7 @@ var _ = Describe("Podman load", func() {
rmi.WaitWithDefaultTimeout()
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())
@ -99,7 +99,7 @@ var _ = Describe("Podman load", func() {
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(ExitCleanly())
@ -116,7 +116,7 @@ var _ = Describe("Podman load", 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(ExitCleanly())
@ -124,7 +124,7 @@ var _ = Describe("Podman load", func() {
rmi.WaitWithDefaultTimeout()
Expect(rmi).Should(ExitCleanly())
result := podmanTest.Podman([]string{"load", "-i", outdir})
result := podmanTest.Podman([]string{"load", "-q", "-i", outdir})
result.WaitWithDefaultTimeout()
Expect(result).Should(ExitCleanly())
})
@ -157,11 +157,11 @@ 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(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(ExitCleanly())
@ -169,7 +169,7 @@ var _ = Describe("Podman load", func() {
rmi.WaitWithDefaultTimeout()
Expect(rmi).Should(ExitCleanly())
result := podmanTest.Podman([]string{"load", "-i", outfile})
result := podmanTest.Podman([]string{"load", "-q", "-i", outfile})
result.WaitWithDefaultTimeout()
Expect(result).Should(ExitCleanly())
@ -187,7 +187,7 @@ var _ = Describe("Podman load", func() {
setup.WaitWithDefaultTimeout()
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(ExitCleanly())
@ -195,7 +195,7 @@ var _ = Describe("Podman load", func() {
setup.WaitWithDefaultTimeout()
Expect(setup).Should(ExitCleanly())
load := podmanTest.Podman([]string{"load", "-i", outfile})
load := podmanTest.Podman([]string{"load", "-q", "-i", outfile})
load.WaitWithDefaultTimeout()
Expect(load).Should(ExitCleanly())
@ -212,7 +212,7 @@ var _ = Describe("Podman load", func() {
setup.WaitWithDefaultTimeout()
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(ExitCleanly())
@ -220,7 +220,7 @@ var _ = Describe("Podman load", func() {
setup.WaitWithDefaultTimeout()
Expect(setup).Should(ExitCleanly())
load := podmanTest.Podman([]string{"load", "-i", outfile})
load := podmanTest.Podman([]string{"load", "-q", "-i", outfile})
load.WaitWithDefaultTimeout()
Expect(load).Should(ExitCleanly())
@ -238,7 +238,7 @@ var _ = Describe("Podman load", func() {
setup.WaitWithDefaultTimeout()
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(ExitCleanly())
@ -246,7 +246,7 @@ var _ = Describe("Podman load", func() {
setup.WaitWithDefaultTimeout()
Expect(setup).Should(ExitCleanly())
load := podmanTest.Podman([]string{"load", "-i", outfile})
load := podmanTest.Podman([]string{"load", "-q", "-i", outfile})
load.WaitWithDefaultTimeout()
Expect(load).Should(ExitCleanly())
Expect(load.OutputToString()).To(ContainSubstring("Loaded image: sha256:"))
@ -255,7 +255,7 @@ var _ = Describe("Podman load", func() {
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(ExitCleanly())
session := SystemExec("xz", []string{outfile})
@ -265,7 +265,7 @@ var _ = Describe("Podman load", func() {
rmi.WaitWithDefaultTimeout()
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(ExitCleanly())
})
@ -273,8 +273,18 @@ var _ = Describe("Podman load", func() {
It("podman load multi-image archive", func() {
result := podmanTest.Podman([]string{"load", "-i", "./testdata/docker-two-images.tar.xz"})
result.WaitWithDefaultTimeout()
Expect(result).Should(ExitCleanly())
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:"))
}
})
})

View File

@ -112,7 +112,7 @@ 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(ExitCleanly())
@ -120,7 +120,7 @@ var _ = Describe("Podman login and logout", func() {
session.WaitWithDefaultTimeout()
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"))
@ -165,16 +165,16 @@ var _ = Describe("Podman login and logout", func() {
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(ExitCleanly())
session = podmanTest.Podman([]string{"run", "--authfile", authFile, testImg})
session = podmanTest.Podman([]string{"run", "-q", "--authfile", authFile, testImg})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
@ -203,12 +203,12 @@ var _ = Describe("Podman login and logout", func() {
session.WaitWithDefaultTimeout()
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(ExitCleanly())
@ -232,7 +232,7 @@ var _ = Describe("Podman login and logout", func() {
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"push", ALPINE, testImg})
session = podmanTest.Podman([]string{"push", "-q", ALPINE, testImg})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
@ -252,7 +252,7 @@ var _ = Describe("Podman login and logout", func() {
session.WaitWithDefaultTimeout()
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(ExitCleanly())
@ -291,11 +291,11 @@ var _ = Describe("Podman login and logout", func() {
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"push", ALPINE, testImg})
session = podmanTest.Podman([]string{"push", "-q", ALPINE, testImg})
session.WaitWithDefaultTimeout()
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"))
@ -304,11 +304,11 @@ var _ = Describe("Podman login and logout", func() {
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"push", ALPINE, testImg})
session = podmanTest.Podman([]string{"push", "-q", ALPINE, testImg})
session.WaitWithDefaultTimeout()
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(ExitCleanly())
@ -316,12 +316,12 @@ var _ = Describe("Podman login and logout", func() {
session.WaitWithDefaultTimeout()
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(ExitCleanly())
@ -333,12 +333,12 @@ var _ = Describe("Podman login and logout", func() {
session.WaitWithDefaultTimeout()
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"))
@ -391,7 +391,7 @@ var _ = Describe("Podman login and logout", func() {
Expect(authInfo).To(HaveKey(testTarget))
session = podmanTest.Podman([]string{
"push",
"push", "-q",
"--authfile", authFile,
ALPINE, testTarget,
})
@ -424,7 +424,7 @@ 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",
})
@ -440,7 +440,7 @@ var _ = Describe("Podman login and logout", func() {
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{
"push",
"push", "-q",
"--authfile", authFile,
ALPINE, testRepos[0] + "/test-image-alpine",
})
@ -489,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",
})
@ -498,7 +498,7 @@ 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",
})
@ -521,7 +521,7 @@ var _ = Describe("Podman login and logout", func() {
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{
"push",
"push", "-q",
"--authfile", authFile,
ALPINE, testTarget,
})
@ -537,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",
})

View File

@ -15,7 +15,7 @@ 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(ExitCleanly())
@ -31,9 +31,11 @@ var _ = Describe("Podman pull", func() {
})
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() {
@ -53,7 +55,7 @@ var _ = Describe("Podman pull", func() {
})
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(ExitCleanly())
@ -74,7 +76,7 @@ var _ = Describe("Podman pull", func() {
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(ExitCleanly())
@ -83,7 +85,7 @@ var _ = Describe("Podman pull", func() {
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(ExitCleanly())
@ -125,12 +127,14 @@ var _ = Describe("Podman pull", func() {
session = podmanTest.Podman([]string{"run", "--name", "test", "--rm",
imgName, "echo", "helloworld"})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
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(ExitCleanly())
@ -145,7 +149,7 @@ var _ = Describe("Podman pull", func() {
})
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(ExitCleanly())
@ -154,7 +158,7 @@ var _ = Describe("Podman pull", func() {
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(ExitCleanly())
@ -165,13 +169,14 @@ var _ = Describe("Podman pull", func() {
})
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(ExitCleanly())
// inspect using the digest of the list
@ -214,7 +219,7 @@ var _ = Describe("Podman pull", func() {
})
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(ExitCleanly())
// inspect using the digest of the list
@ -254,7 +259,7 @@ var _ = Describe("Podman pull", func() {
})
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(ExitCleanly())
// inspect using the tag we used for pulling
@ -312,14 +317,14 @@ 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(ExitCleanly())
session = podmanTest.Podman([]string{"rmi", "cirros"})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"pull", fmt.Sprintf("docker-archive:%s", tarfn)})
session = podmanTest.Podman([]string{"pull", "-q", fmt.Sprintf("docker-archive:%s", tarfn)})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"rmi", "cirros"})
@ -329,7 +334,7 @@ var _ = Describe("Podman pull", func() {
// 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(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(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(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(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,14 +377,14 @@ 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(ExitCleanly())
session = podmanTest.Podman([]string{"rmi", "cirros"})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"pull", fmt.Sprintf("oci-archive:%s", tarfn)})
session = podmanTest.Podman([]string{"pull", "-q", fmt.Sprintf("oci-archive:%s", tarfn)})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"rmi", "cirros"})
@ -396,7 +401,7 @@ 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(ExitCleanly())
session = podmanTest.Podman([]string{"rmi", "cirros"})
@ -404,7 +409,9 @@ var _ = Describe("Podman pull", func() {
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"run", imgPath, "ls"})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
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,13 +428,13 @@ 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(ExitCleanly())
session = podmanTest.Podman([]string{"rmi", "cirros"})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"pull", imgPath})
session = podmanTest.Podman([]string{"pull", "-q", imgPath})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
session = podmanTest.Podman([]string{"image", "exists", imgName})
@ -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"
@ -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"
@ -591,7 +598,7 @@ var _ = Describe("Podman pull", func() {
It("podman pull progress", func() {
session := podmanTest.Podman([]string{"pull", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
Expect(session).Should(Exit(0))
output := session.ErrorToString()
Expect(output).To(ContainSubstring("Getting image source signatures"))
Expect(output).To(ContainSubstring("Copying blob "))
@ -599,7 +606,6 @@ var _ = Describe("Podman pull", func() {
session = podmanTest.Podman([]string{"pull", "-q", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
Expect(session.ErrorToString()).To(BeEmpty())
})
Describe("podman pull and decrypt", func() {
@ -614,7 +620,7 @@ 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})
@ -627,12 +633,12 @@ 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(ExitCleanly())
session = podmanTest.Podman([]string{"images"})

View File

@ -22,7 +22,7 @@ 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(ExitCleanly())
@ -34,13 +34,13 @@ var _ = Describe("Podman push", func() {
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(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(ExitCleanly())
@ -51,13 +51,13 @@ 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(ExitCleanly())
@ -106,37 +106,38 @@ var _ = Describe("Podman push", func() {
session.WaitWithDefaultTimeout()
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(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(ExitCleanly())
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(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(ExitCleanly())
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(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(ExitCleanly())
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"))
})
@ -162,11 +163,10 @@ 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(ExitCleanly())
Expect(push.ErrorToString()).To(BeEmpty())
push = podmanTest.Podman([]string{"push", "--compression-format=gzip", "--compression-level=1", "--tls-verify=false", "--remove-signatures", ALPINE, "localhost:5000/my-alpine"})
push.WaitWithDefaultTimeout()
Expect(push).Should(ExitCleanly())
Expect(push).Should(Exit(0))
output := push.ErrorToString()
Expect(output).To(ContainSubstring("Copying blob "))
Expect(output).To(ContainSubstring("Copying config "))
@ -178,14 +178,14 @@ 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(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())
@ -215,7 +215,6 @@ var _ = Describe("Podman push", func() {
push := podmanTest.Podman([]string{"push", "-q", "--tls-verify=false", "--remove-signatures", ALPINE, "localhost:5000/sigstore-signed"})
push.WaitWithDefaultTimeout()
Expect(push).Should(ExitCleanly())
Expect(push.ErrorToString()).To(BeEmpty())
pull := podmanTest.Podman([]string{"pull", "-q", "--tls-verify=false", "--signature-policy", policyPath, "localhost:5000/sigstore-signed"})
pull.WaitWithDefaultTimeout()
@ -226,7 +225,6 @@ var _ = Describe("Podman push", func() {
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(ExitCleanly())
Expect(push.ErrorToString()).To(BeEmpty())
pull = podmanTest.Podman([]string{"pull", "-q", "--tls-verify=false", "--signature-policy", policyPath, "localhost:5000/sigstore-signed"})
pull.WaitWithDefaultTimeout()
@ -237,9 +235,8 @@ var _ = Describe("Podman push", func() {
push = podmanTest.Podman([]string{"push", "-q", "--tls-verify=false", "--remove-signatures", ALPINE, "localhost:5000/sigstore-signed-params"})
push.WaitWithDefaultTimeout()
Expect(push).Should(ExitCleanly())
Expect(push.ErrorToString()).To(BeEmpty())
pull = podmanTest.Podman([]string{"pull", "--tls-verify=false", "--signature-policy", policyPath, "localhost:5000/sigstore-signed-params"})
pull = 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"))
@ -248,9 +245,8 @@ var _ = Describe("Podman push", func() {
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(ExitCleanly())
Expect(push.ErrorToString()).To(BeEmpty())
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(ExitCleanly())
}
@ -266,10 +262,10 @@ var _ = Describe("Podman push", func() {
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(ExitCleanly())
Expect(push.ErrorToString()).To(BeEmpty())
})
It("podman push to local registry with authorization", func() {
@ -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(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()
@ -324,7 +315,7 @@ var _ = Describe("Podman push", func() {
push = podmanTest.Podman([]string{"push", "--creds=podmantest:test", "--tls-verify=false", ALPINE, "localhost:5000/tlstest"})
push.WaitWithDefaultTimeout()
Expect(push).Should(ExitCleanly())
Expect(push).Should(Exit(0))
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"})
@ -345,7 +336,7 @@ var _ = Describe("Podman push", func() {
push = podmanTest.Podman([]string{"push", "--creds=podmantest:test", ALPINE, "localhost:5000/defaultflags"})
push.WaitWithDefaultTimeout()
Expect(push).Should(ExitCleanly())
Expect(push).Should(Exit(0))
Expect(push.ErrorToString()).To(ContainSubstring("Writing manifest to image destination"))
// create and push manifest
@ -355,7 +346,7 @@ var _ = Describe("Podman push", func() {
session = podmanTest.Podman([]string{"manifest", "push", "--creds=podmantest:test", "--tls-verify=false", "--all", "localhost:5000/manifesttest"})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
Expect(session).Should(Exit(0))
Expect(session.ErrorToString()).To(ContainSubstring("Writing manifest list to image destination"))
})
@ -369,7 +360,7 @@ 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(ExitCleanly())
@ -381,7 +372,7 @@ var _ = Describe("Podman push", func() {
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(ExitCleanly())
@ -397,13 +388,13 @@ var _ = Describe("Podman push", func() {
Expect(setup).Should(ExitCleanly())
defer func() {
stop := SystemExec("systemctl", []string{"stop", "docker"})
Expect(stop).Should(ExitCleanly())
Expect(stop).Should(Exit(0))
}()
} else if setup.ExitCode() != 0 {
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(ExitCleanly())
@ -418,7 +409,7 @@ var _ = Describe("Podman push", func() {
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(ExitCleanly())
@ -427,7 +418,7 @@ var _ = Describe("Podman push", func() {
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(ExitCleanly())
@ -436,7 +427,7 @@ var _ = Describe("Podman push", func() {
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()

View File

@ -17,7 +17,7 @@ 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(ExitCleanly())
})
@ -26,7 +26,7 @@ var _ = Describe("Podman save", 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(ExitCleanly())
})
@ -34,7 +34,7 @@ var _ = Describe("Podman save", func() {
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(ExitCleanly())
})
@ -59,7 +59,7 @@ var _ = Describe("Podman save", func() {
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())
})
@ -67,7 +67,7 @@ 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(ExitCleanly())
@ -80,7 +80,7 @@ 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(ExitCleanly())
@ -91,7 +91,7 @@ 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(ExitCleanly())
})
@ -99,12 +99,12 @@ var _ = Describe("Podman save", func() {
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())
@ -114,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())
})
@ -177,7 +177,7 @@ default-docker:
session.WaitWithDefaultTimeout()
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(ExitCleanly())
@ -190,12 +190,12 @@ default-docker:
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(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())
}
@ -203,13 +203,13 @@ 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(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(ExitCleanly())
})
@ -239,7 +239,7 @@ 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(ExitCleanly())
@ -249,7 +249,7 @@ func multiImageSave(podmanTest *PodmanTestIntegration, images []string) {
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(ExitCleanly())
// Grep for each image in the `podman load` output.