1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/integration-cli/docker_cli_inspect_test.go
Adrien Folie f337a52a6e Move TestGetImagesByName
Docker-DCO-1.1-Signed-off-by: Adrien Folie <folie.adrien@gmail.com> (github: folieadrien)
2014-07-03 01:39:08 +02:00

22 lines
617 B
Go

package main
import (
"os/exec"
"strings"
"testing"
)
func TestInspectImage(t *testing.T) {
imageTest := "scratch"
imageTestId := "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158"
imagesCmd := exec.Command(dockerBinary, "inspect", "--format='{{.Id}}'", imageTest)
out, exitCode, err := runCommandWithOutput(imagesCmd)
if exitCode != 0 || err != nil {
t.Fatalf("failed to inspect image")
}
if id := strings.TrimSuffix(out, "\n"); id != imageTestId {
t.Fatalf("Expected id: %s for image: %s but received id: %s", imageTestId, imageTest, id)
}
logDone("inspect - inspect an image")
}