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

Use actual cli version for TestConfigHTTPHeader

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure 2017-06-01 09:35:30 -07:00
parent d7c125791a
commit 0b90edc22f
3 changed files with 4 additions and 2 deletions

View file

@ -17,6 +17,8 @@ if ! command -v "$TEST_CLIENT_BINARY" &> /dev/null; then
false false
fi fi
export DOCKER_CLI_VERSION=$(${TEST_CLIENT_BINARY} --version | awk '{ gsub(",", " "); print $3 }')
# This is a temporary hack for split-binary mode. It can be removed once # This is a temporary hack for split-binary mode. It can be removed once
# https://github.com/docker/docker/pull/22134 is merged into docker master # https://github.com/docker/docker/pull/22134 is merged into docker master
if [ "$(go env GOOS)" = 'windows' ]; then if [ "$(go env GOOS)" = 'windows' ]; then

View file

@ -60,6 +60,7 @@ test_env() {
# use "env -i" to tightly control the environment variables that bleed into the tests # use "env -i" to tightly control the environment variables that bleed into the tests
env -i \ env -i \
DEST="$DEST" \ DEST="$DEST" \
DOCKER_CLI_VERSION="$DOCKER_CLI_VERSION" \
DOCKER_API_VERSION="$DOCKER_API_VERSION" \ DOCKER_API_VERSION="$DOCKER_API_VERSION" \
DOCKER_INTEGRATION_DAEMON_DEST="$DOCKER_INTEGRATION_DAEMON_DEST" \ DOCKER_INTEGRATION_DAEMON_DEST="$DOCKER_INTEGRATION_DAEMON_DEST" \
DOCKER_TLS_VERIFY="$DOCKER_TEST_TLS_VERIFY" \ DOCKER_TLS_VERIFY="$DOCKER_TEST_TLS_VERIFY" \

View file

@ -58,8 +58,7 @@ func (s *DockerSuite) TestConfigHTTPHeader(c *check.C) {
c.Assert(headers["User-Agent"], checker.NotNil, check.Commentf("Missing User-Agent")) c.Assert(headers["User-Agent"], checker.NotNil, check.Commentf("Missing User-Agent"))
//TODO(tiborvass): restore dockerversion.Version instead of library-import c.Assert(headers["User-Agent"][0], checker.Equals, "Docker-Client/"+os.Getenv("DOCKER_CLI_VERSION")+" ("+runtime.GOOS+")", check.Commentf("Badly formatted User-Agent,out:%v", result.Combined()))
c.Assert(headers["User-Agent"][0], checker.Equals, "Docker-Client/unknown-version ("+runtime.GOOS+")", check.Commentf("Badly formatted User-Agent,out:%v", result.Combined()))
c.Assert(headers["Myheader"], checker.NotNil) c.Assert(headers["Myheader"], checker.NotNil)
c.Assert(headers["Myheader"][0], checker.Equals, "MyValue", check.Commentf("Missing/bad header,out:%v", result.Combined())) c.Assert(headers["Myheader"][0], checker.Equals, "MyValue", check.Commentf("Missing/bad header,out:%v", result.Combined()))