[test-integration] Migrate some more tests to cli package

Add some required command operators to the `cli` package, and update
some tests to use this package, in order to remove a few functions
from `docker_utils_test.go`

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester
2017-03-27 17:12:48 +02:00
parent dc1f036772
commit eeaa6c96d8
15 changed files with 234 additions and 272 deletions

View File

@@ -11,6 +11,7 @@ import (
"github.com/docker/docker/api"
"github.com/docker/docker/integration-cli/checker"
"github.com/docker/docker/integration-cli/cli"
"github.com/docker/docker/integration-cli/request"
"github.com/docker/docker/pkg/testutil"
icmd "github.com/docker/docker/pkg/testutil/cmd"
@@ -71,10 +72,7 @@ func (s *DockerSuite) TestAPIDockerAPIVersion(c *check.C) {
defer server.Close()
// Test using the env var first
result := icmd.RunCmd(icmd.Cmd{
Command: binaryWithArgs("-H="+server.URL[7:], "version"),
Env: appendBaseEnv(false, "DOCKER_API_VERSION=xxx"),
})
result := cli.Docker(cli.Args("-H="+server.URL[7:], "version"), cli.WithEnvironmentVariables("DOCKER_API_VERSION=xxx"))
c.Assert(result, icmd.Matches, icmd.Expected{Out: "API version: xxx", ExitCode: 1})
c.Assert(svrVersion, check.Equals, "/vxxx/version", check.Commentf("%s", result.Compare(icmd.Success)))
}