integration: Ensure the client and server are running the same version.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2015-05-04 22:07:15 -07:00
parent 86bf53a504
commit 2ba8acbaca
1 changed files with 17 additions and 0 deletions

View File

@ -7,6 +7,23 @@ function teardown() {
stop_docker
}
# Ensure that the client and server are running the same version.
@test "api version" {
start_docker 1
run docker -H "${HOSTS[0]}" version
[ "$status" -eq 0 ]
# First line should contain the client version.
[[ "${lines[0]}" == "Client version: "* ]]
local cli_version=`echo "${lines[0]}" | cut -d':' -f2`
[[ "${output}" == *"Server version:$cli_version"* ]]
# Second line should be client API version.
[[ "${lines[1]}" == "Client API version: "* ]]
local cli_api_version=`echo "${lines[1]}" | cut -d':' -f2`
[[ "${output}" == *"Server API version:$cli_api_version"* ]]
}
@test "docker attach" {
start_docker 3
swarm_manage