mirror of
https://github.com/containers/podman.git
synced 2025-12-04 12:17:34 +08:00
Merge pull request #2879 from mheon/header_on_no_images
Print header for 'podman images' even with no images present
This commit is contained in:
@@ -43,6 +43,17 @@ var _ = Describe("Podman images", func() {
|
||||
Expect(session.LineInOuputStartsWith("docker.io/library/busybox")).To(BeTrue())
|
||||
})
|
||||
|
||||
It("podman images with no images prints header", func() {
|
||||
rmi := podmanTest.Podman([]string{"rmi", "-a"})
|
||||
rmi.WaitWithDefaultTimeout()
|
||||
Expect(rmi.ExitCode()).To(Equal(0))
|
||||
|
||||
session := podmanTest.Podman([]string{"images"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
Expect(len(session.OutputToStringArray())).To(Equal(1))
|
||||
})
|
||||
|
||||
It("podman image List", func() {
|
||||
session := podmanTest.Podman([]string{"image", "list"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
|
||||
@@ -82,7 +82,7 @@ var _ = Describe("Podman rm", func() {
|
||||
prune.WaitWithDefaultTimeout()
|
||||
Expect(prune.ExitCode()).To(Equal(0))
|
||||
|
||||
images := podmanTest.Podman([]string{"images", "-a"})
|
||||
images := podmanTest.Podman([]string{"images", "-aq"})
|
||||
images.WaitWithDefaultTimeout()
|
||||
// all images are unused, so they all should be deleted!
|
||||
Expect(len(images.OutputToStringArray())).To(Equal(0))
|
||||
@@ -95,7 +95,7 @@ var _ = Describe("Podman rm", func() {
|
||||
prune.WaitWithDefaultTimeout()
|
||||
Expect(prune.ExitCode()).To(Equal(0))
|
||||
|
||||
images := podmanTest.Podman([]string{"images", "-a"})
|
||||
images := podmanTest.Podman([]string{"images", "-aq"})
|
||||
images.WaitWithDefaultTimeout()
|
||||
// all images are unused, so they all should be deleted!
|
||||
Expect(len(images.OutputToStringArray())).To(Equal(0))
|
||||
|
||||
@@ -270,7 +270,7 @@ RUN find $LOCAL
|
||||
fmt.Println(session.OutputToString())
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
|
||||
images := podmanTest.Podman([]string{"images", "--all"})
|
||||
images := podmanTest.Podman([]string{"images", "-aq"})
|
||||
images.WaitWithDefaultTimeout()
|
||||
Expect(images.ExitCode()).To(Equal(0))
|
||||
Expect(len(images.OutputToStringArray())).To(Equal(0))
|
||||
|
||||
Reference in New Issue
Block a user