From b83a129e4551f7bd79b37490322040da2ca28544 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Fri, 28 Apr 2017 13:04:00 -0500 Subject: [PATCH] ceph-docker-prs: remove old libvirt networks before running tests Signed-off-by: Andrew Schoen --- ceph-docker-prs/build/build | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ceph-docker-prs/build/build b/ceph-docker-prs/build/build index 5a88bf1b..1e9e12a3 100644 --- a/ceph-docker-prs/build/build +++ b/ceph-docker-prs/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 -- 2.39.5