From: Andrew Schoen Date: Mon, 26 Mar 2018 15:04:04 +0000 (-0500) Subject: use teardown_vagrant_tests on jobs that use vagrant X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F993%2Fhead;p=ceph-build.git use teardown_vagrant_tests on jobs that use vagrant Signed-off-by: Andrew Schoen --- diff --git a/ceph-ansible-nightly/build/teardown b/ceph-ansible-nightly/build/teardown index 7f2137f48..350248e52 100644 --- a/ceph-ansible-nightly/build/teardown +++ b/ceph-ansible-nightly/build/teardown @@ -1,22 +1,6 @@ #!/bin/bash -# There has to be a better way to do this than this script which just looks -# for every Vagrantfile in scenarios and then just destroys whatever is left. cd $WORKSPACE/tests -scenarios=$(find . | grep Vagrantfile | xargs dirname) - -for scenario in $scenarios; do - cd $scenario - # collect all ceph logs from all test nodes - collect_ceph_logs all - vagrant destroy -f - cd - -done - -# 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 +# the method exists in scripts/build_utils.sh +teardown_vagrant_tests diff --git a/ceph-ansible-prs/build/teardown b/ceph-ansible-prs/build/teardown index 09d3862ff..350248e52 100644 --- a/ceph-ansible-prs/build/teardown +++ b/ceph-ansible-prs/build/teardown @@ -1,22 +1,6 @@ #!/bin/bash -# There has to be a better way to do this than this script which just looks -# for every Vagrantfile in scenarios and then just destroys whatever is left. cd $WORKSPACE/tests -scenarios=$(find . -name Vagrantfile | xargs dirname) - -for scenario in $scenarios; do - pushd $scenario - # collect all ceph logs from all test nodes - collect_ceph_logs all - vagrant destroy -f - popd -done - -# 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 +# the method exists in scripts/build_utils.sh +teardown_vagrant_tests diff --git a/ceph-ansible-scenario/build/teardown b/ceph-ansible-scenario/build/teardown index 7f2137f48..350248e52 100644 --- a/ceph-ansible-scenario/build/teardown +++ b/ceph-ansible-scenario/build/teardown @@ -1,22 +1,6 @@ #!/bin/bash -# There has to be a better way to do this than this script which just looks -# for every Vagrantfile in scenarios and then just destroys whatever is left. cd $WORKSPACE/tests -scenarios=$(find . | grep Vagrantfile | xargs dirname) - -for scenario in $scenarios; do - cd $scenario - # collect all ceph logs from all test nodes - collect_ceph_logs all - vagrant destroy -f - cd - -done - -# 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 +# the method exists in scripts/build_utils.sh +teardown_vagrant_tests diff --git a/ceph-volume-ansible-prs/build/teardown b/ceph-volume-ansible-prs/build/teardown index 6eb73ad85..987bf263e 100644 --- a/ceph-volume-ansible-prs/build/teardown +++ b/ceph-volume-ansible-prs/build/teardown @@ -10,20 +10,5 @@ GITHUB_STATUS_STATE="failure" $VENV/github-status create cd $WORKSPACE/src/ceph-volume/tests/functional -scenarios=$(find . | grep Vagrantfile | xargs dirname) - -for scenario in $scenarios; do - cd $scenario - # collect all ceph logs from all test nodes - collect_ceph_logs all - vagrant destroy -f - cd - -done - -# 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 - +# the method exists in scripts/build_utils.sh +teardown_vagrant_tests diff --git a/ceph-volume-nightly/build/teardown b/ceph-volume-nightly/build/teardown index 6ba0b950b..ce026872d 100644 --- a/ceph-volume-nightly/build/teardown +++ b/ceph-volume-nightly/build/teardown @@ -7,18 +7,5 @@ cd $WORKSPACE/src/ceph-volume/ceph_volume/tests/functional scenarios=$(find . | grep vagrant_ssh_config | xargs dirname) -for scenario in $scenarios; do - cd $scenario - # collect all ceph logs from all test nodes - collect_ceph_logs all - vagrant destroy -f - cd - -done - -# 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 - +# the method exists in scripts/build_utils.sh +teardown_vagrant_tests diff --git a/ceph-volume-scenario/build/teardown b/ceph-volume-scenario/build/teardown index 1e9180a62..a5c26da80 100644 --- a/ceph-volume-scenario/build/teardown +++ b/ceph-volume-scenario/build/teardown @@ -1,24 +1,6 @@ #!/bin/bash -# There has to be a better way to do this than this script which just looks -# for every Vagrantfile in scenarios and then just destroys whatever is left. - cd $WORKSPACE/src/ceph-volume/ceph_volume/tests/functional -scenarios=$(find . | grep Vagrantfile | xargs dirname) - -for scenario in $scenarios; do - cd $scenario - # collect all ceph logs from all test nodes - collect_ceph_logs all - vagrant destroy -f - cd - -done - -# 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 - +# the method exists in scripts/build_utils.sh +teardown_vagrant_tests