save many: adding an integration-cli test

Signed-off-by: Vincent Batts <vbatts@redhat.com>
This commit is contained in:
Vincent Batts 2014-08-28 21:33:13 -04:00
parent e64131d1bf
commit 79501dcd4f
1 changed files with 24 additions and 0 deletions

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")
}