From: Andrew Schoen Date: Wed, 14 Feb 2018 19:29:43 +0000 (-0600) Subject: ceph-volume-scenario: a new job to run ceph-volume testing scenarios X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F957%2Fhead;p=ceph-build.git ceph-volume-scenario: a new job to run ceph-volume testing scenarios This job can be started manually and allows for ceph branch, ceph sha1, ceph-volume testing scenario and ceph-ansible branch to be entered as parameters. Signed-off-by: Andrew Schoen --- diff --git a/ceph-volume-scenario/build/build b/ceph-volume-scenario/build/build new file mode 100644 index 00000000..2bac2e59 --- /dev/null +++ b/ceph-volume-scenario/build/build @@ -0,0 +1,17 @@ +#!/bin/bash +set -ex +WORKDIR=$(mktemp -td tox.XXXXXXXXXX) + +# the following two methods exist in scripts/build_utils.sh +pkgs=( "tox" ) +install_python_packages "pkgs[@]" + + +delete_libvirt_vms +clear_libvirt_networks +restart_libvirt_services +update_vagrant_boxes + +cd src/ceph-volume/ceph_volume/tests/functional/$SUBCOMMAND + +CEPH_DEV_BRANCH=$CEPH_BRANCH CEPH_DEV_SHA1=$CEPH_SHA1 CEPH_ANSIBLE_BRANCH=$CEPH_ANSIBLE_BRANCH $VENV/tox --workdir=$WORKDIR -vre $SCENARIO -- --provider=libvirt diff --git a/ceph-volume-scenario/build/teardown b/ceph-volume-scenario/build/teardown new file mode 100644 index 00000000..9650719d --- /dev/null +++ b/ceph-volume-scenario/build/teardown @@ -0,0 +1,22 @@ +#!/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 + 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 + diff --git a/ceph-volume-scenario/config/definitions/ceph-volume-scenario.yml b/ceph-volume-scenario/config/definitions/ceph-volume-scenario.yml new file mode 100644 index 00000000..fb467a57 --- /dev/null +++ b/ceph-volume-scenario/config/definitions/ceph-volume-scenario.yml @@ -0,0 +1,64 @@ + +- job: + name: 'ceph-volume-scenario' + node: vagrant&&libvirt + concurrent: true + defaults: global + display-name: 'ceph-volume: individual scenario testing' + quiet-period: 5 + block-downstream: false + block-upstream: false + retry-count: 3 + properties: + - github: + url: https://github.com/ceph/ceph + logrotate: + daysToKeep: 15 + numToKeep: 30 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + + parameters: + - string: + name: SUBCOMMAND + description: "The subcommand in ceph-volume we are testing. (lvm or simple)" + default: "lvm" + - string: + name: SCENARIO + description: "A full scenario name for ceph-volume testing, like xenial-bluestore-create" + - string: + name: CEPH_BRANCH + description: "The ceph branch to test against" + default: "master" + - string: + name: CEPH_SHA1 + description: "The ceph sha1 to test against" + default: "latest" + - string: + name: CEPH_ANSIBLE_BRANCH + description: "The ceph-ansible branch to test against" + default: "master" + + scm: + - git: + url: https://github.com/ceph/ceph.git + branches: + - $CEPH_BRANCH + refspec: +refs/pull/*:refs/remotes/origin/pr/* + browser: auto + timeout: 20 + skip-tag: true + wipe-workspace: true + + builders: + - shell: + !include-raw: + - ../../../scripts/build_utils.sh + - ../../build/build + + publishers: + - postbuildscript: + script-only-if-succeeded: False + script-only-if-failed: True + builders: + - shell: !include-raw ../../build/teardown