Make sure integration-cli test clean up
Common patterns: - Multiple images were built with same name but only one cleanup. - Containers were deleted after images. - Images not removed after retagging. Signed-off-by: Tõnis Tiigi <tonistiigi@gmail.com> (github: tonistiigi) Upstream-commit: da3d3b97ebe1e6fe1254367521c725ca12a5e61d Component: engine
This commit is contained in:
@ -239,12 +239,15 @@ func TestSaveMultipleNames(t *testing.T) {
|
||||
if out, _, err := runCommandWithOutput(tagCmd); err != nil {
|
||||
t.Fatalf("failed to tag repo: %s, %v", out, err)
|
||||
}
|
||||
defer deleteImages(repoName + "-one")
|
||||
|
||||
// Make two images
|
||||
tagCmdFinal = fmt.Sprintf("%v tag scratch:latest %v-two:latest", dockerBinary, repoName)
|
||||
tagCmd = exec.Command("bash", "-c", tagCmdFinal)
|
||||
if out, _, err := runCommandWithOutput(tagCmd); err != nil {
|
||||
t.Fatalf("failed to tag repo: %s, %v", out, err)
|
||||
}
|
||||
defer deleteImages(repoName + "-two")
|
||||
|
||||
saveCmdFinal := fmt.Sprintf("%v save %v-one %v-two:latest | tar xO repositories | grep -q -E '(-one|-two)'", dockerBinary, repoName, repoName)
|
||||
saveCmd := exec.Command("bash", "-c", saveCmdFinal)
|
||||
|
||||
Reference in New Issue
Block a user