From c8ca295cda09723ccc431d4935bec6f1ed064b79 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Thu, 17 Mar 2016 18:07:34 +0000 Subject: [PATCH] CNI plugin smoke test --- test/830_cni_plugin_test.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 test/830_cni_plugin_test.sh 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