From 951c2d1cca61b45a4b413c24b8e40b75031d6653 Mon Sep 17 00:00:00 2001 From: Dong Chen Date: Fri, 18 Mar 2016 16:18:01 -0700 Subject: [PATCH] Docker engine updates hostname/domainname. Signed-off-by: Dong Chen --- test/integration/api/inspect.bats | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/test/integration/api/inspect.bats b/test/integration/api/inspect.bats index e8dfbc334e..a4882686ed 100644 --- a/test/integration/api/inspect.bats +++ b/test/integration/api/inspect.bats @@ -8,6 +8,12 @@ function teardown() { } @test "docker inspect" { + local version="new" + run docker --version + if [[ "${output}" == "Docker version 1.9"* || "${output}" == "Docker version 1.10"* ]]; then + version="old" + fi + start_docker_with_busybox 2 swarm_manage # run container @@ -23,11 +29,16 @@ function teardown() { [ "$status" -eq 0 ] [[ "${output}" == *"NetworkSettings"* ]] [[ "${output}" == *"TEST=true"* ]] - [[ "${output}" == *'"Hostname": "hostname"'* ]] - [[ "${output}" == *'"Domainname": "test"'* ]] # the specific information of swarm node [[ "${output}" == *'"Node": {'* ]] [[ "${output}" == *'"Name": "node-'* ]] + if [[ "${version}" == "old" ]]; then + [[ "${output}" == *'"Hostname": "hostname"'* ]] + [[ "${output}" == *'"Domainname": "test"'* ]] + else + [[ "${output}" == *'"Hostname": "hostname.test"'* ]] + [[ "${output}" == *'"Domainname": ""'* ]] + fi } @test "docker inspect --format" {