diff --git a/test/830_cni_plugin_test.sh b/test/830_cni_plugin_test.sh new file mode 100755 index 00000000..63b07778 --- /dev/null +++ b/test/830_cni_plugin_test.sh @@ -0,0 +1,35 @@ +#! /bin/bash + +. ./config.sh + +start_suite "Test CNI plugin" + +cni_connect() { + pid=$(container_pid $1 $2) + docker_on $1 run --rm --privileged --net=host --pid=host -i \ + -e CNI_VERSION=1 -e CNI_COMMAND=ADD -e CNI_CONTAINERID=c1 \ + -e CNI_NETNS=/proc/$pid/ns/net -e CNI_IFNAME=eth0 -e CNI_PATH=/opt/cni/bin \ + weaveworks/plugin:latest --cni-net </dev/null +cni_connect $HOST1 c2 >/dev/null + +C1IP=$(container_ip $HOST1 c1) +C2IP=$(container_ip $HOST1 c2) + +assert_raises "exec_on $HOST1 c1 $PING $C2IP" +assert_raises "exec_on $HOST1 c2 $PING $C1IP" + +end_suite