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:
@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user