mirror of https://github.com/docker/docs.git
Merge pull request #1998 from dongluochen/HostnameUpdate
Docker changes hostname/domain in container config
This commit is contained in:
commit
2de0f86b5f
|
@ -8,6 +8,12 @@ function teardown() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "docker inspect" {
|
@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
|
start_docker_with_busybox 2
|
||||||
swarm_manage
|
swarm_manage
|
||||||
# run container
|
# run container
|
||||||
|
@ -23,11 +29,16 @@ function teardown() {
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[[ "${output}" == *"NetworkSettings"* ]]
|
[[ "${output}" == *"NetworkSettings"* ]]
|
||||||
[[ "${output}" == *"TEST=true"* ]]
|
[[ "${output}" == *"TEST=true"* ]]
|
||||||
[[ "${output}" == *'"Hostname": "hostname"'* ]]
|
|
||||||
[[ "${output}" == *'"Domainname": "test"'* ]]
|
|
||||||
# the specific information of swarm node
|
# the specific information of swarm node
|
||||||
[[ "${output}" == *'"Node": {'* ]]
|
[[ "${output}" == *'"Node": {'* ]]
|
||||||
[[ "${output}" == *'"Name": "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" {
|
@test "docker inspect --format" {
|
||||||
|
|
|
@ -10,6 +10,12 @@ function teardown() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "mesos - docker inspect" {
|
@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_docker_with_busybox 2
|
||||||
start_mesos
|
start_mesos
|
||||||
swarm_manage --cluster-driver mesos-experimental 127.0.0.1:$MESOS_MASTER_PORT
|
swarm_manage --cluster-driver mesos-experimental 127.0.0.1:$MESOS_MASTER_PORT
|
||||||
|
@ -27,10 +33,15 @@ function teardown() {
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[[ "${output}" == *"NetworkSettings"* ]]
|
[[ "${output}" == *"NetworkSettings"* ]]
|
||||||
[[ "${output}" == *"TEST=true"* ]]
|
[[ "${output}" == *"TEST=true"* ]]
|
||||||
[[ "${output}" == *'"Hostname": "hostname"'* ]]
|
|
||||||
[[ "${output}" == *'"Domainname": "test"'* ]]
|
|
||||||
# the specific information of swarm node
|
# the specific information of swarm node
|
||||||
[[ "${output}" == *'"Node": {'* ]]
|
[[ "${output}" == *'"Node": {'* ]]
|
||||||
[[ "${output}" == *'"Name": "node-'* ]]
|
[[ "${output}" == *'"Name": "node-'* ]]
|
||||||
|
if [[ "${version}" == "old" ]]; then
|
||||||
|
[[ "${output}" == *'"Hostname": "hostname"'* ]]
|
||||||
|
[[ "${output}" == *'"Domainname": "test"'* ]]
|
||||||
|
else
|
||||||
|
[[ "${output}" == *'"Hostname": "hostname.test"'* ]]
|
||||||
|
[[ "${output}" == *'"Domainname": ""'* ]]
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue