Fix IT test breakages

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>
This commit is contained in:
Jana Radhakrishnan 2016-04-10 01:22:59 -07:00
parent b0d046a1af
commit 15237db7d6
2 changed files with 10 additions and 10 deletions

View File

@ -291,12 +291,12 @@ function test_single_network_connectivity() {
dnet_cmd $(inst_id2port 1) container create container_1
# connects to internal network, confirm it can't conmunicate with outside world
net_connect 1 container_1 internal
run runc $(dnet_container_name 1 bridge) $(get_sbox_id 1 container_1) "ping -c 1 www.google.com"
run runc $(dnet_container_name 1 bridge) $(get_sbox_id 1 container_1) "ping -c 1 8.8.8.8"
[[ "$output" == *"1 packets transmitted, 0 packets received, 100% packet loss"* ]]
net_disconnect 1 container_1 internal
# connects to bridge network, confirm it can conmunicate with outside world
net_connect 1 container_1 bridge
runc $(dnet_container_name 1 bridge) $(get_sbox_id 1 container_1) "ping -c 1 www.google.com"
runc $(dnet_container_name 1 bridge) $(get_sbox_id 1 container_1) "ping -c 1 8.8.8.8"
net_disconnect 1 container_1 bridge
dnet_cmd $(inst_id2port 1) container rm container_1
# test conmunications within internal network

View File

@ -25,6 +25,11 @@ load helpers
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
@ -32,8 +37,8 @@ load helpers
end=3
for i in `seq ${start} ${end}`;
do
dnet_cmd $(inst_id2port $i) container create container_${i}
net_connect ${i} container_${i} multihost
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"
@ -51,11 +56,6 @@ load helpers
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
exit 1
fi
}
@test "Test overlay network internal network with consul" {
skip_for_circleci
test_overlay consul internal
}