mirror of https://github.com/containers/podman.git
Merge pull request #19978 from edsantiago/e2e_check_stderr__more
e2e: continuing progress on ExitCleanly()
This commit is contained in:
commit
ae3e49f7ef
|
@ -1,6 +1,7 @@
|
|||
package integration
|
||||
|
||||
import (
|
||||
. "github.com/containers/podman/v4/test/utils"
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
. "github.com/onsi/gomega"
|
||||
. "github.com/onsi/gomega/gexec"
|
||||
|
@ -23,15 +24,15 @@ var _ = Describe("Podman init", func() {
|
|||
It("podman init single container by ID", func() {
|
||||
session := podmanTest.Podman([]string{"create", ALPINE, "ls"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
cid := session.OutputToString()
|
||||
init := podmanTest.Podman([]string{"init", cid})
|
||||
init.WaitWithDefaultTimeout()
|
||||
Expect(init).Should(Exit(0))
|
||||
Expect(init).Should(ExitCleanly())
|
||||
Expect(init.OutputToString()).To(Equal(cid))
|
||||
result := podmanTest.Podman([]string{"inspect", cid})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(result).Should(ExitCleanly())
|
||||
conData := result.InspectContainerToJSON()
|
||||
Expect(conData[0].State).To(HaveField("Status", "initialized"))
|
||||
})
|
||||
|
@ -40,14 +41,14 @@ var _ = Describe("Podman init", func() {
|
|||
name := "test1"
|
||||
session := podmanTest.Podman([]string{"create", "--name", name, ALPINE, "ls"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
init := podmanTest.Podman([]string{"init", name})
|
||||
init.WaitWithDefaultTimeout()
|
||||
Expect(init).Should(Exit(0))
|
||||
Expect(init).Should(ExitCleanly())
|
||||
Expect(init.OutputToString()).To(Equal(name))
|
||||
result := podmanTest.Podman([]string{"inspect", name})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(result).Should(ExitCleanly())
|
||||
conData := result.InspectContainerToJSON()
|
||||
Expect(conData[0].State).To(HaveField("Status", "initialized"))
|
||||
})
|
||||
|
@ -56,15 +57,15 @@ var _ = Describe("Podman init", func() {
|
|||
SkipIfRemote("--latest flag n/a")
|
||||
session := podmanTest.Podman([]string{"create", ALPINE, "ls"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
cid := session.OutputToString()
|
||||
init := podmanTest.Podman([]string{"init", "--latest"})
|
||||
init.WaitWithDefaultTimeout()
|
||||
Expect(init).Should(Exit(0))
|
||||
Expect(init).Should(ExitCleanly())
|
||||
Expect(init.OutputToString()).To(Equal(cid))
|
||||
result := podmanTest.Podman([]string{"inspect", "--latest"})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(result).Should(ExitCleanly())
|
||||
conData := result.InspectContainerToJSON()
|
||||
Expect(conData[0].State).To(HaveField("Status", "initialized"))
|
||||
})
|
||||
|
@ -72,35 +73,35 @@ var _ = Describe("Podman init", func() {
|
|||
It("podman init all three containers, one running", func() {
|
||||
session := podmanTest.Podman([]string{"create", "--name", "test1", ALPINE, "ls"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
cid := session.OutputToString()
|
||||
session2 := podmanTest.Podman([]string{"create", "--name", "test2", ALPINE, "ls"})
|
||||
session2.WaitWithDefaultTimeout()
|
||||
Expect(session2).Should(Exit(0))
|
||||
Expect(session2).Should(ExitCleanly())
|
||||
cid2 := session2.OutputToString()
|
||||
session3 := podmanTest.Podman([]string{"run", "--name", "test3", "-d", ALPINE, "top"})
|
||||
session3.WaitWithDefaultTimeout()
|
||||
Expect(session3).Should(Exit(0))
|
||||
Expect(session3).Should(ExitCleanly())
|
||||
cid3 := session3.OutputToString()
|
||||
init := podmanTest.Podman([]string{"init", "--all"})
|
||||
init.WaitWithDefaultTimeout()
|
||||
Expect(init).Should(Exit(0))
|
||||
Expect(init).Should(ExitCleanly())
|
||||
Expect(init.OutputToString()).To(ContainSubstring(cid))
|
||||
Expect(init.OutputToString()).To(ContainSubstring(cid2))
|
||||
Expect(init.OutputToString()).To(ContainSubstring(cid3))
|
||||
result := podmanTest.Podman([]string{"inspect", "test1"})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(result).Should(ExitCleanly())
|
||||
conData := result.InspectContainerToJSON()
|
||||
Expect(conData[0].State).To(HaveField("Status", "initialized"))
|
||||
result2 := podmanTest.Podman([]string{"inspect", "test2"})
|
||||
result2.WaitWithDefaultTimeout()
|
||||
Expect(result2).Should(Exit(0))
|
||||
Expect(result2).Should(ExitCleanly())
|
||||
conData2 := result2.InspectContainerToJSON()
|
||||
Expect(conData2[0].State).To(HaveField("Status", "initialized"))
|
||||
result3 := podmanTest.Podman([]string{"inspect", "test3"})
|
||||
result3.WaitWithDefaultTimeout()
|
||||
Expect(result3).Should(Exit(0))
|
||||
Expect(result3).Should(ExitCleanly())
|
||||
conData3 := result3.InspectContainerToJSON()
|
||||
Expect(conData3[0].State).To(HaveField("Status", "running"))
|
||||
})
|
||||
|
@ -108,7 +109,7 @@ var _ = Describe("Podman init", func() {
|
|||
It("podman init running container errors", func() {
|
||||
session := podmanTest.Podman([]string{"run", "--name", "init_test", "-d", ALPINE, "top"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
init := podmanTest.Podman([]string{"init", "init_test"})
|
||||
init.WaitWithDefaultTimeout()
|
||||
Expect(init).Should(Exit(125))
|
||||
|
|
|
@ -13,7 +13,7 @@ var _ = Describe("Podman inspect", func() {
|
|||
It("podman inspect alpine image", func() {
|
||||
session := podmanTest.Podman([]string{"inspect", "--format=json", ALPINE})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(session.OutputToString()).To(BeValidJSON())
|
||||
imageData := session.InspectImageJSON()
|
||||
Expect(imageData[0].RepoTags[0]).To(Equal("quay.io/libpod/alpine:latest"))
|
||||
|
@ -28,36 +28,36 @@ var _ = Describe("Podman inspect", func() {
|
|||
It("podman inspect filter should work if result contains tab", func() {
|
||||
session := podmanTest.Podman([]string{"build", "--tag", "envwithtab", "build/envwithtab"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
// Verify that OS and Arch are being set
|
||||
inspect := podmanTest.Podman([]string{"inspect", "-f", "{{ .Config.Env }}", "envwithtab"})
|
||||
inspect.WaitWithDefaultTimeout()
|
||||
Expect(inspect).Should(Exit(0))
|
||||
Expect(inspect).Should(ExitCleanly())
|
||||
// output should not be empty
|
||||
// test validates fix for https://github.com/containers/podman/issues/8785
|
||||
Expect(inspect.OutputToString()).To(ContainSubstring("TEST="), ".Config.Env")
|
||||
|
||||
session = podmanTest.Podman([]string{"rmi", "envwithtab"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman inspect with GO format", func() {
|
||||
session := podmanTest.Podman([]string{"inspect", "--format", "{{.ID}}", ALPINE})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
result := podmanTest.Podman([]string{"images", "-q", "--no-trunc", ALPINE})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(result.OutputToStringArray()).To(ContainElement("sha256:"+session.OutputToString()), "'podman images -q --no-truncate' includes 'podman inspect --format .ID'")
|
||||
})
|
||||
|
||||
It("podman inspect specified type", func() {
|
||||
session := podmanTest.Podman([]string{"inspect", "--type", "image", ALPINE})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman inspect container with GO format for ConmonPidFile", func() {
|
||||
|
@ -67,7 +67,7 @@ var _ = Describe("Podman inspect", func() {
|
|||
|
||||
session = podmanTest.Podman([]string{"inspect", "--format", "{{.ConmonPidFile}}", "test1"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman inspect container with size", func() {
|
||||
|
@ -77,7 +77,7 @@ var _ = Describe("Podman inspect", func() {
|
|||
|
||||
result := podmanTest.Podman([]string{"inspect", "--size", "sizetest"})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(result).Should(ExitCleanly())
|
||||
conData := result.InspectContainerToJSON()
|
||||
Expect(conData[0].SizeRootFs).To(BeNumerically(">", 0))
|
||||
Expect(*conData[0].SizeRw).To(BeNumerically(">=", 0))
|
||||
|
@ -91,7 +91,7 @@ var _ = Describe("Podman inspect", func() {
|
|||
|
||||
result := podmanTest.Podman([]string{"inspect", "--format={{.ID}}", cid, ALPINE})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(result).Should(ExitCleanly())
|
||||
Expect(result.OutputToStringArray()).To(HaveLen(2))
|
||||
})
|
||||
|
||||
|
@ -103,12 +103,12 @@ var _ = Describe("Podman inspect", func() {
|
|||
|
||||
result := podmanTest.Podman([]string{"inspect", "--format={{.ImageID}}", cid})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(result).Should(ExitCleanly())
|
||||
Expect(result.OutputToStringArray()).To(HaveLen(1))
|
||||
|
||||
result = podmanTest.Podman([]string{"inspect", "--format={{.Image}}", cid})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(result).Should(ExitCleanly())
|
||||
Expect(result.OutputToStringArray()).To(HaveLen(1))
|
||||
})
|
||||
|
||||
|
@ -120,7 +120,7 @@ var _ = Describe("Podman inspect", func() {
|
|||
|
||||
result := podmanTest.Podman([]string{"inspect", "--format={{.Config.CreateCommand}}", cid})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(result).Should(ExitCleanly())
|
||||
Expect(result.OutputToStringArray()).To(HaveLen(1))
|
||||
})
|
||||
|
||||
|
@ -135,26 +135,26 @@ var _ = Describe("Podman inspect", func() {
|
|||
|
||||
ctrSession := podmanTest.Podman([]string{"create", "--name", "test", "-v", "/tmp:/test1", ALPINE, "top"})
|
||||
ctrSession.WaitWithDefaultTimeout()
|
||||
Expect(ctrSession).Should(Exit(0))
|
||||
Expect(ctrSession).Should(ExitCleanly())
|
||||
|
||||
inspectSource := podmanTest.Podman([]string{"inspect", "test", "--format", "{{(index .Mounts 0).Source}}"})
|
||||
inspectSource.WaitWithDefaultTimeout()
|
||||
Expect(inspectSource).Should(Exit(0))
|
||||
Expect(inspectSource).Should(ExitCleanly())
|
||||
Expect(inspectSource.OutputToString()).To(Equal("/tmp"))
|
||||
|
||||
inspectSrc := podmanTest.Podman([]string{"inspect", "test", "--format", "{{(index .Mounts 0).Src}}"})
|
||||
inspectSrc.WaitWithDefaultTimeout()
|
||||
Expect(inspectSrc).Should(Exit(0))
|
||||
Expect(inspectSrc).Should(ExitCleanly())
|
||||
Expect(inspectSrc.OutputToString()).To(Equal("/tmp"))
|
||||
|
||||
inspectDestination := podmanTest.Podman([]string{"inspect", "test", "--format", "{{(index .Mounts 0).Destination}}"})
|
||||
inspectDestination.WaitWithDefaultTimeout()
|
||||
Expect(inspectDestination).Should(Exit(0))
|
||||
Expect(inspectDestination).Should(ExitCleanly())
|
||||
Expect(inspectDestination.OutputToString()).To(Equal("/test1"))
|
||||
|
||||
inspectDst := podmanTest.Podman([]string{"inspect", "test", "--format", "{{(index .Mounts 0).Dst}}"})
|
||||
inspectDst.WaitWithDefaultTimeout()
|
||||
Expect(inspectDst).Should(Exit(0))
|
||||
Expect(inspectDst).Should(ExitCleanly())
|
||||
Expect(inspectDst.OutputToString()).To(Equal("/test1"))
|
||||
})
|
||||
|
||||
|
@ -179,7 +179,7 @@ var _ = Describe("Podman inspect", func() {
|
|||
It("podman [image,container] inspect on image", func() {
|
||||
baseInspect := podmanTest.Podman([]string{"inspect", ALPINE})
|
||||
baseInspect.WaitWithDefaultTimeout()
|
||||
Expect(baseInspect).Should(Exit(0))
|
||||
Expect(baseInspect).Should(ExitCleanly())
|
||||
baseJSON := baseInspect.InspectImageJSON()
|
||||
Expect(baseJSON).To(HaveLen(1))
|
||||
|
||||
|
@ -189,7 +189,7 @@ var _ = Describe("Podman inspect", func() {
|
|||
|
||||
imageInspect := podmanTest.Podman([]string{"image", "inspect", ALPINE})
|
||||
imageInspect.WaitWithDefaultTimeout()
|
||||
Expect(imageInspect).Should(Exit(0))
|
||||
Expect(imageInspect).Should(ExitCleanly())
|
||||
imageJSON := imageInspect.InspectImageJSON()
|
||||
Expect(imageJSON).To(HaveLen(1))
|
||||
|
||||
|
@ -200,17 +200,17 @@ var _ = Describe("Podman inspect", func() {
|
|||
ctrName := "testCtr"
|
||||
create := podmanTest.Podman([]string{"create", "--name", ctrName, ALPINE, "sh"})
|
||||
create.WaitWithDefaultTimeout()
|
||||
Expect(create).Should(Exit(0))
|
||||
Expect(create).Should(ExitCleanly())
|
||||
|
||||
baseInspect := podmanTest.Podman([]string{"inspect", ctrName})
|
||||
baseInspect.WaitWithDefaultTimeout()
|
||||
Expect(baseInspect).Should(Exit(0))
|
||||
Expect(baseInspect).Should(ExitCleanly())
|
||||
baseJSON := baseInspect.InspectContainerToJSON()
|
||||
Expect(baseJSON).To(HaveLen(1))
|
||||
|
||||
ctrInspect := podmanTest.Podman([]string{"container", "inspect", ctrName})
|
||||
ctrInspect.WaitWithDefaultTimeout()
|
||||
Expect(ctrInspect).Should(Exit(0))
|
||||
Expect(ctrInspect).Should(ExitCleanly())
|
||||
ctrJSON := ctrInspect.InspectContainerToJSON()
|
||||
Expect(ctrJSON).To(HaveLen(1))
|
||||
|
||||
|
@ -233,7 +233,7 @@ var _ = Describe("Podman inspect", func() {
|
|||
ctrName := "testCtr"
|
||||
create := podmanTest.Podman([]string{"create", "--name", ctrName, ALPINE, "sh"})
|
||||
create.WaitWithDefaultTimeout()
|
||||
Expect(create).Should(Exit(0))
|
||||
Expect(create).Should(ExitCleanly())
|
||||
|
||||
baseInspect := podmanTest.Podman([]string{"inspect", ctrName, "doesNotExist"})
|
||||
baseInspect.WaitWithDefaultTimeout()
|
||||
|
@ -248,15 +248,15 @@ var _ = Describe("Podman inspect", func() {
|
|||
ctrName := "testcontainer"
|
||||
create := podmanTest.Podman([]string{"create", "--name", ctrName, ALPINE, "sh"})
|
||||
create.WaitWithDefaultTimeout()
|
||||
Expect(create).Should(Exit(0))
|
||||
Expect(create).Should(ExitCleanly())
|
||||
|
||||
tag := podmanTest.Podman([]string{"tag", ALPINE, ctrName + ":latest"})
|
||||
tag.WaitWithDefaultTimeout()
|
||||
Expect(tag).Should(Exit(0))
|
||||
Expect(tag).Should(ExitCleanly())
|
||||
|
||||
baseInspect := podmanTest.Podman([]string{"inspect", ctrName})
|
||||
baseInspect.WaitWithDefaultTimeout()
|
||||
Expect(baseInspect).Should(Exit(0))
|
||||
Expect(baseInspect).Should(ExitCleanly())
|
||||
baseJSON := baseInspect.InspectContainerToJSON()
|
||||
Expect(baseJSON).To(HaveLen(1))
|
||||
Expect(baseJSON[0]).To(HaveField("Name", ctrName))
|
||||
|
@ -276,11 +276,11 @@ var _ = Describe("Podman inspect", func() {
|
|||
ALPINE, "sh"})
|
||||
|
||||
create.WaitWithDefaultTimeout()
|
||||
Expect(create).Should(Exit(0))
|
||||
Expect(create).Should(ExitCleanly())
|
||||
|
||||
baseInspect := podmanTest.Podman([]string{"inspect", ctrName})
|
||||
baseInspect.WaitWithDefaultTimeout()
|
||||
Expect(baseInspect).Should(Exit(0))
|
||||
Expect(baseInspect).Should(ExitCleanly())
|
||||
baseJSON := baseInspect.InspectContainerToJSON()
|
||||
Expect(baseJSON).To(HaveLen(1))
|
||||
Expect(baseJSON[0].HostConfig).To(HaveField("SecurityOpt", []string{"label=type:spc_t,label=level:s0", "seccomp=unconfined"}))
|
||||
|
@ -290,11 +290,11 @@ var _ = Describe("Podman inspect", func() {
|
|||
podName := "testpod"
|
||||
create := podmanTest.Podman([]string{"pod", "create", "--name", podName})
|
||||
create.WaitWithDefaultTimeout()
|
||||
Expect(create).Should(Exit(0))
|
||||
Expect(create).Should(ExitCleanly())
|
||||
|
||||
inspect := podmanTest.Podman([]string{"inspect", podName})
|
||||
inspect.WaitWithDefaultTimeout()
|
||||
Expect(inspect).Should(Exit(0))
|
||||
Expect(inspect).Should(ExitCleanly())
|
||||
Expect(inspect.OutputToString()).To(BeValidJSON())
|
||||
podData := inspect.InspectPodArrToJSON()
|
||||
Expect(podData[0]).To(HaveField("Name", podName))
|
||||
|
@ -304,11 +304,11 @@ var _ = Describe("Podman inspect", func() {
|
|||
podName := "testpod"
|
||||
create := podmanTest.Podman([]string{"pod", "create", "--name", podName})
|
||||
create.WaitWithDefaultTimeout()
|
||||
Expect(create).Should(Exit(0))
|
||||
Expect(create).Should(ExitCleanly())
|
||||
|
||||
inspect := podmanTest.Podman([]string{"inspect", "--type", "pod", podName})
|
||||
inspect.WaitWithDefaultTimeout()
|
||||
Expect(inspect).Should(Exit(0))
|
||||
Expect(inspect).Should(ExitCleanly())
|
||||
Expect(inspect.OutputToString()).To(BeValidJSON())
|
||||
podData := inspect.InspectPodArrToJSON()
|
||||
Expect(podData[0]).To(HaveField("Name", podName))
|
||||
|
@ -319,11 +319,11 @@ var _ = Describe("Podman inspect", func() {
|
|||
podName := "testpod"
|
||||
create := podmanTest.Podman([]string{"pod", "create", "--name", podName})
|
||||
create.WaitWithDefaultTimeout()
|
||||
Expect(create).Should(Exit(0))
|
||||
Expect(create).Should(ExitCleanly())
|
||||
|
||||
inspect := podmanTest.Podman([]string{"inspect", "--type", "pod", "--latest"})
|
||||
inspect.WaitWithDefaultTimeout()
|
||||
Expect(inspect).Should(Exit(0))
|
||||
Expect(inspect).Should(ExitCleanly())
|
||||
Expect(inspect.OutputToString()).To(BeValidJSON())
|
||||
podData := inspect.InspectPodArrToJSON()
|
||||
Expect(podData[0]).To(HaveField("Name", podName))
|
||||
|
@ -333,18 +333,18 @@ var _ = Describe("Podman inspect", func() {
|
|||
podName := "testpod"
|
||||
pod := podmanTest.Podman([]string{"pod", "create", "--name", podName})
|
||||
pod.WaitWithDefaultTimeout()
|
||||
Expect(pod).Should(Exit(0))
|
||||
Expect(pod).Should(ExitCleanly())
|
||||
|
||||
inspect1 := podmanTest.Podman([]string{"inspect", "--type", "pod", podName})
|
||||
inspect1.WaitWithDefaultTimeout()
|
||||
Expect(inspect1).Should(Exit(0))
|
||||
Expect(inspect1).Should(ExitCleanly())
|
||||
Expect(inspect1.OutputToString()).To(BeValidJSON())
|
||||
podData := inspect1.InspectPodArrToJSON()
|
||||
infra := podData[0].Containers[0].Name
|
||||
|
||||
inspect := podmanTest.Podman([]string{"inspect", "--latest"})
|
||||
inspect.WaitWithDefaultTimeout()
|
||||
Expect(inspect).Should(Exit(0))
|
||||
Expect(inspect).Should(ExitCleanly())
|
||||
Expect(inspect.OutputToString()).To(BeValidJSON())
|
||||
containerData := inspect.InspectContainerToJSON()
|
||||
Expect(containerData[0]).To(HaveField("Name", infra))
|
||||
|
@ -356,7 +356,7 @@ var _ = Describe("Podman inspect", func() {
|
|||
|
||||
session := podmanTest.Podman([]string{"inspect", name, "--format", "{{.Driver}}"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(session.OutputToString()).To(ContainSubstring("bridge"))
|
||||
})
|
||||
|
||||
|
@ -364,11 +364,11 @@ var _ = Describe("Podman inspect", func() {
|
|||
session := podmanTest.Podman([]string{"volume", "create", "myvol"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
volName := session.OutputToString()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"inspect", volName})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(session.OutputToString()).To(BeValidJSON())
|
||||
})
|
||||
|
||||
|
@ -376,18 +376,18 @@ var _ = Describe("Podman inspect", func() {
|
|||
session := podmanTest.Podman([]string{"volume", "create", "myvol"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
volName := session.OutputToString()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"inspect", "--format", "{{.Name}}", volName})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(session.OutputToString()).To(Equal(volName))
|
||||
})
|
||||
It("podman inspect --type container on a pod should fail", func() {
|
||||
podName := "testpod"
|
||||
create := podmanTest.Podman([]string{"pod", "create", "--name", podName})
|
||||
create.WaitWithDefaultTimeout()
|
||||
Expect(create).Should(Exit(0))
|
||||
Expect(create).Should(ExitCleanly())
|
||||
|
||||
inspect := podmanTest.Podman([]string{"inspect", "--type", "container", podName})
|
||||
inspect.WaitWithDefaultTimeout()
|
||||
|
@ -398,7 +398,7 @@ var _ = Describe("Podman inspect", func() {
|
|||
ctrName := "testctr"
|
||||
create := podmanTest.Podman([]string{"create", "--name", ctrName, ALPINE})
|
||||
create.WaitWithDefaultTimeout()
|
||||
Expect(create).Should(Exit(0))
|
||||
Expect(create).Should(ExitCleanly())
|
||||
|
||||
inspect := podmanTest.Podman([]string{"inspect", "--type", "network", ctrName})
|
||||
inspect.WaitWithDefaultTimeout()
|
||||
|
@ -409,7 +409,7 @@ var _ = Describe("Podman inspect", func() {
|
|||
ctrName := "testctr"
|
||||
create := podmanTest.Podman([]string{"create", "--name", ctrName, ALPINE})
|
||||
create.WaitWithDefaultTimeout()
|
||||
Expect(create).Should(Exit(0))
|
||||
Expect(create).Should(ExitCleanly())
|
||||
|
||||
inspect := podmanTest.Podman([]string{"inspect", "--type", "pod", ctrName})
|
||||
inspect.WaitWithDefaultTimeout()
|
||||
|
@ -420,7 +420,7 @@ var _ = Describe("Podman inspect", func() {
|
|||
ctrName := "testctr"
|
||||
create := podmanTest.Podman([]string{"create", "--name", ctrName, ALPINE})
|
||||
create.WaitWithDefaultTimeout()
|
||||
Expect(create).Should(Exit(0))
|
||||
Expect(create).Should(ExitCleanly())
|
||||
|
||||
inspect := podmanTest.Podman([]string{"inspect", "--type", "volume", ctrName})
|
||||
inspect.WaitWithDefaultTimeout()
|
||||
|
@ -433,11 +433,11 @@ var _ = Describe("Podman inspect", func() {
|
|||
|
||||
create := podmanTest.Podman([]string{"create", "--name", ctnrName, "-p", "8084:80", ALPINE})
|
||||
create.WaitWithDefaultTimeout()
|
||||
Expect(create).Should(Exit(0))
|
||||
Expect(create).Should(ExitCleanly())
|
||||
|
||||
inspect := podmanTest.Podman([]string{"inspect", `--format="{{json .NetworkSettings.Ports}}"`, ctnrName})
|
||||
inspect.WaitWithDefaultTimeout()
|
||||
Expect(inspect).Should(Exit(0))
|
||||
Expect(inspect).Should(ExitCleanly())
|
||||
Expect(inspect.OutputToString()).To(Equal(`"{"80/tcp":[{"HostIp":"","HostPort":"8084"}]}"`))
|
||||
})
|
||||
|
||||
|
@ -446,7 +446,7 @@ var _ = Describe("Podman inspect", func() {
|
|||
ctrName := "testctr"
|
||||
session := podmanTest.Podman([]string{"run", "-d", "--name", ctrName, ALPINE, "top"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
inspect := podmanTest.InspectContainer(ctrName)
|
||||
Expect(inspect).To(HaveLen(1))
|
||||
|
@ -458,7 +458,7 @@ var _ = Describe("Podman inspect", func() {
|
|||
ctrName := "testctr"
|
||||
session := podmanTest.Podman([]string{"create", "--name", ctrName, ALPINE, "top"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
inspect := podmanTest.InspectContainer(ctrName)
|
||||
Expect(inspect).To(HaveLen(1))
|
||||
|
@ -469,11 +469,11 @@ var _ = Describe("Podman inspect", func() {
|
|||
ctrName := "testctr"
|
||||
session := podmanTest.Podman([]string{"run", "-d", "--ulimit", "core=-1:-1", "--name", ctrName, ALPINE, "top"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
inspect := podmanTest.Podman([]string{"inspect", ctrName})
|
||||
inspect.WaitWithDefaultTimeout()
|
||||
Expect(inspect).Should(Exit(0))
|
||||
Expect(inspect).Should(ExitCleanly())
|
||||
|
||||
data := inspect.InspectContainerToJSON()
|
||||
ulimits := data[0].HostConfig.Ulimits
|
||||
|
@ -494,11 +494,11 @@ var _ = Describe("Podman inspect", func() {
|
|||
ctrName := "testctr"
|
||||
session := podmanTest.Podman([]string{"create", "--name", ctrName, ALPINE, "top"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
inspect := podmanTest.Podman([]string{"inspect", ctrName})
|
||||
inspect.WaitWithDefaultTimeout()
|
||||
Expect(inspect).Should(Exit(0))
|
||||
Expect(inspect).Should(ExitCleanly())
|
||||
|
||||
dataCreate := inspect.InspectContainerToJSON()
|
||||
ulimitsCreate := dataCreate[0].HostConfig.Ulimits
|
||||
|
@ -506,11 +506,11 @@ var _ = Describe("Podman inspect", func() {
|
|||
|
||||
start := podmanTest.Podman([]string{"start", ctrName})
|
||||
start.WaitWithDefaultTimeout()
|
||||
Expect(start).Should(Exit(0))
|
||||
Expect(start).Should(ExitCleanly())
|
||||
|
||||
inspect2 := podmanTest.Podman([]string{"inspect", ctrName})
|
||||
inspect2.WaitWithDefaultTimeout()
|
||||
Expect(inspect2).Should(Exit(0))
|
||||
Expect(inspect2).Should(ExitCleanly())
|
||||
|
||||
dataStart := inspect2.InspectContainerToJSON()
|
||||
ulimitsStart := dataStart[0].HostConfig.Ulimits
|
||||
|
@ -521,11 +521,11 @@ var _ = Describe("Podman inspect", func() {
|
|||
ctrName := "testCtr"
|
||||
session := podmanTest.Podman([]string{"run", "-d", "--cap-drop", "SETUID", "--cap-drop", "SETGID", "--cap-drop", "CAP_NET_BIND_SERVICE", "--name", ctrName, ALPINE, "top"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
inspect := podmanTest.Podman([]string{"inspect", ctrName})
|
||||
inspect.WaitWithDefaultTimeout()
|
||||
Expect(inspect).Should(Exit(0))
|
||||
Expect(inspect).Should(ExitCleanly())
|
||||
|
||||
data := inspect.InspectContainerToJSON()
|
||||
Expect(data).To(HaveLen(1))
|
||||
|
@ -539,11 +539,11 @@ var _ = Describe("Podman inspect", func() {
|
|||
ctrName := "testCtr"
|
||||
session := podmanTest.Podman([]string{"run", "-d", "--cap-add", "SYS_ADMIN", "--cap-add", "CAP_NET_ADMIN", "--name", ctrName, ALPINE, "top"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
inspect := podmanTest.Podman([]string{"inspect", ctrName})
|
||||
inspect.WaitWithDefaultTimeout()
|
||||
Expect(inspect).Should(Exit(0))
|
||||
Expect(inspect).Should(ExitCleanly())
|
||||
|
||||
data := inspect.InspectContainerToJSON()
|
||||
Expect(data).To(HaveLen(1))
|
||||
|
@ -560,17 +560,17 @@ var _ = Describe("Podman inspect", func() {
|
|||
|
||||
session = podmanTest.Podman([]string{"inspect", "--format", "{{.PidFile}}", "test1"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman inspect container with bad create args", func() {
|
||||
session := podmanTest.Podman([]string{"container", "create", ALPINE, "efcho", "Hello World"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
cid := session.OutputToString()
|
||||
session = podmanTest.Podman([]string{"container", "inspect", cid, "-f", "{{ .State.Error }}"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(session.OutputToString()).To(BeEmpty())
|
||||
|
||||
session = podmanTest.Podman([]string{"start", cid})
|
||||
|
@ -578,7 +578,7 @@ var _ = Describe("Podman inspect", func() {
|
|||
Expect(session).Should(Exit(125))
|
||||
session = podmanTest.Podman([]string{"container", "inspect", cid, "-f", "'{{ .State.Error }}"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(session.OutputToString()).ToNot(BeEmpty())
|
||||
})
|
||||
|
||||
|
|
|
@ -18,25 +18,25 @@ var _ = Describe("Podman kill", func() {
|
|||
It("podman container kill a running container by id", func() {
|
||||
session := podmanTest.RunTopContainer("")
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
cid := session.OutputToString()
|
||||
|
||||
result := podmanTest.Podman([]string{"container", "kill", cid})
|
||||
result.WaitWithDefaultTimeout()
|
||||
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(result).Should(ExitCleanly())
|
||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||
})
|
||||
|
||||
It("podman container kill a running container by short id", func() {
|
||||
session := podmanTest.RunTopContainer("")
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
cid := session.OutputToString()
|
||||
|
||||
result := podmanTest.Podman([]string{"container", "kill", cid[:5]})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(result).Should(ExitCleanly())
|
||||
Expect(result.OutputToString()).To(Equal(cid[:5]))
|
||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||
})
|
||||
|
@ -44,43 +44,43 @@ var _ = Describe("Podman kill", func() {
|
|||
It("podman kill a running container by id", func() {
|
||||
session := podmanTest.RunTopContainer("")
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
cid := session.OutputToString()
|
||||
|
||||
result := podmanTest.Podman([]string{"kill", cid})
|
||||
result.WaitWithDefaultTimeout()
|
||||
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(result).Should(ExitCleanly())
|
||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||
})
|
||||
|
||||
It("podman kill a running container by id with TERM", func() {
|
||||
session := podmanTest.RunTopContainer("")
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
cid := session.OutputToString()
|
||||
|
||||
result := podmanTest.Podman([]string{"kill", "-s", "9", cid})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(result).Should(ExitCleanly())
|
||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||
})
|
||||
|
||||
It("podman kill a running container by name", func() {
|
||||
session := podmanTest.RunTopContainer("test1")
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
result := podmanTest.Podman([]string{"kill", "-s", "9", "test1"})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(result).Should(ExitCleanly())
|
||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||
})
|
||||
|
||||
It("podman kill a running container by id with a bogus signal", func() {
|
||||
session := podmanTest.RunTopContainer("")
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
cid := session.OutputToString()
|
||||
|
||||
result := podmanTest.Podman([]string{"kill", "-s", "foobar", cid})
|
||||
|
@ -92,7 +92,7 @@ var _ = Describe("Podman kill", func() {
|
|||
It("podman kill latest container", func() {
|
||||
session := podmanTest.RunTopContainer("test1")
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
cid := "-l"
|
||||
if IsRemote() {
|
||||
|
@ -100,7 +100,7 @@ var _ = Describe("Podman kill", func() {
|
|||
}
|
||||
result := podmanTest.Podman([]string{"kill", cid})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(result).Should(ExitCleanly())
|
||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||
})
|
||||
|
||||
|
@ -109,19 +109,19 @@ var _ = Describe("Podman kill", func() {
|
|||
ctrName := "testctr"
|
||||
session := podmanTest.RunTopContainer(ctrName)
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
pause := podmanTest.Podman([]string{"pause", ctrName})
|
||||
pause.WaitWithDefaultTimeout()
|
||||
Expect(pause).Should(Exit(0))
|
||||
Expect(pause).Should(ExitCleanly())
|
||||
|
||||
kill := podmanTest.Podman([]string{"kill", ctrName})
|
||||
kill.WaitWithDefaultTimeout()
|
||||
Expect(kill).Should(Exit(0))
|
||||
Expect(kill).Should(ExitCleanly())
|
||||
|
||||
inspect := podmanTest.Podman([]string{"inspect", "-f", "{{.State.Status}}", ctrName})
|
||||
inspect.WaitWithDefaultTimeout()
|
||||
Expect(inspect).Should(Exit(0))
|
||||
Expect(inspect).Should(ExitCleanly())
|
||||
Expect(inspect.OutputToString()).To(Or(Equal("stopped"), Equal("exited")))
|
||||
})
|
||||
|
||||
|
@ -131,16 +131,16 @@ var _ = Describe("Podman kill", func() {
|
|||
|
||||
session := podmanTest.Podman([]string{"run", "-dt", "--cidfile", tmpFile, ALPINE, "top"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
cid := session.OutputToStringArray()[0]
|
||||
|
||||
kill := podmanTest.Podman([]string{"kill", "--cidfile", tmpFile})
|
||||
kill.WaitWithDefaultTimeout()
|
||||
Expect(kill).Should(Exit(0))
|
||||
Expect(kill).Should(ExitCleanly())
|
||||
|
||||
wait := podmanTest.Podman([]string{"wait", "--condition", "exited", cid})
|
||||
wait.WaitWithDefaultTimeout()
|
||||
Expect(wait).Should(Exit(0))
|
||||
Expect(wait).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman kill multiple --cidfile", func() {
|
||||
|
@ -152,40 +152,40 @@ var _ = Describe("Podman kill", func() {
|
|||
|
||||
session := podmanTest.Podman([]string{"run", "-dt", "--cidfile", tmpFile1, ALPINE, "top"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
cid1 := session.OutputToStringArray()[0]
|
||||
|
||||
session2 := podmanTest.Podman([]string{"run", "-dt", "--cidfile", tmpFile2, ALPINE, "top"})
|
||||
session2.WaitWithDefaultTimeout()
|
||||
Expect(session2).Should(Exit(0))
|
||||
Expect(session2).Should(ExitCleanly())
|
||||
cid2 := session2.OutputToStringArray()[0]
|
||||
|
||||
kill := podmanTest.Podman([]string{"kill", "--cidfile", tmpFile1, "--cidfile", tmpFile2})
|
||||
kill.WaitWithDefaultTimeout()
|
||||
Expect(kill).Should(Exit(0))
|
||||
Expect(kill).Should(ExitCleanly())
|
||||
|
||||
wait := podmanTest.Podman([]string{"wait", "--condition", "exited", cid1})
|
||||
wait.WaitWithDefaultTimeout()
|
||||
Expect(wait).Should(Exit(0))
|
||||
Expect(wait).Should(ExitCleanly())
|
||||
wait = podmanTest.Podman([]string{"wait", "--condition", "exited", cid2})
|
||||
wait.WaitWithDefaultTimeout()
|
||||
Expect(wait).Should(Exit(0))
|
||||
Expect(wait).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman kill --all", func() {
|
||||
session := podmanTest.RunTopContainer("")
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1))
|
||||
|
||||
session = podmanTest.RunTopContainer("")
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(2))
|
||||
|
||||
session = podmanTest.Podman([]string{"kill", "--all"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||
})
|
||||
})
|
||||
|
|
|
@ -54,17 +54,17 @@ var _ = Describe("Podman logs", func() {
|
|||
|
||||
logc := podmanTest.Podman([]string{"run", "--log-driver", log, "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
|
||||
logc.WaitWithDefaultTimeout()
|
||||
Expect(logc).To(Exit(0))
|
||||
Expect(logc).To(ExitCleanly())
|
||||
cid := logc.OutputToString()
|
||||
|
||||
results := podmanTest.Podman([]string{"wait", cid})
|
||||
results.WaitWithDefaultTimeout()
|
||||
Expect(results).To(Exit(0))
|
||||
Expect(results).To(ExitCleanly())
|
||||
|
||||
Eventually(func(g Gomega) {
|
||||
results = podmanTest.Podman([]string{"logs", cid})
|
||||
results.WaitWithDefaultTimeout()
|
||||
g.Expect(results).To(Exit(0))
|
||||
g.Expect(results).To(ExitCleanly())
|
||||
g.Expect(results.OutputToStringArray()).To(HaveLen(3))
|
||||
g.Expect(results.OutputToString()).To(Equal("podman podman podman"))
|
||||
}).WithTimeout(logTimeout).Should(Succeed())
|
||||
|
@ -75,17 +75,17 @@ var _ = Describe("Podman logs", func() {
|
|||
|
||||
logc := podmanTest.Podman([]string{"run", "--log-driver", log, "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
|
||||
logc.WaitWithDefaultTimeout()
|
||||
Expect(logc).To(Exit(0))
|
||||
Expect(logc).To(ExitCleanly())
|
||||
cid := logc.OutputToString()
|
||||
|
||||
wait := podmanTest.Podman([]string{"wait", cid})
|
||||
wait.WaitWithDefaultTimeout()
|
||||
Expect(wait).To(Exit(0))
|
||||
Expect(wait).To(ExitCleanly())
|
||||
|
||||
Eventually(func(g Gomega) {
|
||||
results := podmanTest.Podman([]string{"logs", "--tail", "2", cid})
|
||||
results.WaitWithDefaultTimeout()
|
||||
g.Expect(results).To(Exit(0))
|
||||
g.Expect(results).To(ExitCleanly())
|
||||
g.Expect(results.OutputToStringArray()).To(HaveLen(2))
|
||||
g.Expect(results.OutputToString()).To(Equal("podman podman"))
|
||||
}).WithTimeout(logTimeout).Should(Succeed())
|
||||
|
@ -96,17 +96,17 @@ var _ = Describe("Podman logs", func() {
|
|||
|
||||
logc := podmanTest.Podman([]string{"run", "--log-driver", log, "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
|
||||
logc.WaitWithDefaultTimeout()
|
||||
Expect(logc).To(Exit(0))
|
||||
Expect(logc).To(ExitCleanly())
|
||||
cid := logc.OutputToString()
|
||||
|
||||
wait := podmanTest.Podman([]string{"wait", cid})
|
||||
wait.WaitWithDefaultTimeout()
|
||||
Expect(wait).To(Exit(0))
|
||||
Expect(wait).To(ExitCleanly())
|
||||
|
||||
time.Sleep(logTimeout)
|
||||
results := podmanTest.Podman([]string{"logs", "--tail", "0", cid})
|
||||
results.WaitWithDefaultTimeout()
|
||||
Expect(results).To(Exit(0))
|
||||
Expect(results).To(ExitCleanly())
|
||||
Expect(results.OutputToStringArray()).To(BeEmpty())
|
||||
})
|
||||
|
||||
|
@ -116,16 +116,16 @@ var _ = Describe("Podman logs", func() {
|
|||
name := "test1"
|
||||
logc := podmanTest.Podman([]string{"run", "--name", name, "--log-driver", log, ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
|
||||
logc.WaitWithDefaultTimeout()
|
||||
Expect(logc).To(Exit(0))
|
||||
Expect(logc).To(ExitCleanly())
|
||||
|
||||
wait := podmanTest.Podman([]string{"wait", name})
|
||||
wait.WaitWithDefaultTimeout()
|
||||
Expect(wait).To(Exit(0))
|
||||
Expect(wait).To(ExitCleanly())
|
||||
|
||||
Eventually(func(g Gomega) {
|
||||
results := podmanTest.Podman([]string{"logs", "--tail", "99", name})
|
||||
results.WaitWithDefaultTimeout()
|
||||
g.Expect(results).To(Exit(0))
|
||||
g.Expect(results).To(ExitCleanly())
|
||||
g.Expect(results.OutputToStringArray()).To(HaveLen(3))
|
||||
}).WithTimeout(logTimeout).Should(Succeed())
|
||||
})
|
||||
|
@ -146,18 +146,18 @@ var _ = Describe("Podman logs", func() {
|
|||
// this uses -d so that we do not have 1000 unnecessary lines printed in every test log
|
||||
logc := podmanTest.Podman([]string{"run", "--log-driver", log, "-d", ALPINE, "sh", "-c", "i=1; while [ \"$i\" -ne 1000 ]; do echo \"line $i\"; i=$((i + 1)); done"})
|
||||
logc.WaitWithDefaultTimeout()
|
||||
Expect(logc).To(Exit(0))
|
||||
Expect(logc).To(ExitCleanly())
|
||||
cid := logc.OutputToString()
|
||||
|
||||
// make sure we wait for the container to finish writing its output
|
||||
wait := podmanTest.Podman([]string{"wait", cid})
|
||||
wait.WaitWithDefaultTimeout()
|
||||
Expect(wait).To(Exit(0))
|
||||
Expect(wait).To(ExitCleanly())
|
||||
|
||||
Eventually(func(g Gomega) {
|
||||
results := podmanTest.Podman([]string{"logs", "--tail", "800", cid})
|
||||
results.WaitWithDefaultTimeout()
|
||||
g.Expect(results).To(Exit(0))
|
||||
g.Expect(results).To(ExitCleanly())
|
||||
g.Expect(results.OutputToStringArray()).To(HaveLen(800))
|
||||
}).WithTimeout(logTimeout).Should(Succeed())
|
||||
})
|
||||
|
@ -167,17 +167,17 @@ var _ = Describe("Podman logs", func() {
|
|||
|
||||
logc := podmanTest.Podman([]string{"run", "--log-driver", log, "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
|
||||
logc.WaitWithDefaultTimeout()
|
||||
Expect(logc).To(Exit(0))
|
||||
Expect(logc).To(ExitCleanly())
|
||||
cid := logc.OutputToString()
|
||||
|
||||
wait := podmanTest.Podman([]string{"wait", cid})
|
||||
wait.WaitWithDefaultTimeout()
|
||||
Expect(wait).To(Exit(0))
|
||||
Expect(wait).To(ExitCleanly())
|
||||
|
||||
Eventually(func(g Gomega) {
|
||||
results := podmanTest.Podman([]string{"logs", "--tail", "2", "-t", cid})
|
||||
results.WaitWithDefaultTimeout()
|
||||
g.Expect(results).To(Exit(0))
|
||||
g.Expect(results).To(ExitCleanly())
|
||||
g.Expect(results.OutputToStringArray()).To(HaveLen(2))
|
||||
}).WithTimeout(logTimeout).Should(Succeed())
|
||||
})
|
||||
|
@ -187,17 +187,17 @@ var _ = Describe("Podman logs", func() {
|
|||
|
||||
logc := podmanTest.Podman([]string{"run", "--log-driver", log, "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
|
||||
logc.WaitWithDefaultTimeout()
|
||||
Expect(logc).To(Exit(0))
|
||||
Expect(logc).To(ExitCleanly())
|
||||
cid := logc.OutputToString()
|
||||
|
||||
wait := podmanTest.Podman([]string{"wait", cid})
|
||||
wait.WaitWithDefaultTimeout()
|
||||
Expect(wait).To(Exit(0))
|
||||
Expect(wait).To(ExitCleanly())
|
||||
|
||||
Eventually(func(g Gomega) {
|
||||
results := podmanTest.Podman([]string{"logs", "--since", "2017-08-07T10:10:09.056611202-04:00", cid})
|
||||
results.WaitWithDefaultTimeout()
|
||||
g.Expect(results).To(Exit(0))
|
||||
g.Expect(results).To(ExitCleanly())
|
||||
g.Expect(results.OutputToStringArray()).To(HaveLen(3))
|
||||
}).WithTimeout(logTimeout).Should(Succeed())
|
||||
})
|
||||
|
@ -207,17 +207,17 @@ var _ = Describe("Podman logs", func() {
|
|||
|
||||
logc := podmanTest.Podman([]string{"run", "--log-driver", log, "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
|
||||
logc.WaitWithDefaultTimeout()
|
||||
Expect(logc).To(Exit(0))
|
||||
Expect(logc).To(ExitCleanly())
|
||||
cid := logc.OutputToString()
|
||||
|
||||
wait := podmanTest.Podman([]string{"wait", cid})
|
||||
wait.WaitWithDefaultTimeout()
|
||||
Expect(wait).To(Exit(0))
|
||||
Expect(wait).To(ExitCleanly())
|
||||
|
||||
Eventually(func(g Gomega) {
|
||||
results := podmanTest.Podman([]string{"logs", "--since", "10m", cid})
|
||||
results.WaitWithDefaultTimeout()
|
||||
g.Expect(results).To(Exit(0))
|
||||
g.Expect(results).To(ExitCleanly())
|
||||
g.Expect(results.OutputToStringArray()).To(HaveLen(3))
|
||||
}).WithTimeout(logTimeout).Should(Succeed())
|
||||
})
|
||||
|
@ -227,17 +227,17 @@ var _ = Describe("Podman logs", func() {
|
|||
|
||||
logc := podmanTest.Podman([]string{"run", "--log-driver", log, "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
|
||||
logc.WaitWithDefaultTimeout()
|
||||
Expect(logc).To(Exit(0))
|
||||
Expect(logc).To(ExitCleanly())
|
||||
cid := logc.OutputToString()
|
||||
|
||||
wait := podmanTest.Podman([]string{"wait", cid})
|
||||
wait.WaitWithDefaultTimeout()
|
||||
Expect(wait).To(Exit(0))
|
||||
Expect(wait).To(ExitCleanly())
|
||||
|
||||
Eventually(func(g Gomega) {
|
||||
results := podmanTest.Podman([]string{"logs", "--until", "10m", cid})
|
||||
results.WaitWithDefaultTimeout()
|
||||
g.Expect(results).To(Exit(0))
|
||||
g.Expect(results).To(ExitCleanly())
|
||||
g.Expect(results.OutputToStringArray()).To(HaveLen(3))
|
||||
}).WithTimeout(logTimeout).Should(Succeed())
|
||||
})
|
||||
|
@ -247,12 +247,12 @@ var _ = Describe("Podman logs", func() {
|
|||
|
||||
logc := podmanTest.Podman([]string{"run", "--log-driver", log, "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
|
||||
logc.WaitWithDefaultTimeout()
|
||||
Expect(logc).To(Exit(0))
|
||||
Expect(logc).To(ExitCleanly())
|
||||
cid := logc.OutputToString()
|
||||
|
||||
wait := podmanTest.Podman([]string{"wait", cid})
|
||||
wait.WaitWithDefaultTimeout()
|
||||
Expect(wait).To(Exit(0))
|
||||
Expect(wait).To(ExitCleanly())
|
||||
|
||||
Eventually(func(g Gomega) {
|
||||
now := time.Now()
|
||||
|
@ -260,7 +260,7 @@ var _ = Describe("Podman logs", func() {
|
|||
nowS := now.Format(time.RFC3339)
|
||||
results := podmanTest.Podman([]string{"logs", "--until", nowS, cid})
|
||||
results.WaitWithDefaultTimeout()
|
||||
g.Expect(results).To(Exit(0))
|
||||
g.Expect(results).To(ExitCleanly())
|
||||
g.Expect(results.OutputToStringArray()).To(HaveLen(3))
|
||||
}).WithTimeout(logTimeout).Should(Succeed())
|
||||
})
|
||||
|
@ -279,21 +279,21 @@ var _ = Describe("Podman logs", func() {
|
|||
|
||||
log1 := podmanTest.Podman([]string{"run", "--log-driver", log, "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
|
||||
log1.WaitWithDefaultTimeout()
|
||||
Expect(log1).Should(Exit(0))
|
||||
Expect(log1).Should(ExitCleanly())
|
||||
cid1 := log1.OutputToString()
|
||||
|
||||
log2 := podmanTest.Podman([]string{"run", "--log-driver", log, "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
|
||||
log2.WaitWithDefaultTimeout()
|
||||
Expect(log2).Should(Exit(0))
|
||||
Expect(log2).Should(ExitCleanly())
|
||||
cid2 := log2.OutputToString()
|
||||
|
||||
wait := podmanTest.Podman([]string{"wait", cid1, cid2})
|
||||
wait.WaitWithDefaultTimeout()
|
||||
Expect(wait).To(Exit(0))
|
||||
Expect(wait).To(ExitCleanly())
|
||||
|
||||
results := podmanTest.Podman([]string{"logs", cid1, cid2})
|
||||
results.WaitWithDefaultTimeout()
|
||||
Expect(results).Should(Exit(0))
|
||||
Expect(results).Should(ExitCleanly())
|
||||
|
||||
output := results.OutputToStringArray()
|
||||
Expect(output).To(HaveLen(6))
|
||||
|
@ -305,11 +305,11 @@ var _ = Describe("Podman logs", func() {
|
|||
|
||||
session := podmanTest.Podman([]string{"create", "--log-driver", log, "--name", "log", ALPINE})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).To(Exit(0))
|
||||
Expect(session).To(ExitCleanly())
|
||||
|
||||
results := podmanTest.Podman([]string{"logs", "log"})
|
||||
results.WaitWithDefaultTimeout()
|
||||
Expect(results).To(Exit(0))
|
||||
Expect(results).To(ExitCleanly())
|
||||
})
|
||||
|
||||
It("streaming output: "+log, func() {
|
||||
|
@ -319,7 +319,7 @@ var _ = Describe("Podman logs", func() {
|
|||
|
||||
logc := podmanTest.Podman([]string{"run", "--log-driver", log, "--name", containerName, "-dt", ALPINE, "sh", "-c", "echo podman-1; sleep 1; echo podman-2"})
|
||||
logc.WaitWithDefaultTimeout()
|
||||
Expect(logc).To(Exit(0))
|
||||
Expect(logc).To(ExitCleanly())
|
||||
|
||||
results := podmanTest.Podman([]string{"logs", "-f", containerName})
|
||||
results.WaitWithDefaultTimeout()
|
||||
|
@ -331,7 +331,7 @@ var _ = Describe("Podman logs", func() {
|
|||
return
|
||||
}
|
||||
|
||||
Expect(results).To(Exit(0))
|
||||
Expect(results).To(ExitCleanly())
|
||||
|
||||
Expect(results.OutputToString()).To(ContainSubstring("podman-1"))
|
||||
Expect(results.OutputToString()).To(ContainSubstring("podman-2"))
|
||||
|
@ -350,7 +350,7 @@ var _ = Describe("Podman logs", func() {
|
|||
|
||||
results = podmanTest.Podman([]string{"rm", "--time", "0", "-f", containerName})
|
||||
results.WaitWithDefaultTimeout()
|
||||
Expect(results).To(Exit(0))
|
||||
Expect(results).To(ExitCleanly())
|
||||
})
|
||||
|
||||
It("follow output stopped container: "+log, func() {
|
||||
|
@ -360,7 +360,7 @@ var _ = Describe("Podman logs", func() {
|
|||
|
||||
logc := podmanTest.Podman([]string{"run", "--log-driver", log, "--name", containerName, ALPINE, "true"})
|
||||
logc.WaitWithDefaultTimeout()
|
||||
Expect(logc).To(Exit(0))
|
||||
Expect(logc).To(ExitCleanly())
|
||||
|
||||
results := podmanTest.Podman([]string{"logs", "-f", containerName})
|
||||
results.WaitWithDefaultTimeout()
|
||||
|
@ -370,7 +370,7 @@ var _ = Describe("Podman logs", func() {
|
|||
Expect(results.ErrorToString()).To(ContainSubstring("using --follow with the journald --log-driver but without the journald --events-backend"))
|
||||
return
|
||||
}
|
||||
Expect(results).To(Exit(0))
|
||||
Expect(results).To(ExitCleanly())
|
||||
})
|
||||
|
||||
It("using container with container log-size: "+log, func() {
|
||||
|
@ -378,22 +378,22 @@ var _ = Describe("Podman logs", func() {
|
|||
|
||||
logc := podmanTest.Podman([]string{"run", "--log-driver", log, "--log-opt=max-size=10k", "-d", ALPINE, "echo", "podman podman podman"})
|
||||
logc.WaitWithDefaultTimeout()
|
||||
Expect(logc).To(Exit(0))
|
||||
Expect(logc).To(ExitCleanly())
|
||||
cid := logc.OutputToString()
|
||||
|
||||
wait := podmanTest.Podman([]string{"wait", cid})
|
||||
wait.WaitWithDefaultTimeout()
|
||||
Expect(wait).To(Exit(0))
|
||||
Expect(wait).To(ExitCleanly())
|
||||
|
||||
inspect := podmanTest.Podman([]string{"container", "inspect", "--format", "{{.HostConfig.LogConfig.Size}}", cid})
|
||||
inspect.WaitWithDefaultTimeout()
|
||||
Expect(inspect).To(Exit(0))
|
||||
Expect(inspect).To(ExitCleanly())
|
||||
Expect(inspect.OutputToString()).To(Equal("10kB"))
|
||||
|
||||
Eventually(func(g Gomega) {
|
||||
results := podmanTest.Podman([]string{"logs", cid})
|
||||
results.WaitWithDefaultTimeout()
|
||||
g.Expect(results).To(Exit(0))
|
||||
g.Expect(results).To(ExitCleanly())
|
||||
g.Expect(results.OutputToString()).To(Equal("podman podman podman"))
|
||||
}).WithTimeout(logTimeout).Should(Succeed())
|
||||
})
|
||||
|
@ -403,16 +403,16 @@ var _ = Describe("Podman logs", func() {
|
|||
|
||||
logc := podmanTest.Podman([]string{"run", "--log-driver", log, "--name", "test", ALPINE, "sh", "-c", "echo 1; echo 2"})
|
||||
logc.WaitWithDefaultTimeout()
|
||||
Expect(logc).To(Exit(0))
|
||||
Expect(logc).To(ExitCleanly())
|
||||
|
||||
wait := podmanTest.Podman([]string{"wait", "test"})
|
||||
wait.WaitWithDefaultTimeout()
|
||||
Expect(wait).To(Exit(0))
|
||||
Expect(wait).To(ExitCleanly())
|
||||
|
||||
Eventually(func(g Gomega) {
|
||||
results := podmanTest.Podman([]string{"logs", "test"})
|
||||
results.WaitWithDefaultTimeout()
|
||||
g.Expect(results).To(Exit(0))
|
||||
g.Expect(results).To(ExitCleanly())
|
||||
outlines := results.OutputToStringArray()
|
||||
g.Expect(outlines).To(HaveLen(2))
|
||||
g.Expect(outlines[0]).To(Equal("1"))
|
||||
|
@ -430,7 +430,7 @@ var _ = Describe("Podman logs", func() {
|
|||
|
||||
wait := podmanTest.Podman([]string{"wait", cname})
|
||||
wait.WaitWithDefaultTimeout()
|
||||
Expect(wait).To(Exit(0))
|
||||
Expect(wait).To(ExitCleanly())
|
||||
|
||||
Eventually(func(g Gomega) {
|
||||
results := podmanTest.Podman([]string{"logs", cname})
|
||||
|
@ -449,7 +449,7 @@ var _ = Describe("Podman logs", func() {
|
|||
// use printf to print no extra newline
|
||||
logc := podmanTest.Podman([]string{"run", "--log-driver", log, "--name", cname, ALPINE, "printf", content})
|
||||
logc.WaitWithDefaultTimeout()
|
||||
Expect(logc).To(Exit(0))
|
||||
Expect(logc).To(ExitCleanly())
|
||||
// Important: do not use OutputToString(), this will remove the trailing newline from the output.
|
||||
// However this test must make sure that there is no such extra newline.
|
||||
Expect(string(logc.Out.Contents())).To(Equal(content))
|
||||
|
@ -457,7 +457,7 @@ var _ = Describe("Podman logs", func() {
|
|||
Eventually(func(g Gomega) {
|
||||
logs := podmanTest.Podman([]string{"logs", cname})
|
||||
logs.WaitWithDefaultTimeout()
|
||||
g.Expect(logs).To(Exit(0))
|
||||
g.Expect(logs).To(ExitCleanly())
|
||||
// see comment above
|
||||
g.Expect(string(logs.Out.Contents())).To(Equal(content))
|
||||
}).WithTimeout(logTimeout).Should(Succeed())
|
||||
|
@ -474,29 +474,29 @@ var _ = Describe("Podman logs", func() {
|
|||
|
||||
testPod := podmanTest.Podman([]string{"pod", "create", fmt.Sprintf("--name=%s", podName)})
|
||||
testPod.WaitWithDefaultTimeout()
|
||||
Expect(testPod).To(Exit(0))
|
||||
Expect(testPod).To(ExitCleanly())
|
||||
|
||||
log1 := podmanTest.Podman([]string{"run", "--log-driver", log, "--name", containerName1, "--pod", podName, BB, "echo", "log1"})
|
||||
log1.WaitWithDefaultTimeout()
|
||||
Expect(log1).To(Exit(0))
|
||||
Expect(log1).To(ExitCleanly())
|
||||
|
||||
log2 := podmanTest.Podman([]string{"run", "--log-driver", log, "--name", containerName2, "--pod", podName, BB, "echo", "log2"})
|
||||
log2.WaitWithDefaultTimeout()
|
||||
Expect(log2).To(Exit(0))
|
||||
Expect(log2).To(ExitCleanly())
|
||||
|
||||
ctr := podmanTest.Podman([]string{"run", "--log-driver", log, "--name", containerName3, BB, "date"})
|
||||
ctr.WaitWithDefaultTimeout()
|
||||
Expect(ctr).To(Exit(0))
|
||||
Expect(ctr).To(ExitCleanly())
|
||||
|
||||
Eventually(func(g Gomega) {
|
||||
results := podmanTest.Podman([]string{"pod", "logs", "-l"})
|
||||
results.WaitWithDefaultTimeout()
|
||||
g.Expect(results).To(Exit(0))
|
||||
g.Expect(results).To(ExitCleanly())
|
||||
podOutput := results.OutputToString()
|
||||
|
||||
results = podmanTest.Podman([]string{"logs", "-l"})
|
||||
results.WaitWithDefaultTimeout()
|
||||
g.Expect(results).To(Exit(0))
|
||||
g.Expect(results).To(ExitCleanly())
|
||||
ctrOutput := results.OutputToString()
|
||||
|
||||
g.Expect(podOutput).ToNot(Equal(ctrOutput))
|
||||
|
@ -513,20 +513,20 @@ var _ = Describe("Podman logs", func() {
|
|||
|
||||
testPod := podmanTest.Podman([]string{"pod", "create", fmt.Sprintf("--name=%s", podName)})
|
||||
testPod.WaitWithDefaultTimeout()
|
||||
Expect(testPod).To(Exit(0))
|
||||
Expect(testPod).To(ExitCleanly())
|
||||
|
||||
log1 := podmanTest.Podman([]string{"run", "--log-driver", log, "--name", containerName1, "--pod", podName, BB, "echo", "log1"})
|
||||
log1.WaitWithDefaultTimeout()
|
||||
Expect(log1).To(Exit(0))
|
||||
Expect(log1).To(ExitCleanly())
|
||||
|
||||
log2 := podmanTest.Podman([]string{"run", "--log-driver", log, "--name", containerName2, "--pod", podName, BB, "echo", "log2"})
|
||||
log2.WaitWithDefaultTimeout()
|
||||
Expect(log2).To(Exit(0))
|
||||
Expect(log2).To(ExitCleanly())
|
||||
|
||||
Eventually(func(g Gomega) {
|
||||
results := podmanTest.Podman([]string{"pod", "logs", "-l"})
|
||||
results.WaitWithDefaultTimeout()
|
||||
g.Expect(results).To(Exit(0))
|
||||
g.Expect(results).To(ExitCleanly())
|
||||
output := results.OutputToString()
|
||||
g.Expect(output).To(ContainSubstring("log1"))
|
||||
g.Expect(output).To(ContainSubstring("log2"))
|
||||
|
@ -538,12 +538,12 @@ var _ = Describe("Podman logs", func() {
|
|||
SkipIfJournaldUnavailable()
|
||||
logc := podmanTest.Podman([]string{"run", "--log-driver", "journald", "--log-opt=tag={{.ImageName}}", "-d", ALPINE, "sh", "-c", "echo podman; sleep 0.1; echo podman; sleep 0.1; echo podman"})
|
||||
logc.WaitWithDefaultTimeout()
|
||||
Expect(logc).To(Exit(0))
|
||||
Expect(logc).To(ExitCleanly())
|
||||
cid := logc.OutputToString()
|
||||
|
||||
wait := podmanTest.Podman([]string{"wait", cid})
|
||||
wait.WaitWithDefaultTimeout()
|
||||
Expect(wait).To(Exit(0))
|
||||
Expect(wait).To(ExitCleanly())
|
||||
|
||||
Eventually(func(g Gomega) {
|
||||
cmd := exec.Command("journalctl", "--no-pager", "-o", "json", "--output-fields=CONTAINER_TAG", fmt.Sprintf("CONTAINER_ID_FULL=%s", cid))
|
||||
|
@ -558,12 +558,12 @@ var _ = Describe("Podman logs", func() {
|
|||
containerName := "inside-journal"
|
||||
logc := podmanTest.Podman([]string{"run", "--log-driver", "journald", "-d", "--name", containerName, ALPINE, "sh", "-c", "echo podman; sleep 0.1; echo podman; sleep 0.1; echo podman"})
|
||||
logc.WaitWithDefaultTimeout()
|
||||
Expect(logc).To(Exit(0))
|
||||
Expect(logc).To(ExitCleanly())
|
||||
cid := logc.OutputToString()
|
||||
|
||||
wait := podmanTest.Podman([]string{"wait", cid})
|
||||
wait.WaitWithDefaultTimeout()
|
||||
Expect(wait).To(Exit(0))
|
||||
Expect(wait).To(ExitCleanly())
|
||||
|
||||
Eventually(func(g Gomega) {
|
||||
cmd := exec.Command("journalctl", "--no-pager", "-o", "json", "--output-fields=CONTAINER_NAME", fmt.Sprintf("CONTAINER_ID_FULL=%s", cid))
|
||||
|
@ -577,7 +577,7 @@ var _ = Describe("Podman logs", func() {
|
|||
ctrName := "logsctr"
|
||||
logc := podmanTest.Podman([]string{"run", "--name", ctrName, "-d", "--log-driver", "none", ALPINE, "top"})
|
||||
logc.WaitWithDefaultTimeout()
|
||||
Expect(logc).To(Exit(0))
|
||||
Expect(logc).To(ExitCleanly())
|
||||
|
||||
logs := podmanTest.Podman([]string{"logs", "-f", ctrName})
|
||||
logs.WaitWithDefaultTimeout()
|
||||
|
@ -613,7 +613,7 @@ var _ = Describe("Podman logs", func() {
|
|||
defer cleanup()
|
||||
logc := podmanTest.Podman([]string{"run", "--log-driver", "journald", "--log-opt", "tag=äöüß", ALPINE, "echo", "podman"})
|
||||
logc.WaitWithDefaultTimeout()
|
||||
Expect(logc).To(Exit(0))
|
||||
Expect(logc).To(ExitCleanly())
|
||||
Expect(logc.OutputToString()).To(Equal("podman"))
|
||||
})
|
||||
|
||||
|
@ -625,20 +625,20 @@ var _ = Describe("Podman logs", func() {
|
|||
|
||||
testPod := podmanTest.Podman([]string{"pod", "create", fmt.Sprintf("--name=%s", podName)})
|
||||
testPod.WaitWithDefaultTimeout()
|
||||
Expect(testPod).To(Exit(0))
|
||||
Expect(testPod).To(ExitCleanly())
|
||||
|
||||
log1 := podmanTest.Podman([]string{"run", "--name", containerName1, "--pod", podName, BB, "echo", "log1"})
|
||||
log1.WaitWithDefaultTimeout()
|
||||
Expect(log1).To(Exit(0))
|
||||
Expect(log1).To(ExitCleanly())
|
||||
|
||||
log2 := podmanTest.Podman([]string{"run", "--name", containerName2, "--pod", podName, BB, "echo", "log2"})
|
||||
log2.WaitWithDefaultTimeout()
|
||||
Expect(log2).To(Exit(0))
|
||||
Expect(log2).To(ExitCleanly())
|
||||
|
||||
Eventually(func(g Gomega) {
|
||||
results := podmanTest.Podman([]string{"pod", "logs", "--names", podName})
|
||||
results.WaitWithDefaultTimeout()
|
||||
g.Expect(results).To(Exit(0))
|
||||
g.Expect(results).To(ExitCleanly())
|
||||
|
||||
output := results.OutputToStringArray()
|
||||
g.Expect(output).To(HaveLen(2))
|
||||
|
@ -653,18 +653,18 @@ var _ = Describe("Podman logs", func() {
|
|||
containerName2 := "container2"
|
||||
testPod := podmanTest.Podman([]string{"pod", "create", fmt.Sprintf("--name=%s", podName)})
|
||||
testPod.WaitWithDefaultTimeout()
|
||||
Expect(testPod).To(Exit(0))
|
||||
Expect(testPod).To(ExitCleanly())
|
||||
log1 := podmanTest.Podman([]string{"run", "--name", containerName1, "--pod", podName, BB, "echo", "log1"})
|
||||
log1.WaitWithDefaultTimeout()
|
||||
Expect(log1).To(Exit(0))
|
||||
Expect(log1).To(ExitCleanly())
|
||||
log2 := podmanTest.Podman([]string{"run", "--name", containerName2, "--pod", podName, BB, "echo", "log2"})
|
||||
log2.WaitWithDefaultTimeout()
|
||||
Expect(log2).To(Exit(0))
|
||||
Expect(log2).To(ExitCleanly())
|
||||
|
||||
Eventually(func(g Gomega) {
|
||||
results := podmanTest.Podman([]string{"pod", "logs", "--color", podName})
|
||||
results.WaitWithDefaultTimeout()
|
||||
g.Expect(results).To(Exit(0))
|
||||
g.Expect(results).To(ExitCleanly())
|
||||
output := results.OutputToStringArray()
|
||||
g.Expect(output).To(HaveLen(2))
|
||||
g.Expect(output[0]).To(MatchRegexp(`\x1b\[3[0-9a-z ]+\x1b\[0m`))
|
||||
|
|
|
@ -50,7 +50,7 @@ var _ = Describe("Podman manifest", func() {
|
|||
for _, amend := range []string{"--amend", "-a"} {
|
||||
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "create", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
|
@ -65,52 +65,59 @@ var _ = Describe("Podman manifest", func() {
|
|||
|
||||
session = podmanTest.Podman([]string{"manifest", "create", amend, "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "rm", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
}
|
||||
})
|
||||
|
||||
It("create w/ image", func() {
|
||||
session := podmanTest.Podman([]string{"manifest", "create", "foo", imageList})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("inspect", func() {
|
||||
session := podmanTest.Podman([]string{"manifest", "inspect", BB})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "inspect", "quay.io/libpod/busybox"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
// inspect manifest of single image
|
||||
session = podmanTest.Podman([]string{"manifest", "inspect", "quay.io/libpod/busybox@sha256:6655df04a3df853b029a5fac8836035ac4fab117800c9a6c4b69341bb5306c3d"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
// yet another warning message that is not seen by remote client
|
||||
stderr := session.ErrorToString()
|
||||
if IsRemote() {
|
||||
Expect(stderr).Should(Equal(""))
|
||||
} else {
|
||||
Expect(stderr).Should(ContainSubstring("The manifest type application/vnd.docker.distribution.manifest.v2+json is not a manifest list but a single image."))
|
||||
}
|
||||
})
|
||||
|
||||
It("add w/ inspect", func() {
|
||||
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
id := strings.TrimSpace(string(session.Out.Contents()))
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "inspect", id})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "add", "--arch=arm64", "foo", imageListInstance})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "inspect", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(session.OutputToString()).To(ContainSubstring(imageListARM64InstanceDigest))
|
||||
})
|
||||
|
||||
|
@ -118,39 +125,39 @@ var _ = Describe("Podman manifest", func() {
|
|||
// Following test must pass for both podman and podman-remote
|
||||
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
id := strings.TrimSpace(string(session.Out.Contents()))
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "inspect", id})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "add", "--os-version", "7.7.7", "foo", imageListInstance})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "inspect", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(session.OutputToString()).To(ContainSubstring("7.7.7"))
|
||||
})
|
||||
|
||||
It("tag", func() {
|
||||
session := podmanTest.Podman([]string{"manifest", "create", "foobar"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "add", "foobar", "quay.io/libpod/busybox"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"tag", "foobar", "foobar2"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "inspect", "foobar"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session2 := podmanTest.Podman([]string{"manifest", "inspect", "foobar2"})
|
||||
session2.WaitWithDefaultTimeout()
|
||||
Expect(session2).Should(Exit(0))
|
||||
Expect(session2).Should(ExitCleanly())
|
||||
Expect(session2.OutputToString()).To(Equal(session.OutputToString()))
|
||||
})
|
||||
|
||||
|
@ -166,29 +173,29 @@ var _ = Describe("Podman manifest", 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.")
|
||||
}
|
||||
|
||||
session = podmanTest.Podman([]string{"build", "--platform", "linux/amd64", "-t", "imageone", "build/basicalpine"})
|
||||
session = podmanTest.Podman([]string{"build", "-q", "--platform", "linux/amd64", "-t", "imageone", "build/basicalpine"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"build", "--platform", "linux/arm64", "-t", "imagetwo", "build/basicalpine"})
|
||||
session = podmanTest.Podman([]string{"build", "-q", "--platform", "linux/arm64", "-t", "imagetwo", "build/basicalpine"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "create", "foobar"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "add", "foobar", "containers-storage:localhost/imageone:latest"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "add", "foobar", "containers-storage:localhost/imagetwo:latest"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
push := podmanTest.Podman([]string{"manifest", "push", "--all", "--add-compression", "zstd", "--tls-verify=false", "--remove-signatures", "foobar", "localhost:5000/list"})
|
||||
push.WaitWithDefaultTimeout()
|
||||
|
@ -220,7 +227,7 @@ var _ = Describe("Podman manifest", func() {
|
|||
|
||||
session = podmanTest.Podman([]string{"run", "--rm", "--net", "host", "quay.io/skopeo/stable", "inspect", "--tls-verify=false", "--raw", "docker://localhost:5000/list:latest"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
inspectData = []byte(session.OutputToString())
|
||||
err = json.Unmarshal(inspectData, &index)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
@ -246,7 +253,7 @@ add_compression = ["zstd"]`), 0o644)
|
|||
|
||||
session = podmanTest.Podman([]string{"run", "--rm", "--net", "host", "quay.io/skopeo/stable", "inspect", "--tls-verify=false", "--raw", "docker://localhost:5000/list:latest"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
inspectData = []byte(session.OutputToString())
|
||||
err = json.Unmarshal(inspectData, &index)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
@ -267,7 +274,7 @@ add_compression = ["zstd"]`), 0o644)
|
|||
|
||||
session = podmanTest.Podman([]string{"run", "--rm", "--net", "host", "quay.io/skopeo/stable", "inspect", "--tls-verify=false", "--raw", "docker://localhost:5000/list:latest"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
inspectData = []byte(session.OutputToString())
|
||||
err = json.Unmarshal(inspectData, &index)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
@ -283,13 +290,13 @@ add_compression = ["zstd"]`), 0o644)
|
|||
It("add --all", func() {
|
||||
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "add", "--all", "foo", imageList})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "inspect", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(session.OutputToString()).To(
|
||||
And(
|
||||
ContainSubstring(imageListAMD64InstanceDigest),
|
||||
|
@ -302,17 +309,17 @@ add_compression = ["zstd"]`), 0o644)
|
|||
It("add --annotation", func() {
|
||||
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "add", "--annotation", "hoge", "foo", imageList})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(125))
|
||||
Expect(session.ErrorToString()).To(ContainSubstring("no value given for annotation"))
|
||||
session = podmanTest.Podman([]string{"manifest", "add", "--annotation", "hoge=fuga", "foo", imageList})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "inspect", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
var inspect define.ManifestListData
|
||||
err := json.Unmarshal(session.Out.Contents(), &inspect)
|
||||
|
@ -323,29 +330,29 @@ add_compression = ["zstd"]`), 0o644)
|
|||
It("add --os", func() {
|
||||
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "add", "--os", "bar", "foo", imageList})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "inspect", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(session.OutputToString()).To(ContainSubstring(`"os": "bar"`))
|
||||
})
|
||||
|
||||
It("annotate", func() {
|
||||
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "add", "foo", imageListInstance})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "annotate", "--annotation", "hello=world", "--arch", "bar", "foo", imageListARM64InstanceDigest})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "inspect", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(session.OutputToString()).To(ContainSubstring(`"architecture": "bar"`))
|
||||
// Check added annotation
|
||||
Expect(session.OutputToString()).To(ContainSubstring(`"hello": "world"`))
|
||||
|
@ -354,20 +361,20 @@ add_compression = ["zstd"]`), 0o644)
|
|||
It("remove digest", func() {
|
||||
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "add", "--all", "foo", imageList})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "inspect", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(session.OutputToString()).To(ContainSubstring(imageListARM64InstanceDigest))
|
||||
session = podmanTest.Podman([]string{"manifest", "remove", "foo", imageListARM64InstanceDigest})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "inspect", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(session.OutputToString()).To(
|
||||
And(
|
||||
ContainSubstring(imageListAMD64InstanceDigest),
|
||||
|
@ -381,42 +388,42 @@ add_compression = ["zstd"]`), 0o644)
|
|||
It("remove not-found", func() {
|
||||
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "add", "foo", imageList})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "remove", "foo", "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).To(ExitWithError())
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "rm", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("push --all", func() {
|
||||
SkipIfRemote("manifest push to dir not supported in remote mode")
|
||||
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "add", "--all", "foo", imageList})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
dest := filepath.Join(podmanTest.TempDir, "pushed")
|
||||
err := os.MkdirAll(dest, os.ModePerm)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
defer func() {
|
||||
os.RemoveAll(dest)
|
||||
}()
|
||||
session = podmanTest.Podman([]string{"manifest", "push", "--all", "foo", "dir:" + dest})
|
||||
session = podmanTest.Podman([]string{"manifest", "push", "-q", "--all", "foo", "dir:" + dest})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
files, err := filepath.Glob(dest + string(os.PathSeparator) + "*")
|
||||
Expect(err).ShouldNot(HaveOccurred())
|
||||
check := SystemExec("sha256sum", files)
|
||||
check.WaitWithDefaultTimeout()
|
||||
Expect(check).Should(Exit(0))
|
||||
Expect(check).Should(ExitCleanly())
|
||||
prefix := "sha256:"
|
||||
Expect(check.OutputToString()).To(
|
||||
And(
|
||||
|
@ -431,24 +438,24 @@ add_compression = ["zstd"]`), 0o644)
|
|||
SkipIfRemote("manifest push to dir not supported in remote mode")
|
||||
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "add", "--all", "foo", imageList})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
dest := filepath.Join(podmanTest.TempDir, "pushed")
|
||||
err := os.MkdirAll(dest, os.ModePerm)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
defer func() {
|
||||
os.RemoveAll(dest)
|
||||
}()
|
||||
session = podmanTest.Podman([]string{"push", "foo", "dir:" + dest})
|
||||
session = podmanTest.Podman([]string{"push", "-q", "foo", "dir:" + dest})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
files, err := filepath.Glob(dest + string(os.PathSeparator) + "*")
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
check := SystemExec("sha256sum", files)
|
||||
check.WaitWithDefaultTimeout()
|
||||
Expect(check).Should(Exit(0))
|
||||
Expect(check).Should(ExitCleanly())
|
||||
|
||||
prefix := "sha256:"
|
||||
Expect(check.OutputToString()).To(
|
||||
|
@ -462,22 +469,18 @@ add_compression = ["zstd"]`), 0o644)
|
|||
|
||||
It("push with compression-format and compression-level", func() {
|
||||
SkipIfRemote("manifest push to dir not supported in remote mode")
|
||||
session := podmanTest.Podman([]string{"pull", ALPINE})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
|
||||
dockerfile := `FROM quay.io/libpod/alpine:latest
|
||||
dockerfile := `FROM ` + CITEST_IMAGE + `
|
||||
RUN touch /file
|
||||
`
|
||||
podmanTest.BuildImage(dockerfile, "localhost/test", "false")
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "create", "foo"})
|
||||
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "add", "foo", "containers-storage:localhost/test"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
// Invalid compression format specified, it must fail
|
||||
tmpDir := filepath.Join(podmanTest.TempDir, "wrong-compression")
|
||||
|
@ -493,9 +496,9 @@ RUN touch /file
|
|||
defer func() {
|
||||
os.RemoveAll(dest)
|
||||
}()
|
||||
session = podmanTest.Podman([]string{"push", "--compression-format=zstd", "foo", "oci:" + dest})
|
||||
session = podmanTest.Podman([]string{"push", "-q", "--compression-format=zstd", "foo", "oci:" + dest})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
foundZstdFile := false
|
||||
|
||||
|
@ -524,7 +527,7 @@ RUN touch /file
|
|||
|
||||
session := podmanTest.Podman([]string{"manifest", "create", "foo", imageList})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
dest := filepath.Join(podmanTest.TempDir, "pushed")
|
||||
err := os.MkdirAll(dest, os.ModePerm)
|
||||
|
@ -535,7 +538,7 @@ RUN touch /file
|
|||
|
||||
session = podmanTest.Podman([]string{"push", "foo", "-q", "dir:" + dest})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(session.ErrorToString()).To(BeEmpty())
|
||||
|
||||
session = podmanTest.Podman([]string{"push", "foo", "dir:" + dest})
|
||||
|
@ -567,23 +570,19 @@ RUN touch /file
|
|||
|
||||
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"pull", ALPINE})
|
||||
session = podmanTest.Podman([]string{"tag", CITEST_IMAGE, "localhost:" + registry.Port + "/citest:latest"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"tag", ALPINE, "localhost:" + registry.Port + "/alpine:latest"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
|
||||
push := podmanTest.Podman([]string{"push", "--tls-verify=false", "--creds=" + registry.User + ":" + registry.Password, "--format=v2s2", "localhost:" + registry.Port + "/alpine:latest"})
|
||||
push := podmanTest.Podman([]string{"push", "-q", "--tls-verify=false", "--creds=" + registry.User + ":" + registry.Password, "--format=v2s2", "localhost:" + registry.Port + "/citest:latest"})
|
||||
push.WaitWithDefaultTimeout()
|
||||
Expect(push).Should(Exit(0))
|
||||
Expect(push).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "add", "--tls-verify=false", "--creds=" + registry.User + ":" + registry.Password, "foo", "localhost:" + registry.Port + "/alpine:latest"})
|
||||
session = podmanTest.Podman([]string{"manifest", "add", "--tls-verify=false", "--creds=" + registry.User + ":" + registry.Password, "foo", "localhost:" + registry.Port + "/citest:latest"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
push = podmanTest.Podman([]string{"manifest", "push", "--tls-verify=false", "--creds=" + registry.User + ":" + registry.Password, "foo", "localhost:" + registry.Port + "/credstest"})
|
||||
push.WaitWithDefaultTimeout()
|
||||
|
@ -599,13 +598,13 @@ RUN touch /file
|
|||
Expect(push.ErrorToString()).To(ContainSubstring(": authentication required"))
|
||||
|
||||
// push --rm after pull image (#15033)
|
||||
push = podmanTest.Podman([]string{"manifest", "push", "--rm", "--tls-verify=false", "--creds=" + registry.User + ":" + registry.Password, "foo", "localhost:" + registry.Port + "/rmtest"})
|
||||
push = podmanTest.Podman([]string{"manifest", "push", "-q", "--rm", "--tls-verify=false", "--creds=" + registry.User + ":" + registry.Password, "foo", "localhost:" + registry.Port + "/rmtest"})
|
||||
push.WaitWithDefaultTimeout()
|
||||
Expect(push).Should(Exit(0))
|
||||
Expect(push).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"images", "-q", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||
})
|
||||
|
||||
|
@ -613,52 +612,52 @@ RUN touch /file
|
|||
session := podmanTest.Podman([]string{"manifest", "push", "badsrcvalue", "baddestvalue"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(ExitWithError())
|
||||
Expect(session.ErrorToString()).NotTo(BeEmpty())
|
||||
Expect(session.ErrorToString()).To(ContainSubstring("retrieving local image from image name badsrcvalue: badsrcvalue: image not known"))
|
||||
})
|
||||
|
||||
It("push --rm to local directory", func() {
|
||||
SkipIfRemote("manifest push to dir not supported in remote mode")
|
||||
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "add", "foo", imageList})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
dest := filepath.Join(podmanTest.TempDir, "pushed")
|
||||
err := os.MkdirAll(dest, os.ModePerm)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
defer func() {
|
||||
os.RemoveAll(dest)
|
||||
}()
|
||||
session = podmanTest.Podman([]string{"manifest", "push", "--purge", "foo", "dir:" + dest})
|
||||
session = podmanTest.Podman([]string{"manifest", "push", "-q", "--purge", "foo", "dir:" + dest})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "push", "-p", "foo", "dir:" + dest})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(125))
|
||||
Expect(session.ErrorToString()).To(ContainSubstring("retrieving local image from image name foo: foo: image not known"))
|
||||
session = podmanTest.Podman([]string{"images", "-q", "foo"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||
|
||||
// push --rm after pull image (#15033)
|
||||
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{"manifest", "create", "bar"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "add", "bar", "quay.io/libpod/testdigest_v2s2"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
session = podmanTest.Podman([]string{"manifest", "push", "--rm", "bar", "dir:" + dest})
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"manifest", "push", "-q", "--rm", "bar", "dir:" + dest})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
session = podmanTest.Podman([]string{"images", "-q", "bar"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "rm", "foo", "bar"})
|
||||
|
@ -672,11 +671,11 @@ RUN touch /file
|
|||
manifestList := "manifest-list"
|
||||
session := podmanTest.Podman([]string{"manifest", "create", manifestList})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "exists", manifestList})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "exists", "no-manifest"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
|
@ -687,26 +686,26 @@ RUN touch /file
|
|||
manifestList := "manifestlist"
|
||||
imageName := "quay.io/libpod/busybox"
|
||||
|
||||
session := podmanTest.Podman([]string{"pull", imageName})
|
||||
session := podmanTest.Podman([]string{"pull", "-q", imageName})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "create", manifestList})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "add", manifestList, imageName})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
session = podmanTest.Podman([]string{"manifest", "rm", manifestList})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
// image should still show up
|
||||
session = podmanTest.Podman([]string{"image", "exists", imageName})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("manifest rm should not remove image and should be able to remove tagged manifest list", func() {
|
||||
|
@ -719,17 +718,17 @@ RUN touch /file
|
|||
manifestName := "testmanifest:sometag"
|
||||
session = podmanTest.Podman([]string{"manifest", "create", manifestName})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
// verify if manifest exists
|
||||
session = podmanTest.Podman([]string{"manifest", "exists", manifestName})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
// manifest rm should be able to remove tagged manifest list
|
||||
session = podmanTest.Podman([]string{"manifest", "rm", manifestName})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
// verify that manifest should not exist
|
||||
session = podmanTest.Podman([]string{"manifest", "exists", manifestName})
|
||||
|
|
|
@ -4,7 +4,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 mount", func() {
|
||||
|
@ -17,7 +16,7 @@ var _ = Describe("Podman mount", func() {
|
|||
It("podman mount", func() {
|
||||
setup := podmanTest.Podman([]string{"create", ALPINE, "ls"})
|
||||
setup.WaitWithDefaultTimeout()
|
||||
Expect(setup).Should(Exit(0))
|
||||
Expect(setup).Should(ExitCleanly())
|
||||
cid := setup.OutputToString()
|
||||
|
||||
mount := podmanTest.Podman([]string{"mount", cid})
|
||||
|
@ -29,7 +28,7 @@ var _ = Describe("Podman mount", func() {
|
|||
It("podman unshare podman mount", func() {
|
||||
setup := podmanTest.Podman([]string{"create", ALPINE, "ls"})
|
||||
setup.WaitWithDefaultTimeout()
|
||||
Expect(setup).Should(Exit(0))
|
||||
Expect(setup).Should(ExitCleanly())
|
||||
cid := setup.OutputToString()
|
||||
|
||||
// command: podman <options> unshare podman <options> mount cid
|
||||
|
@ -41,7 +40,7 @@ var _ = Describe("Podman mount", func() {
|
|||
// because "--root podmanTest.TempDir/..."
|
||||
session := podmanTest.Podman(args)
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(session.OutputToString()).To(ContainSubstring(podmanTest.TempDir))
|
||||
})
|
||||
|
||||
|
@ -54,20 +53,17 @@ var _ = Describe("Podman mount", func() {
|
|||
})
|
||||
|
||||
It("podman unshare image podman mount", func() {
|
||||
podmanTest.AddImageToRWStore(ALPINE)
|
||||
setup := podmanTest.Podman([]string{"pull", ALPINE})
|
||||
setup.WaitWithDefaultTimeout()
|
||||
Expect(setup).Should(Exit(0))
|
||||
podmanTest.AddImageToRWStore(CITEST_IMAGE)
|
||||
|
||||
// command: podman <options> unshare podman <options> image mount ALPINE
|
||||
// command: podman <options> unshare podman <options> image mount IMAGE
|
||||
args := []string{"unshare", podmanTest.PodmanBinary}
|
||||
opts := podmanTest.PodmanMakeOptions([]string{"image", "mount", ALPINE}, false, false)
|
||||
opts := podmanTest.PodmanMakeOptions([]string{"image", "mount", CITEST_IMAGE}, false, false)
|
||||
args = append(args, opts...)
|
||||
|
||||
// image location is podmanTest.TempDir/... because "--root podmanTest.TempDir/..."
|
||||
session := podmanTest.Podman(args)
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session).Should(ExitCleanly())
|
||||
Expect(session.OutputToString()).To(ContainSubstring(podmanTest.TempDir))
|
||||
})
|
||||
})
|
||||
|
|
|
@ -4,7 +4,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 mount", func() {
|
||||
|
@ -18,46 +17,46 @@ var _ = Describe("Podman mount", func() {
|
|||
It("podman mount", func() {
|
||||
setup := podmanTest.Podman([]string{"create", ALPINE, "ls"})
|
||||
setup.WaitWithDefaultTimeout()
|
||||
Expect(setup).Should(Exit(0))
|
||||
Expect(setup).Should(ExitCleanly())
|
||||
cid := setup.OutputToString()
|
||||
|
||||
mount := podmanTest.Podman([]string{"mount", cid})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
Expect(mount).Should(ExitCleanly())
|
||||
|
||||
umount := podmanTest.Podman([]string{"umount", cid})
|
||||
umount.WaitWithDefaultTimeout()
|
||||
Expect(umount).Should(Exit(0))
|
||||
Expect(umount).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman container mount", func() {
|
||||
setup := podmanTest.Podman([]string{"container", "create", ALPINE, "ls"})
|
||||
setup.WaitWithDefaultTimeout()
|
||||
Expect(setup).Should(Exit(0))
|
||||
Expect(setup).Should(ExitCleanly())
|
||||
cid := setup.OutputToString()
|
||||
|
||||
mount := podmanTest.Podman([]string{"container", "mount", cid})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
Expect(mount).Should(ExitCleanly())
|
||||
|
||||
umount := podmanTest.Podman([]string{"container", "umount", cid})
|
||||
umount.WaitWithDefaultTimeout()
|
||||
Expect(umount).Should(Exit(0))
|
||||
Expect(umount).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman mount with json format", func() {
|
||||
setup := podmanTest.Podman([]string{"create", ALPINE, "ls"})
|
||||
setup.WaitWithDefaultTimeout()
|
||||
Expect(setup).Should(Exit(0))
|
||||
Expect(setup).Should(ExitCleanly())
|
||||
cid := setup.OutputToString()
|
||||
|
||||
mount := podmanTest.Podman([]string{"mount", cid})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
Expect(mount).Should(ExitCleanly())
|
||||
|
||||
j := podmanTest.Podman([]string{"mount", "--format=json"})
|
||||
j.WaitWithDefaultTimeout()
|
||||
Expect(j).Should(Exit(0))
|
||||
Expect(j).Should(ExitCleanly())
|
||||
Expect(j.OutputToString()).To(BeValidJSON())
|
||||
|
||||
j = podmanTest.Podman([]string{"mount", "--format='{{.foobar}}'"})
|
||||
|
@ -67,126 +66,126 @@ var _ = Describe("Podman mount", func() {
|
|||
|
||||
umount := podmanTest.Podman([]string{"umount", cid})
|
||||
umount.WaitWithDefaultTimeout()
|
||||
Expect(umount).Should(Exit(0))
|
||||
Expect(umount).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman mount many", func() {
|
||||
setup1 := podmanTest.Podman([]string{"create", ALPINE, "ls"})
|
||||
setup1.WaitWithDefaultTimeout()
|
||||
Expect(setup1).Should(Exit(0))
|
||||
Expect(setup1).Should(ExitCleanly())
|
||||
cid1 := setup1.OutputToString()
|
||||
|
||||
setup2 := podmanTest.Podman([]string{"create", ALPINE, "ls"})
|
||||
setup2.WaitWithDefaultTimeout()
|
||||
Expect(setup2).Should(Exit(0))
|
||||
Expect(setup2).Should(ExitCleanly())
|
||||
cid2 := setup2.OutputToString()
|
||||
|
||||
setup3 := podmanTest.Podman([]string{"create", ALPINE, "ls"})
|
||||
setup3.WaitWithDefaultTimeout()
|
||||
Expect(setup3).Should(Exit(0))
|
||||
Expect(setup3).Should(ExitCleanly())
|
||||
cid3 := setup3.OutputToString()
|
||||
|
||||
mount1 := podmanTest.Podman([]string{"mount", cid1, cid2, cid3})
|
||||
mount1.WaitWithDefaultTimeout()
|
||||
Expect(mount1).Should(Exit(0))
|
||||
Expect(mount1).Should(ExitCleanly())
|
||||
|
||||
umount := podmanTest.Podman([]string{"umount", cid1, cid2, cid3})
|
||||
umount.WaitWithDefaultTimeout()
|
||||
Expect(umount).Should(Exit(0))
|
||||
Expect(umount).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman umount many", func() {
|
||||
setup1 := podmanTest.Podman([]string{"create", ALPINE, "ls"})
|
||||
setup1.WaitWithDefaultTimeout()
|
||||
Expect(setup1).Should(Exit(0))
|
||||
Expect(setup1).Should(ExitCleanly())
|
||||
cid1 := setup1.OutputToString()
|
||||
|
||||
setup2 := podmanTest.Podman([]string{"create", ALPINE, "ls"})
|
||||
setup2.WaitWithDefaultTimeout()
|
||||
Expect(setup2).Should(Exit(0))
|
||||
Expect(setup2).Should(ExitCleanly())
|
||||
cid2 := setup2.OutputToString()
|
||||
|
||||
mount1 := podmanTest.Podman([]string{"mount", cid1})
|
||||
mount1.WaitWithDefaultTimeout()
|
||||
Expect(mount1).Should(Exit(0))
|
||||
Expect(mount1).Should(ExitCleanly())
|
||||
|
||||
mount2 := podmanTest.Podman([]string{"mount", cid2})
|
||||
mount2.WaitWithDefaultTimeout()
|
||||
Expect(mount2).Should(Exit(0))
|
||||
Expect(mount2).Should(ExitCleanly())
|
||||
|
||||
umount := podmanTest.Podman([]string{"umount", cid1, cid2})
|
||||
umount.WaitWithDefaultTimeout()
|
||||
Expect(umount).Should(Exit(0))
|
||||
Expect(umount).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman umount all", func() {
|
||||
setup1 := podmanTest.Podman([]string{"create", ALPINE, "ls"})
|
||||
setup1.WaitWithDefaultTimeout()
|
||||
Expect(setup1).Should(Exit(0))
|
||||
Expect(setup1).Should(ExitCleanly())
|
||||
cid1 := setup1.OutputToString()
|
||||
|
||||
setup2 := podmanTest.Podman([]string{"create", ALPINE, "ls"})
|
||||
setup2.WaitWithDefaultTimeout()
|
||||
Expect(setup2).Should(Exit(0))
|
||||
Expect(setup2).Should(ExitCleanly())
|
||||
cid2 := setup2.OutputToString()
|
||||
|
||||
mount1 := podmanTest.Podman([]string{"mount", cid1})
|
||||
mount1.WaitWithDefaultTimeout()
|
||||
Expect(mount1).Should(Exit(0))
|
||||
Expect(mount1).Should(ExitCleanly())
|
||||
|
||||
mount2 := podmanTest.Podman([]string{"mount", cid2})
|
||||
mount2.WaitWithDefaultTimeout()
|
||||
Expect(mount2).Should(Exit(0))
|
||||
Expect(mount2).Should(ExitCleanly())
|
||||
|
||||
umount := podmanTest.Podman([]string{"umount", "--all"})
|
||||
umount.WaitWithDefaultTimeout()
|
||||
Expect(umount).Should(Exit(0))
|
||||
Expect(umount).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman list mounted container", func() {
|
||||
setup := podmanTest.Podman([]string{"create", ALPINE, "ls"})
|
||||
setup.WaitWithDefaultTimeout()
|
||||
Expect(setup).Should(Exit(0))
|
||||
Expect(setup).Should(ExitCleanly())
|
||||
cid := setup.OutputToString()
|
||||
|
||||
lmount := podmanTest.Podman([]string{"mount", "--no-trunc"})
|
||||
lmount.WaitWithDefaultTimeout()
|
||||
Expect(lmount).Should(Exit(0))
|
||||
Expect(lmount).Should(ExitCleanly())
|
||||
Expect(lmount.OutputToString()).To(Equal(""))
|
||||
|
||||
mount := podmanTest.Podman([]string{"mount", cid})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
Expect(mount).Should(ExitCleanly())
|
||||
|
||||
lmount = podmanTest.Podman([]string{"mount", "--no-trunc"})
|
||||
lmount.WaitWithDefaultTimeout()
|
||||
Expect(lmount).Should(Exit(0))
|
||||
Expect(lmount).Should(ExitCleanly())
|
||||
Expect(lmount.OutputToString()).To(ContainSubstring(cid))
|
||||
|
||||
umount := podmanTest.Podman([]string{"umount", cid})
|
||||
umount.WaitWithDefaultTimeout()
|
||||
Expect(umount).Should(Exit(0))
|
||||
Expect(umount).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman list running container", func() {
|
||||
|
||||
setup := podmanTest.Podman([]string{"run", "-dt", ALPINE, "top"})
|
||||
setup.WaitWithDefaultTimeout()
|
||||
Expect(setup).Should(Exit(0))
|
||||
Expect(setup).Should(ExitCleanly())
|
||||
cid := setup.OutputToString()
|
||||
|
||||
lmount := podmanTest.Podman([]string{"mount", "--no-trunc"})
|
||||
lmount.WaitWithDefaultTimeout()
|
||||
Expect(lmount).Should(Exit(0))
|
||||
Expect(lmount).Should(ExitCleanly())
|
||||
Expect(lmount.OutputToString()).To(ContainSubstring(cid))
|
||||
|
||||
stop := podmanTest.Podman([]string{"stop", cid})
|
||||
stop.WaitWithDefaultTimeout()
|
||||
Expect(stop).Should(Exit(0))
|
||||
Expect(stop).Should(ExitCleanly())
|
||||
|
||||
lmount = podmanTest.Podman([]string{"mount", "--no-trunc"})
|
||||
lmount.WaitWithDefaultTimeout()
|
||||
Expect(lmount).Should(Exit(0))
|
||||
Expect(lmount).Should(ExitCleanly())
|
||||
Expect(lmount.OutputToString()).To(Equal(""))
|
||||
})
|
||||
|
||||
|
@ -194,42 +193,42 @@ var _ = Describe("Podman mount", func() {
|
|||
|
||||
setup := podmanTest.Podman([]string{"create", ALPINE, "ls"})
|
||||
setup.WaitWithDefaultTimeout()
|
||||
Expect(setup).Should(Exit(0))
|
||||
Expect(setup).Should(ExitCleanly())
|
||||
cid1 := setup.OutputToString()
|
||||
|
||||
setup = podmanTest.Podman([]string{"create", ALPINE, "ls"})
|
||||
setup.WaitWithDefaultTimeout()
|
||||
Expect(setup).Should(Exit(0))
|
||||
Expect(setup).Should(ExitCleanly())
|
||||
cid2 := setup.OutputToString()
|
||||
|
||||
setup = podmanTest.Podman([]string{"create", ALPINE, "ls"})
|
||||
setup.WaitWithDefaultTimeout()
|
||||
Expect(setup).Should(Exit(0))
|
||||
Expect(setup).Should(ExitCleanly())
|
||||
cid3 := setup.OutputToString()
|
||||
|
||||
lmount := podmanTest.Podman([]string{"mount", "--no-trunc"})
|
||||
lmount.WaitWithDefaultTimeout()
|
||||
Expect(lmount).Should(Exit(0))
|
||||
Expect(lmount).Should(ExitCleanly())
|
||||
Expect(lmount.OutputToString()).To(Equal(""))
|
||||
|
||||
mount := podmanTest.Podman([]string{"mount", cid1, cid3})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
Expect(mount).Should(ExitCleanly())
|
||||
|
||||
lmount = podmanTest.Podman([]string{"mount", "--no-trunc"})
|
||||
lmount.WaitWithDefaultTimeout()
|
||||
Expect(lmount).Should(Exit(0))
|
||||
Expect(lmount).Should(ExitCleanly())
|
||||
Expect(lmount.OutputToString()).To(ContainSubstring(cid1))
|
||||
Expect(lmount.OutputToString()).ToNot(ContainSubstring(cid2))
|
||||
Expect(lmount.OutputToString()).To(ContainSubstring(cid3))
|
||||
|
||||
umount := podmanTest.Podman([]string{"umount", cid1, cid3})
|
||||
umount.WaitWithDefaultTimeout()
|
||||
Expect(umount).Should(Exit(0))
|
||||
Expect(umount).Should(ExitCleanly())
|
||||
|
||||
lmount = podmanTest.Podman([]string{"mount", "--no-trunc"})
|
||||
lmount.WaitWithDefaultTimeout()
|
||||
Expect(lmount).Should(Exit(0))
|
||||
Expect(lmount).Should(ExitCleanly())
|
||||
Expect(lmount.OutputToString()).To(Equal(""))
|
||||
|
||||
})
|
||||
|
@ -238,96 +237,96 @@ var _ = Describe("Podman mount", func() {
|
|||
|
||||
setup := podmanTest.Podman([]string{"create", ALPINE, "ls"})
|
||||
setup.WaitWithDefaultTimeout()
|
||||
Expect(setup).Should(Exit(0))
|
||||
Expect(setup).Should(ExitCleanly())
|
||||
cid := setup.OutputToString()
|
||||
|
||||
lmount := podmanTest.Podman([]string{"mount", "--no-trunc"})
|
||||
lmount.WaitWithDefaultTimeout()
|
||||
Expect(lmount).Should(Exit(0))
|
||||
Expect(lmount).Should(ExitCleanly())
|
||||
Expect(lmount.OutputToString()).To(Equal(""))
|
||||
|
||||
mount := podmanTest.Podman([]string{"mount", cid})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
Expect(mount).Should(ExitCleanly())
|
||||
|
||||
// test --notruncate alias
|
||||
lmount = podmanTest.Podman([]string{"mount", "--notruncate"})
|
||||
lmount.WaitWithDefaultTimeout()
|
||||
Expect(lmount).Should(Exit(0))
|
||||
Expect(lmount).Should(ExitCleanly())
|
||||
Expect(lmount.OutputToString()).To(ContainSubstring(cid))
|
||||
|
||||
umount := podmanTest.Podman([]string{"umount", cid})
|
||||
umount.WaitWithDefaultTimeout()
|
||||
Expect(umount).Should(Exit(0))
|
||||
Expect(umount).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman image mount", func() {
|
||||
images := podmanTest.Podman([]string{"images"})
|
||||
images.WaitWithDefaultTimeout()
|
||||
Expect(images).Should(Exit(0))
|
||||
Expect(images).Should(ExitCleanly())
|
||||
|
||||
mount := podmanTest.Podman([]string{"image", "mount", ALPINE})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
Expect(mount).Should(ExitCleanly())
|
||||
|
||||
umount := podmanTest.Podman([]string{"image", "umount", ALPINE})
|
||||
umount.WaitWithDefaultTimeout()
|
||||
Expect(umount).Should(Exit(0))
|
||||
Expect(umount).Should(ExitCleanly())
|
||||
|
||||
mount = podmanTest.Podman([]string{"image", "mount"})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
Expect(mount).Should(ExitCleanly())
|
||||
Expect(mount.OutputToString()).To(Equal(""))
|
||||
|
||||
// Mount multiple times
|
||||
mount = podmanTest.Podman([]string{"image", "mount", ALPINE})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
Expect(mount).Should(ExitCleanly())
|
||||
|
||||
mount = podmanTest.Podman([]string{"image", "mount", ALPINE})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
Expect(mount).Should(ExitCleanly())
|
||||
|
||||
// Unmount once
|
||||
mount = podmanTest.Podman([]string{"image", "mount", ALPINE})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
Expect(mount).Should(ExitCleanly())
|
||||
|
||||
mount = podmanTest.Podman([]string{"image", "mount"})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
Expect(mount).Should(ExitCleanly())
|
||||
Expect(mount.OutputToString()).To(ContainSubstring(ALPINE))
|
||||
|
||||
mount = podmanTest.Podman([]string{"image", "umount", "--all"})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
Expect(mount).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman mount with json format", func() {
|
||||
podmanTest.AddImageToRWStore(fedoraMinimal)
|
||||
mount := podmanTest.Podman([]string{"image", "mount", fedoraMinimal})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
Expect(mount).Should(ExitCleanly())
|
||||
|
||||
j := podmanTest.Podman([]string{"image", "mount", "--format=json"})
|
||||
j.WaitWithDefaultTimeout()
|
||||
Expect(j).Should(Exit(0))
|
||||
Expect(j).Should(ExitCleanly())
|
||||
Expect(j.OutputToString()).To(BeValidJSON())
|
||||
|
||||
umount := podmanTest.Podman([]string{"image", "umount", fedoraMinimal})
|
||||
umount.WaitWithDefaultTimeout()
|
||||
Expect(umount).Should(Exit(0))
|
||||
Expect(umount).Should(ExitCleanly())
|
||||
})
|
||||
|
||||
It("podman umount --all", func() {
|
||||
podmanTest.AddImageToRWStore(fedoraMinimal)
|
||||
mount := podmanTest.Podman([]string{"image", "mount", fedoraMinimal})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
Expect(mount).Should(ExitCleanly())
|
||||
|
||||
umount := podmanTest.Podman([]string{"image", "umount", "--all"})
|
||||
umount.WaitWithDefaultTimeout()
|
||||
Expect(umount).Should(Exit(0))
|
||||
Expect(umount).Should(ExitCleanly())
|
||||
Expect(umount.OutputToStringArray()).To(HaveLen(1))
|
||||
})
|
||||
|
||||
|
@ -338,66 +337,66 @@ var _ = Describe("Podman mount", func() {
|
|||
|
||||
mount1 := podmanTest.Podman([]string{"image", "mount", fedoraMinimal, ALPINE, "busybox"})
|
||||
mount1.WaitWithDefaultTimeout()
|
||||
Expect(mount1).Should(Exit(0))
|
||||
Expect(mount1).Should(ExitCleanly())
|
||||
|
||||
umount := podmanTest.Podman([]string{"image", "umount", fedoraMinimal, ALPINE})
|
||||
umount.WaitWithDefaultTimeout()
|
||||
Expect(umount).Should(Exit(0))
|
||||
Expect(umount).Should(ExitCleanly())
|
||||
|
||||
mount := podmanTest.Podman([]string{"image", "mount"})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
Expect(mount).Should(ExitCleanly())
|
||||
Expect(mount.OutputToString()).To(ContainSubstring("busybox"))
|
||||
|
||||
mount1 = podmanTest.Podman([]string{"image", "unmount", "busybox"})
|
||||
mount1.WaitWithDefaultTimeout()
|
||||
Expect(mount1).Should(Exit(0))
|
||||
Expect(mount1).Should(ExitCleanly())
|
||||
|
||||
mount = podmanTest.Podman([]string{"image", "mount"})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
Expect(mount).Should(ExitCleanly())
|
||||
Expect(mount.OutputToString()).To(Equal(""))
|
||||
|
||||
mount1 = podmanTest.Podman([]string{"image", "mount", fedoraMinimal, ALPINE, "busybox"})
|
||||
mount1.WaitWithDefaultTimeout()
|
||||
Expect(mount1).Should(Exit(0))
|
||||
Expect(mount1).Should(ExitCleanly())
|
||||
|
||||
mount = podmanTest.Podman([]string{"image", "mount"})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
Expect(mount).Should(ExitCleanly())
|
||||
Expect(mount.OutputToString()).To(ContainSubstring(fedoraMinimal))
|
||||
Expect(mount.OutputToString()).To(ContainSubstring(ALPINE))
|
||||
|
||||
umount = podmanTest.Podman([]string{"image", "umount", "--all"})
|
||||
umount.WaitWithDefaultTimeout()
|
||||
Expect(umount).Should(Exit(0))
|
||||
Expect(umount).Should(ExitCleanly())
|
||||
|
||||
mount = podmanTest.Podman([]string{"image", "mount"})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
Expect(mount).Should(ExitCleanly())
|
||||
Expect(mount.OutputToString()).To(Equal(""))
|
||||
|
||||
umount = podmanTest.Podman([]string{"image", "umount", fedoraMinimal, ALPINE})
|
||||
umount.WaitWithDefaultTimeout()
|
||||
Expect(umount).Should(Exit(0))
|
||||
Expect(umount).Should(ExitCleanly())
|
||||
|
||||
mount1 = podmanTest.Podman([]string{"image", "mount", "--all"})
|
||||
mount1.WaitWithDefaultTimeout()
|
||||
Expect(mount1).Should(Exit(0))
|
||||
Expect(mount1).Should(ExitCleanly())
|
||||
|
||||
mount = podmanTest.Podman([]string{"image", "mount"})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
Expect(mount).Should(ExitCleanly())
|
||||
Expect(mount.OutputToString()).To(ContainSubstring(fedoraMinimal))
|
||||
Expect(mount.OutputToString()).To(ContainSubstring(ALPINE))
|
||||
|
||||
umount = podmanTest.Podman([]string{"image", "umount", "--all"})
|
||||
umount.WaitWithDefaultTimeout()
|
||||
Expect(umount).Should(Exit(0))
|
||||
Expect(umount).Should(ExitCleanly())
|
||||
|
||||
mount = podmanTest.Podman([]string{"image", "mount"})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
Expect(mount).Should(ExitCleanly())
|
||||
Expect(mount.OutputToString()).To(Equal(""))
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue