Clean up integration-cli tests

My AR couldn't take it any more:
- one logDone per test
- PASSED lines don't wrap

Signed-off-by: Doug Davis <dug@us.ibm.com>
This commit is contained in:
Doug Davis 2015-03-26 17:25:50 -07:00
parent be5fd157d5
commit 9a9d23dbc4
6 changed files with 10 additions and 24 deletions

View File

@ -1911,8 +1911,6 @@ func TestBuildWithInaccessibleFilesInContext(t *testing.T) {
}
logDone("build - ADD from context with inaccessible files must not pass")
logDone("build - ADD from context with accessible links must work")
logDone("build - ADD from context with ignored inaccessible files must work")
}
func TestBuildForceRm(t *testing.T) {
@ -2152,7 +2150,6 @@ func TestBuildRm(t *testing.T) {
}
logDone("build - ensure --rm doesn't leave containers behind and that --rm=true is the default")
logDone("build - ensure --rm=false overrides the default")
}
func TestBuildWithVolumes(t *testing.T) {
@ -3265,15 +3262,16 @@ CMD ["cat", "/foo"]`,
if out, _, err := runCommandWithOutput(buildCmd); err != nil {
t.Fatalf("build failed to complete: %v %v", out, err)
}
logDone(fmt.Sprintf("build - build an image with a context tar, compression: %v", compression))
}
func TestBuildContextTarGzip(t *testing.T) {
testContextTar(t, archive.Gzip)
logDone(fmt.Sprintf("build - build an image with a context tar, compression: %v", archive.Gzip))
}
func TestBuildContextTarNoCompression(t *testing.T) {
testContextTar(t, archive.Uncompressed)
logDone(fmt.Sprintf("build - build an image with a context tar, compression: %v", archive.Uncompressed))
}
func TestBuildNoContext(t *testing.T) {

View File

@ -45,8 +45,7 @@ func TestExportContainerAndImportImage(t *testing.T) {
deleteContainer(cleanedContainerID)
deleteImages("repo/testexp:v1")
logDone("export - export a container")
logDone("import - import an image")
logDone("export - export/import a container/image")
}
// Used to test output flag in the export command
@ -94,6 +93,5 @@ func TestExportContainerWithOutputAndImportImage(t *testing.T) {
os.Remove("/tmp/testexp.tar")
logDone("export - export a container with output flag")
logDone("import - import an image with output flag")
logDone("export - export/import a container/image with output flag")
}

View File

@ -295,8 +295,7 @@ func TestRunWorkingDirectory(t *testing.T) {
t.Errorf("--workdir failed to set working directory")
}
logDone("run - run with working directory set by -w")
logDone("run - run with working directory set by --workdir")
logDone("run - run with working directory set by -w/--workdir")
}
// pinging Google's DNS resolver should fail when we disable the networking
@ -321,8 +320,7 @@ func TestRunWithoutNetworking(t *testing.T) {
t.Errorf("-n=false should've disabled the network; the container shouldn't have been able to ping 8.8.8.8")
}
logDone("run - disable networking with --net=none")
logDone("run - disable networking with -n=false")
logDone("run - disable networking with --net=none/-n=false")
}
//test --link use container name to link target

View File

@ -70,8 +70,6 @@ func TestSaveAndLoadRepoStdout(t *testing.T) {
os.Remove("/tmp/foobar-save-load-test.tar")
logDone("save - save/load a repo using stdout")
pty, tty, err := pty.Open()
if err != nil {
t.Fatalf("Could not open pty: %v", err)
@ -98,5 +96,5 @@ func TestSaveAndLoadRepoStdout(t *testing.T) {
t.Fatal("help output is not being yielded", out)
}
logDone("save - do not save to a tty")
logDone("save - save/load a repo using stdout")
}

View File

@ -1,7 +1,6 @@
package main
import (
"fmt"
"os/exec"
"strings"
"testing"
@ -91,9 +90,8 @@ func TestTagValidPrefixedRepo(t *testing.T) {
continue
}
deleteImages(repo)
logMessage := fmt.Sprintf("tag - busybox %v", repo)
logDone(logMessage)
}
logDone("tag - tag valid prefixed repo")
}
// tag an image with an existed tag name without -f option should fail
@ -162,9 +160,6 @@ func TestTagOfficialNames(t *testing.T) {
} else if strings.Contains(out, name) {
t.Errorf("images should not have listed '%s'", name)
deleteImages(name + ":latest")
} else {
logMessage := fmt.Sprintf("tag official name - busybox %v", name)
logDone(logMessage)
}
}
@ -176,7 +171,6 @@ func TestTagOfficialNames(t *testing.T) {
continue
}
deleteImages("fooo/bar:latest")
logMessage := fmt.Sprintf("tag official name - %v fooo/bar", name)
logDone(logMessage)
}
logDone("tag - tag official names")
}

View File

@ -166,7 +166,7 @@ func runCommandPipelineWithOutput(cmds ...*exec.Cmd) (output string, exitCode in
}
func logDone(message string) {
fmt.Printf("[PASSED]: %s\n", message)
fmt.Printf("[PASSED]: %.69s\n", message)
}
func stripTrailingCharacters(target string) string {