From: Andrew Schoen Date: Fri, 28 Apr 2017 18:03:27 +0000 (-0500) Subject: ceph-docker-nightly: remove old libvirt networks before running tests X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=aa229919d02135465fe9e839c1874d39e501052a;p=ceph-build.git ceph-docker-nightly: remove old libvirt networks before running tests Signed-off-by: Andrew Schoen --- diff --git a/ceph-docker-nightly/build/build b/ceph-docker-nightly/build/build index 5a88bf1b..1e9e12a3 100644 --- a/ceph-docker-nightly/build/build +++ b/ceph-docker-nightly/build/build @@ -15,6 +15,13 @@ sudo gpasswd -a ${USER} docker sudo systemctl restart docker newgrp docker +# Sometimes, networks may linger around, so we must ensure they are killed: +networks=`sudo virsh net-list --all | grep active | egrep -v "(default|libvirt)" | cut -d ' ' -f 2` +for network in $networks; do + sudo virsh net-destroy $network || true + sudo virsh net-undefine $network || true +done + # adding groups on the fly doesn't guarantee their availability # so we must use `sg` to execute the tests as part of the docker group to avoid # 'Permission Denied` when tryin to talk over the socket