save many: adding an integration-cli test

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 79501dcd4f7a207067c234766ae4788007a1d91b
Component: engine
This commit is contained in:
Vincent Batts
2014-08-28 21:33:13 -04:00
parent 4d890308d7
commit 5583bba50b

View File

@ -167,3 +167,27 @@ func TestSaveAndLoadRepoFlags(t *testing.T) {
logDone("save - save a repo using -o")
logDone("load - load a repo using -i")
}
func TestSaveMultipleNames(t *testing.T) {
repoName := "foobar-save-multi-name-test"
// Make one image
tagCmdFinal := fmt.Sprintf("%v tag scratch:latest %v-one:latest", dockerBinary, repoName)
tagCmd := exec.Command("bash", "-c", tagCmdFinal)
out, _, err := runCommandWithOutput(tagCmd)
errorOut(err, t, fmt.Sprintf("failed to tag repo: %v %v", out, err))
// Make two images
tagCmdFinal = fmt.Sprintf("%v tag scratch:latest %v-two:latest", dockerBinary, repoName)
tagCmd = exec.Command("bash", "-c", tagCmdFinal)
out, _, err = runCommandWithOutput(tagCmd)
errorOut(err, t, fmt.Sprintf("failed to tag repo: %v %v", out, err))
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)
out, _, err = runCommandWithOutput(saveCmd)
errorOut(err, t, fmt.Sprintf("failed to save multiple repos: %v %v", out, err))
deleteImages(repoName)
logDone("save - save by multiple names")
}