mirror of
https://github.com/docker/cli.git
synced 2026-09-26 17:30:51 -04:00
Move TestGetImagesByName
Docker-DCO-1.1-Signed-off-by: Adrien Folie <folie.adrien@gmail.com> (github: folieadrien) Upstream-commit: f337a52a6ec01684c326a827adbe3d0b8b5f1f53 Component: engine
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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")
|
||||
}
|
||||
Reference in New Issue
Block a user