Files
docker-docs/test/integration/api_version.bats
Victor Vieux 00e4e1c573 fix api_version test
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-06-30 11:48:08 -07:00

32 lines
774 B
Bash

#!/usr/bin/env bats
load helpers
function teardown() {
stop_docker
}
# Ensure that the client and server are running the same version.
#
# If this test is failing, it means that your test environment is misconfigured
# and your host CLI version differs from DOCKER_VERSION.
@test "api version" {
start_docker 1
# Get version output
out=$(docker -H "${HOSTS[0]}" version)
# Check client version
run bash -c "echo '$out' | grep -i version | grep -v Go | grep -v API"
[ "$status" -eq 0 ]
[[ $(echo "${lines[0]}" | cut -d':' -f2) == $(echo "${lines[1]}" | cut -d':' -f2) ]]
# Check API version
run bash -c "echo '$out' | grep -i version | grep API"
[ "$status" -eq 0 ]
[[ $(echo "${lines[0]}" | cut -d':' -f2) == $(echo "${lines[1]}" | cut -d':' -f2) ]]
}