WORKDIR=$(mktemp -td tox.XXXXXXXXXX)
-# 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
-
-# restart libvirt services
-sudo service libvirt-bin restart
-sudo service libvirt-guests restart
+clear_libvirt_networks
+restart_libvirt_services
# the $SCENARIO var is injected by the job template. It maps
# to an actual, defined, tox environment
WORKDIR=$(mktemp -td tox.XXXXXXXXXX)
-# 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
-
-# restart libvirt services
-sudo service libvirt-bin restart
-sudo service libvirt-guests restart
+clear_libvirt_networks
+restart_libvirt_services
# the $SCENARIO var is injected by the job configuration. It maps
# to an actual, defined, tox environment
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
-
-# restart libvirt services
-sudo service libvirt-bin restart
-sudo service libvirt-guests restart
+clear_libvirt_networks
+restart_libvirt_services
# 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
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
-
-# restart libvirt services
-sudo service libvirt-bin restart
-sudo service libvirt-guests restart
+clear_libvirt_networks
+restart_libvirt_services
# 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
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
-
-# restart libvirt services
-sudo service libvirt-bin restart
-sudo service libvirt-guests restart
+clear_libvirt_networks
+restart_libvirt_services
INSTALLER_DEV_BRANCH=$INSTALLER_BRANCH CEPH_ANSIBLE_DEV_BRANCH=$CEPH_ANSIBLE_BRANCH $VENV/tox -rv -e=$SCENARIO --workdir=$WORKDIR -- --provider=libvirt