@@ -13,8 +13,8 @@ cni_connect() {
1313
1414run_on $HOST1 sudo mkdir -p /opt/cni/bin
1515# setup-cni is a subset of 'weave setup', without doing any 'docker pull's
16- weave_on $HOST1 setup-cni
17- weave_on $HOST1 launch
16+ weave_on $HOST1 setup-cni --log-level=debug
17+ weave_on $HOST1 launch --log-level=debug
1818
1919C0=$( docker_on $HOST1 run --net=none --name=c0 --privileged -dt $SMALL_IMAGE /bin/sh)
2020C1=$( docker_on $HOST1 run --net=none --name=c1 --privileged -dt $SMALL_IMAGE /bin/sh)
@@ -70,16 +70,32 @@ C0IP=$(container_ip $HOST1 c0)
7070C1IP=$( container_ip $HOST1 c1)
7171C2IP=$( container_ip $HOST1 c2)
7272
73- echo $C0IP
74- echo $C1IP
75- echo $C2IP
73+ assert_raises " [ " 10.32.1.30" == $C0IP ]"
74+ assert_raises " [ " 10.32.1.40" == $C1IP ]"
75+ assert_raises " [ " 10.32.1.42" == $C2IP ]"
76+
77+ BRIP=$( container_ip $HOST1 weave:expose)
78+ # Check the bridge IP is different from the container IPs
79+ assert_raises " [ $BRIP != $C0IP ]"
80+ assert_raises " [ $BRIP != $C1IP ]"
81+ assert_raises " [ $BRIP != $C2IP ]"
82+
83+ # Containers should be able to reach one another
84+ assert_raises " exec_on $HOST1 c0 $PING $C1IP "
85+ assert_raises " exec_on $HOST1 c1 $PING $C2IP "
86+ assert_raises " exec_on $HOST1 c2 $PING $C1IP "
87+
88+ # Containers should not have a default route to the world
89+ assert_raises " exec_on $HOST1 c0 sh -c '! $PING 8.8.8.8'"
90+ assert_raises " exec_on $HOST1 c1 sh -c '! $PING 8.8.8.8'"
91+ assert_raises " exec_on $HOST1 c2 sh -c '! $PING 8.8.8.8'"
7692
7793# Ensure existing containers can reclaim their IP addresses after CNI has been used -- see #2548
7894stop_weave_on $HOST1
7995
8096# Ensure no warning is printed to the standard error:
81- ACTUAL_OUTPUT=$( CHECKPOINT_DISABLE=" $CHECKPOINT_DISABLE " $WEAVE launch 2>&1 )
82- EXPECTED_OUTPUT=$( docker inspect --format=" {{.Id}}" weave)
97+ ACTUAL_OUTPUT=$( CHECKPOINT_DISABLE=" $CHECKPOINT_DISABLE " DOCKER_HOST=tcp:// $HOST1 : $DOCKER_PORT $WEAVE launch 2>&1 )
98+ EXPECTED_OUTPUT=$( $SSH $HOST1 docker inspect --format=" {{.Id}}" weave)
8399
84100assert_raises " [ $EXPECTED_OUTPUT == $ACTUAL_OUTPUT ]"
85101
0 commit comments