mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Cleanup errorOut resp in images tests
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
This commit is contained in:
parent
50c3e7537c
commit
dd248dee3c
1 changed files with 6 additions and 3 deletions
|
@ -1,7 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
@ -11,7 +10,9 @@ import (
|
||||||
func TestImagesEnsureImageIsListed(t *testing.T) {
|
func TestImagesEnsureImageIsListed(t *testing.T) {
|
||||||
imagesCmd := exec.Command(dockerBinary, "images")
|
imagesCmd := exec.Command(dockerBinary, "images")
|
||||||
out, _, err := runCommandWithOutput(imagesCmd)
|
out, _, err := runCommandWithOutput(imagesCmd)
|
||||||
errorOut(err, t, fmt.Sprintf("listing images failed with errors: %v", err))
|
if err != nil {
|
||||||
|
t.Fatalf("listing images failed with errors: %s, %v", out, err)
|
||||||
|
}
|
||||||
|
|
||||||
if !strings.Contains(out, "busybox") {
|
if !strings.Contains(out, "busybox") {
|
||||||
t.Fatal("images should've listed busybox")
|
t.Fatal("images should've listed busybox")
|
||||||
|
@ -46,7 +47,9 @@ func TestImagesOrderedByCreationDate(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "images", "-q", "--no-trunc"))
|
out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "images", "-q", "--no-trunc"))
|
||||||
errorOut(err, t, fmt.Sprintf("listing images failed with errors: %v", err))
|
if err != nil {
|
||||||
|
t.Fatalf("listing images failed with errors: %s, %v", out, err)
|
||||||
|
}
|
||||||
imgs := strings.Split(out, "\n")
|
imgs := strings.Split(out, "\n")
|
||||||
if imgs[0] != id3 {
|
if imgs[0] != id3 {
|
||||||
t.Fatalf("First image must be %s, got %s", id3, imgs[0])
|
t.Fatalf("First image must be %s, got %s", id3, imgs[0])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue