Cleanup errorOut resp in push tests

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
This commit is contained in:
Jessica Frazelle 2014-10-14 14:02:15 -07:00
parent 764030ec92
commit f013506aad
1 changed files with 7 additions and 14 deletions

View File

@ -15,22 +15,17 @@ func TestPushBusyboxImage(t *testing.T) {
// tag the image to upload it tot he private registry // tag the image to upload it tot he private registry
repoName := fmt.Sprintf("%v/busybox", privateRegistryURL) repoName := fmt.Sprintf("%v/busybox", privateRegistryURL)
tagCmd := exec.Command(dockerBinary, "tag", "busybox", repoName) tagCmd := exec.Command(dockerBinary, "tag", "busybox", repoName)
out, exitCode, err := runCommandWithOutput(tagCmd) if out, _, err := runCommandWithOutput(tagCmd); err != nil {
errorOut(err, t, fmt.Sprintf("%v %v", out, err)) t.Fatal("image tagging failed: %s, %v", out, err)
if err != nil || exitCode != 0 {
t.Fatal("image tagging failed")
} }
pushCmd := exec.Command(dockerBinary, "push", repoName) pushCmd := exec.Command(dockerBinary, "push", repoName)
out, exitCode, err = runCommandWithOutput(pushCmd) if out, _, err := runCommandWithOutput(pushCmd); err != nil {
errorOut(err, t, fmt.Sprintf("%v %v", out, err)) t.Fatal("pushing the image to the private registry has failed: %s, %v", out, err)
}
deleteImages(repoName) deleteImages(repoName)
if err != nil || exitCode != 0 {
t.Fatal("pushing the image to the private registry has failed")
}
logDone("push - push busybox to private registry") logDone("push - push busybox to private registry")
} }
@ -39,10 +34,8 @@ func TestPushUnprefixedRepo(t *testing.T) {
// skip this test until we're able to use a registry // skip this test until we're able to use a registry
t.Skip() t.Skip()
pushCmd := exec.Command(dockerBinary, "push", "busybox") pushCmd := exec.Command(dockerBinary, "push", "busybox")
_, exitCode, err := runCommandWithOutput(pushCmd) if out, _, err := runCommandWithOutput(pushCmd); err == nil {
t.Fatal("pushing an unprefixed repo didn't result in a non-zero exit status: %s", out)
if err == nil || exitCode == 0 {
t.Fatal("pushing an unprefixed repo didn't result in a non-zero exit status")
} }
logDone("push - push unprefixed busybox repo --> must fail") logDone("push - push unprefixed busybox repo --> must fail")
} }