1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #11848 from duglin/CleanupIntTests

Clean up integration-cli tests
This commit is contained in:
Alexander Morozov 2015-03-27 14:11:56 -07:00
commit 240f3e14c7
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 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) { 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 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) { func TestBuildWithVolumes(t *testing.T) {
@ -3265,15 +3262,16 @@ CMD ["cat", "/foo"]`,
if out, _, err := runCommandWithOutput(buildCmd); err != nil { if out, _, err := runCommandWithOutput(buildCmd); err != nil {
t.Fatalf("build failed to complete: %v %v", out, err) 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) { func TestBuildContextTarGzip(t *testing.T) {
testContextTar(t, archive.Gzip) testContextTar(t, archive.Gzip)
logDone(fmt.Sprintf("build - build an image with a context tar, compression: %v", archive.Gzip))
} }
func TestBuildContextTarNoCompression(t *testing.T) { func TestBuildContextTarNoCompression(t *testing.T) {
testContextTar(t, archive.Uncompressed) testContextTar(t, archive.Uncompressed)
logDone(fmt.Sprintf("build - build an image with a context tar, compression: %v", archive.Uncompressed))
} }
func TestBuildNoContext(t *testing.T) { func TestBuildNoContext(t *testing.T) {

View file

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

View file

@ -295,8 +295,7 @@ func TestRunWorkingDirectory(t *testing.T) {
t.Errorf("--workdir failed to set working directory") 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 -w/--workdir")
logDone("run - run with working directory set by --workdir")
} }
// pinging Google's DNS resolver should fail when we disable the networking // 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") 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 --net=none/-n=false")
logDone("run - disable networking with -n=false")
} }
//test --link use container name to link target //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") os.Remove("/tmp/foobar-save-load-test.tar")
logDone("save - save/load a repo using stdout")
pty, tty, err := pty.Open() pty, tty, err := pty.Open()
if err != nil { if err != nil {
t.Fatalf("Could not open pty: %v", err) 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) 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 package main
import ( import (
"fmt"
"os/exec" "os/exec"
"strings" "strings"
"testing" "testing"
@ -91,9 +90,8 @@ func TestTagValidPrefixedRepo(t *testing.T) {
continue continue
} }
deleteImages(repo) 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 // 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) { } else if strings.Contains(out, name) {
t.Errorf("images should not have listed '%s'", name) t.Errorf("images should not have listed '%s'", name)
deleteImages(name + ":latest") 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 continue
} }
deleteImages("fooo/bar:latest") 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) { func logDone(message string) {
fmt.Printf("[PASSED]: %s\n", message) fmt.Printf("[PASSED]: %.69s\n", message)
} }
func stripTrailingCharacters(target string) string { func stripTrailingCharacters(target string) string {