]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-volume-scenario: a new job to run ceph-volume testing scenarios 957/head
authorAndrew Schoen <aschoen@redhat.com>
Wed, 14 Feb 2018 19:29:43 +0000 (13:29 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Wed, 14 Feb 2018 19:29:43 +0000 (13:29 -0600)
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 <aschoen@redhat.com>
ceph-volume-scenario/build/build [new file with mode: 0644]
ceph-volume-scenario/build/teardown [new file with mode: 0644]
ceph-volume-scenario/config/definitions/ceph-volume-scenario.yml [new file with mode: 0644]

diff --git a/ceph-volume-scenario/build/build b/ceph-volume-scenario/build/build
new file mode 100644 (file)
index 0000000..2bac2e5
--- /dev/null
@@ -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 (file)
index 0000000..9650719
--- /dev/null
@@ -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 (file)
index 0000000..fb467a5
--- /dev/null
@@ -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