Use suite for integration-cli

It prints test name and duration for each test.
Also performs deleteAllContainers after each test.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: dc944ea7e48d11a2906e751d3e61daf08faee054
Component: engine
This commit is contained in:
Alexander Morozov
2015-04-18 09:46:47 -07:00
parent 36fe7b2098
commit 1884ef3b9b
60 changed files with 3746 additions and 4807 deletions

View File

@ -3,15 +3,16 @@ package main
import (
"os/exec"
"strings"
"testing"
"github.com/go-check/check"
)
// ensure docker info succeeds
func TestInfoEnsureSucceeds(t *testing.T) {
func (s *DockerSuite) TestInfoEnsureSucceeds(c *check.C) {
versionCmd := exec.Command(dockerBinary, "info")
out, exitCode, err := runCommandWithOutput(versionCmd)
if err != nil || exitCode != 0 {
t.Fatalf("failed to execute docker info: %s, %v", out, err)
c.Fatalf("failed to execute docker info: %s, %v", out, err)
}
// always shown fields
@ -29,9 +30,8 @@ func TestInfoEnsureSucceeds(t *testing.T) {
for _, linePrefix := range stringsToCheck {
if !strings.Contains(out, linePrefix) {
t.Errorf("couldn't find string %v in output", linePrefix)
c.Errorf("couldn't find string %v in output", linePrefix)
}
}
logDone("info - verify that it works")
}