|
@@ -291,3 +291,42 @@ function test_overlay() {
|
|
|
|
|
|
dnet_cmd $(inst_id2port 2) network rm multihost
|
|
|
}
|
|
|
+
|
|
|
+function test_overlay_singlehost() {
|
|
|
+ dnet_suffix=$1
|
|
|
+ shift
|
|
|
+
|
|
|
+ echo $(docker ps)
|
|
|
+
|
|
|
+ start=1
|
|
|
+ end=3
|
|
|
+ # Setup overlay network and connect containers ot it
|
|
|
+ dnet_cmd $(inst_id2port 1) network create -d overlay multihost
|
|
|
+ for i in `seq ${start} ${end}`;
|
|
|
+ do
|
|
|
+ dnet_cmd $(inst_id2port 1) container create container_${i}
|
|
|
+ net_connect 1 container_${i} multihost
|
|
|
+ done
|
|
|
+
|
|
|
+ # Now test connectivity between all the containers using service names
|
|
|
+ for i in `seq ${start} ${end}`;
|
|
|
+ do
|
|
|
+ for j in `seq ${start} ${end}`;
|
|
|
+ do
|
|
|
+ if [ "$i" -eq "$j" ]; then
|
|
|
+ continue
|
|
|
+ fi
|
|
|
+ runc $(dnet_container_name 1 $dnet_suffix) $(get_sbox_id 1 container_${i}) \
|
|
|
+ "ping -c 1 container_$j"
|
|
|
+ done
|
|
|
+ done
|
|
|
+
|
|
|
+ # Teardown the container connections and the network
|
|
|
+ for i in `seq ${start} ${end}`;
|
|
|
+ do
|
|
|
+ net_disconnect 1 container_${i} multihost
|
|
|
+ dnet_cmd $(inst_id2port 1) container rm container_${i}
|
|
|
+ done
|
|
|
+
|
|
|
+ dnet_cmd $(inst_id2port 1) network rm multihost
|
|
|
+}
|