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>
This commit is contained in:
Alexander Morozov
2015-04-21 10:28:52 -07:00
parent 6dcdf832a3
commit dc944ea7e4
60 changed files with 3746 additions and 4807 deletions
+5 -7
View File
@@ -7,13 +7,13 @@ import (
"os"
"os/exec"
"path/filepath"
"testing"
"github.com/docker/docker/pkg/homedir"
"github.com/go-check/check"
)
func TestConfigHttpHeader(t *testing.T) {
testRequires(t, UnixCli) // Can't set/unset HOME on windows right now
func (s *DockerSuite) TestConfigHttpHeader(c *check.C) {
testRequires(c, UnixCli) // Can't set/unset HOME on windows right now
// We either need a level of Go that supports Unsetenv (for cases
// when HOME/USERPROFILE isn't set), or we need to be able to use
// os/user but user.Current() only works if we aren't statically compiling
@@ -44,15 +44,13 @@ func TestConfigHttpHeader(t *testing.T) {
err := ioutil.WriteFile(tmpCfg, []byte(data), 0600)
if err != nil {
t.Fatalf("Err creating file(%s): %v", tmpCfg, err)
c.Fatalf("Err creating file(%s): %v", tmpCfg, err)
}
cmd := exec.Command(dockerBinary, "-H="+server.URL[7:], "ps")
out, _, _ := runCommandWithOutput(cmd)
if headers["Myheader"] == nil || headers["Myheader"][0] != "MyValue" {
t.Fatalf("Missing/bad header: %q\nout:%v", headers, out)
c.Fatalf("Missing/bad header: %q\nout:%v", headers, out)
}
logDone("config - add new http headers")
}