From 2ba8acbaca7f46f5bd8909bca7fe532320b391e0 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Mon, 4 May 2015 22:07:15 -0700 Subject: [PATCH] integration: Ensure the client and server are running the same version. Signed-off-by: Andrea Luzzardi --- test/integration/api.bats | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/integration/api.bats b/test/integration/api.bats index 6401a57770..f3e3916db2 100644 --- a/test/integration/api.bats +++ b/test/integration/api.bats @@ -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