mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
dc944ea7e4
It prints test name and duration for each test. Also performs deleteAllContainers after each test. Signed-off-by: Alexander Morozov <lk4d4@docker.com>
23 lines
631 B
Go
23 lines
631 B
Go
package main
|
|
|
|
import (
|
|
"os/exec"
|
|
"strings"
|
|
|
|
"github.com/go-check/check"
|
|
)
|
|
|
|
func (s *DockerSuite) TestInspectImage(c *check.C) {
|
|
imageTest := "emptyfs"
|
|
imageTestID := "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158"
|
|
imagesCmd := exec.Command(dockerBinary, "inspect", "--format='{{.Id}}'", imageTest)
|
|
out, exitCode, err := runCommandWithOutput(imagesCmd)
|
|
if exitCode != 0 || err != nil {
|
|
c.Fatalf("failed to inspect image: %s, %v", out, err)
|
|
}
|
|
|
|
if id := strings.TrimSuffix(out, "\n"); id != imageTestID {
|
|
c.Fatalf("Expected id: %s for image: %s but received id: %s", imageTestID, imageTest, id)
|
|
}
|
|
|
|
}
|