mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #22 from shykes/shykes-0.6.5-dm-plugin
Fix ImageTree test
This commit is contained in:
commit
a06edd77e5
2 changed files with 12 additions and 11 deletions
14
commands.go
14
commands.go
|
@ -1100,16 +1100,18 @@ func (cli *DockerCli) CmdImages(args ...string) error {
|
|||
}
|
||||
|
||||
var outs []APIImages
|
||||
err = json.Unmarshal(body, &outs)
|
||||
if err != nil {
|
||||
if err := json.Unmarshal(body, &outs); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var startImageArg = cmd.Arg(0)
|
||||
var startImage APIImages
|
||||
var (
|
||||
startImageArg = cmd.Arg(0)
|
||||
startImage APIImages
|
||||
|
||||
roots []APIImages
|
||||
byParent = make(map[string][]APIImages)
|
||||
)
|
||||
|
||||
var roots []APIImages
|
||||
var byParent = make(map[string][]APIImages)
|
||||
for _, image := range outs {
|
||||
if image.ParentId == "" {
|
||||
roots = append(roots, image)
|
||||
|
|
|
@ -776,13 +776,12 @@ func TestImagesTree(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
cmdOutput := string(cmdOutputBytes)
|
||||
|
||||
regexpStrings := []string{
|
||||
fmt.Sprintf("└─%s Size: (\\d+.\\d+ MB) \\(virtual \\d+.\\d+ MB\\) Tags: %s:latest", unitTestImageIDShort, unitTestImageName),
|
||||
"(?m)^ └─[0-9a-f]+",
|
||||
"(?m)^ └─[0-9a-f]+",
|
||||
"(?m)^ └─[0-9a-f]+",
|
||||
fmt.Sprintf(" └─%s Size: \\d+ B \\(virtual \\d+.\\d+ MB\\) Tags: test:latest", utils.TruncateID(image.ID)),
|
||||
"(?m) └─[0-9a-f]+.*",
|
||||
"(?m) └─[0-9a-f]+.*",
|
||||
"(?m) └─[0-9a-f]+.*",
|
||||
fmt.Sprintf("(?m)^ └─%s Size: \\d+.\\d+ MB \\(virtual \\d+.\\d+ MB\\) Tags: test:latest", utils.TruncateID(image.ID)),
|
||||
}
|
||||
|
||||
compiledRegexps := []*regexp.Regexp{}
|
||||
|
|
Loading…
Reference in a new issue