Skip to content

Commit

Permalink
save many: adding an integration-cli test
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Batts <vbatts@redhat.com>
  • Loading branch information
vbatts committed Aug 29, 2014
1 parent e64131d commit 79501dc
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions integration-cli/docker_cli_save_load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

0 comments on commit 79501dc

Please sign in to comment.