mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
15237db7d6
With DNS resolution happening within the container namespace test should not try to ping a DNS name and expect a packet loss message. It will only show up as a DNS name resolution failure. Changed the bridge internal test to test for a well known IP address. Also rearranged the overlay internal tests so that it gets to run before the dnet container is removed which was happening in previous tests. Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
61 lines
1.8 KiB
Bash
61 lines
1.8 KiB
Bash
# -*- mode: sh -*-
|
|
#!/usr/bin/env bats
|
|
|
|
load helpers
|
|
|
|
@test "Test overlay network with consul" {
|
|
skip_for_circleci
|
|
test_overlay consul
|
|
}
|
|
|
|
@test "Test overlay network singlehost with consul" {
|
|
skip_for_circleci
|
|
test_overlay_singlehost consul
|
|
}
|
|
|
|
@test "Test overlay network with dnet restart" {
|
|
skip_for_circleci
|
|
test_overlay consul skip_rm
|
|
docker restart dnet-1-consul
|
|
wait_for_dnet $(inst_id2port 1) dnet-1-consul
|
|
docker restart dnet-2-consul
|
|
wait_for_dnet $(inst_id2port 2) dnet-2-consul
|
|
docker restart dnet-3-consul
|
|
wait_for_dnet $(inst_id2port 3) dnet-3-consul
|
|
test_overlay consul skip_add
|
|
}
|
|
|
|
@test "Test overlay network internal network with consul" {
|
|
skip_for_circleci
|
|
test_overlay consul internal
|
|
}
|
|
|
|
@test "Test overlay network with dnet ungraceful shutdown" {
|
|
skip_for_circleci
|
|
dnet_cmd $(inst_id2port 1) network create -d overlay multihost
|
|
start=1
|
|
end=3
|
|
for i in `seq ${start} ${end}`;
|
|
do
|
|
dnet_cmd $(inst_id2port $i) container create container_${i}
|
|
net_connect ${i} container_${i} multihost
|
|
done
|
|
|
|
hrun runc $(dnet_container_name 1 consul) $(get_sbox_id 1 container_1) "ifconfig eth0"
|
|
container_1_ip=$(echo ${output} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
|
|
|
|
# ungracefully kill dnet-1-consul container
|
|
docker rm -f dnet-1-consul
|
|
|
|
# forcefully unpublish the service from dnet2 when dnet1 is dead.
|
|
dnet_cmd $(inst_id2port 2) service unpublish -f container_1.multihost
|
|
dnet_cmd $(inst_id2port 2) container create container_1
|
|
net_connect 2 container_1 multihost
|
|
|
|
hrun runc $(dnet_container_name 2 consul) $(get_sbox_id 2 container_1) "ifconfig eth0"
|
|
container_1_new_ip=$(echo ${output} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
|
|
|
|
if [ "$container_1_ip" != "$container_1_new_ip" ]; then
|
|
exit 1
|
|
fi
|
|
}
|