add coverage to plugin
This commit is contained in:
1 parent
254be128b0
commit
718e93bd23
5 files changed
+27
-10
No files matched your search
@@ -4,12 +4,19 @@
|
||||
|
||||
start_suite "Test CNI plugin"
|
||||
|
||||
coverage_args() {
|
||||
# no coverage reporting for now; but when the plugin binary has
|
||||
# been built for coverage reporting we need to prevent it from
|
||||
# complaining about the non-coverage args.
|
||||
[ -n "$COVERAGE" ] && echo "--"
|
||||
}
|
||||
|
||||
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 <<EOF
|
||||
weaveworks/plugin:latest $(coverage_args) --cni-net <<EOF
|
||||
{
|
||||
"name": "weave",
|
||||
"type": "weave-net"
|
||||
|
||||
+4
-6
@@ -127,12 +127,10 @@ stop_router_on() {
|
||||
# we don't invoke `weave stop-router` here because that removes
|
||||
# the weave container, which means we a) can't grab coverage
|
||||
# stats, and b) can't inspect the logs when tests fail.
|
||||
docker_on $host stop weave 1>/dev/null 2>&1 || true
|
||||
docker_on $host stop weaveproxy 1>/dev/null 2>&1 || true
|
||||
if [ -n "$COVERAGE" ] ; then
|
||||
collect_coverage $host weave
|
||||
collect_coverage $host weaveproxy
|
||||
fi
|
||||
for C in weaveplugin weaveproxy weave ; do
|
||||
docker_on $host stop $C 1>/dev/null 2>&1 || true
|
||||
[ -n "$COVERAGE" ] && collect_coverage $host $C
|
||||
done
|
||||
}
|
||||
|
||||
exec_on() {
|
||||
|
||||
Reference in new issue
Block a user