From ee5e94fd631d53967a31b0813f18bcbd6c7f89c5 Mon Sep 17 00:00:00 2001
From: Dong Chen <dongluo.chen@docker.com>
Date: Fri, 18 Mar 2016 17:14:00 -0700
Subject: [PATCH] Update mesos test.

Signed-off-by: Dong Chen <dongluo.chen@docker.com>
---
 test/integration/mesos/api/inspect.bats | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/test/integration/mesos/api/inspect.bats b/test/integration/mesos/api/inspect.bats
index de85fb3074..858299bc42 100644
--- a/test/integration/mesos/api/inspect.bats
+++ b/test/integration/mesos/api/inspect.bats
@@ -10,6 +10,12 @@ function teardown() {
 }
 
 @test "mesos - 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
 	start_mesos
 	swarm_manage --cluster-driver mesos-experimental 127.0.0.1:$MESOS_MASTER_PORT
@@ -27,10 +33,15 @@ 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
 }