From 7fdc787076ab1154e25b4982baf985d550439c48 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Fri, 9 Feb 2018 10:38:52 -0600 Subject: [PATCH] adds nightly functional testing for ceph-volume This will run all our PR tests against the luminous and master branch of ceph nightly. Signed-off-by: Andrew Schoen --- ceph-volume-nightly/build/build | 17 ++++ ceph-volume-nightly/build/teardown | 22 +++++ .../definitions/ceph-volume-nightly.yml | 99 +++++++++++++++++++ 3 files changed, 138 insertions(+) create mode 100644 ceph-volume-nightly/build/build create mode 100644 ceph-volume-nightly/build/teardown create mode 100644 ceph-volume-nightly/config/definitions/ceph-volume-nightly.yml diff --git a/ceph-volume-nightly/build/build b/ceph-volume-nightly/build/build new file mode 100644 index 00000000..a93f7359 --- /dev/null +++ b/ceph-volume-nightly/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 $VENV/tox --workdir=$WORKDIR -vre $DISTRO-$OBJECTSTORE-$SCENARIO -- --provider=libvirt diff --git a/ceph-volume-nightly/build/teardown b/ceph-volume-nightly/build/teardown new file mode 100644 index 00000000..9650719d --- /dev/null +++ b/ceph-volume-nightly/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-nightly/config/definitions/ceph-volume-nightly.yml b/ceph-volume-nightly/config/definitions/ceph-volume-nightly.yml new file mode 100644 index 00000000..7e91bc52 --- /dev/null +++ b/ceph-volume-nightly/config/definitions/ceph-volume-nightly.yml @@ -0,0 +1,99 @@ +- project: + name: ceph-volume-nightly-lvm + distro: + - xenial + - centos7 + objectstore: + - bluestore + - filestore + scenario: + - create + - dmcrypt + subcommand: + - lvm + ceph_branch: + - master + - luminous + + jobs: + - 'ceph-volume-nightly-{ceph_branch}-{subcommand}-{distro}-{objectstore}-{scenario}' + +- project: + name: ceph-volume-nightly-simple + distro: + - xenial + - centos7 + objectstore: + - bluestore + - filestore + scenario: + - activate + - dmcrypt_luks + - dmcrypt_plain + subcommand: + - simple + ceph_branch: + - master + - luminous + + jobs: + - 'ceph-volume-nightly-{ceph_branch}-{subcommand}-{distro}-{objectstore}-{scenario}' + + +- job-template: + name: 'ceph-volume-nightly-{ceph_branch}-{subcommand}-{distro}-{objectstore}-{scenario}' + display-name: 'ceph-volume {ceph_branch} {subcommand}: [{distro}-{objectstore}-{scenario}]' + node: vagrant&&libvirt + concurrent: true + project-type: freestyle + defaults: global + quiet-period: 5 + block-downstream: false + block-upstream: false + properties: + - github: + url: https://github.com/ceph/ceph + discard-old-builds: true + logrotate: + daysToKeep: 30 + + triggers: + - timed: '@daily' + + scm: + - git: + url: https://github.com/ceph/ceph.git + branches: + - ${{ceph_branch}} + browser: auto + timeout: 20 + skip-tag: true + wipe-workspace: false + + builders: + - inject: + properties-content: | + SCENARIO={scenario} + DISTRO={distro} + OBJECTSTORE={objectstore} + SUBCOMMAND={subcommand} + CEPH_BRANCH={ceph_branch} + - shell: + !include-raw-escape: + - ../../../scripts/build_utils.sh + - ../../build/build + + wrappers: + - inject-passwords: + global: true + mask-password-params: true + + publishers: + - postbuildscript: + script-only-if-succeeded: False + script-only-if-failed: True + builders: + - shell: + !include-raw-escape: + - ../../../scripts/build_utils.sh + - ../../build/teardown -- 2.39.5