]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-installer-tests: remove old libvirt networks before running tests
authorAndrew Schoen <aschoen@redhat.com>
Fri, 28 Apr 2017 18:04:35 +0000 (13:04 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Tue, 2 May 2017 18:57:44 +0000 (13:57 -0500)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
ceph-installer-tests/build/build

index 413c71a9435941510c917cb64a69ffd61a872589..66f326cd0e329b53c0752c8a7fa24ebd2d5981b8 100644 (file)
@@ -6,4 +6,11 @@ WORKDIR=$(mktemp -td tox.XXXXXXXXXX)
 
 cd $WORKSPACE/tests/functional
 
+# 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
+
 INSTALLER_DEV_BRANCH=$INSTALLER_BRANCH CEPH_ANSIBLE_DEV_BRANCH=$CEPH_ANSIBLE_BRANCH $VENV/tox -rv -e=$SCENARIO --workdir=$WORKDIR -- --provider=libvirt