Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Smoke-test CNI arp update
Browse files Browse the repository at this point in the history
  • Loading branch information
bboreham committed May 25, 2016
1 parent ede0004 commit f695b3f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/830_cni_plugin_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ start_suite "Test CNI plugin"

cni_connect() {
pid=$(container_pid $1 $2)
run_on $1 CNI_VERSION=1 CNI_COMMAND=ADD CNI_CONTAINERID=c1 CNI_IFNAME=eth0 \
id=$(docker_on $1 inspect -f '{{.Id}}' $2)
run_on $1 CNI_VERSION=1 CNI_COMMAND=ADD CNI_CONTAINERID=$id CNI_IFNAME=eth0 \
CNI_NETNS=/proc/$pid/ns/net CNI_PATH=/opt/cni/bin /opt/cni/bin/weave-net
}

Expand Down Expand Up @@ -42,4 +43,16 @@ C2IP=$(container_ip $HOST1 c2)
assert_raises "exec_on $HOST1 c1 $PING $C2IP"
assert_raises "exec_on $HOST1 c2 $PING $C1IP"

# Now remove and start a new container to see if IP address re-use breaks things
docker_on $HOST1 rm -f c2
sleep 1

docker_on $HOST1 run --net=none --name=c3 -dt $SMALL_IMAGE /bin/sh

cni_connect $HOST1 c3 <<EOF
{ "name": "weave", "type": "weave-net" }
EOF

assert_raises "exec_on $HOST1 c1 $PING $C2IP"

end_suite

0 comments on commit f695b3f

Please sign in to comment.