]> git.proxmox.com Git - ceph.git/blob - ceph/src/ceph-volume/ceph_volume/tests/functional/lvm/tox.ini
import ceph nautilus 14.2.2
[ceph.git] / ceph / src / ceph-volume / ceph_volume / tests / functional / lvm / tox.ini
1 [tox]
2 envlist = {centos7,xenial}-{filestore,bluestore}-{create,prepare_activate,dmcrypt}
3 skipsdist = True
4
5 [testenv]
6 whitelist_externals =
7 vagrant
8 bash
9 git
10 cp
11 sleep
12 passenv=*
13 setenv=
14 ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config
15 ANSIBLE_ACTION_PLUGINS = {envdir}/tmp/ceph-ansible/plugins/actions
16 ANSIBLE_STDOUT_CALLBACK = debug
17 ANSIBLE_RETRY_FILES_ENABLED = False
18 ANSIBLE_SSH_RETRIES = 5
19 VAGRANT_CWD = {changedir}
20 CEPH_VOLUME_DEBUG = 1
21 changedir=
22 # plain/unencrypted
23 centos7-filestore-create: {toxinidir}/centos7/filestore/create
24 centos7-bluestore-create: {toxinidir}/centos7/bluestore/create
25 xenial-filestore-create: {toxinidir}/xenial/filestore/create
26 xenial-bluestore-create: {toxinidir}/xenial/bluestore/create
27 # dmcrypt
28 centos7-filestore-dmcrypt: {toxinidir}/centos7/filestore/dmcrypt
29 centos7-bluestore-dmcrypt: {toxinidir}/centos7/bluestore/dmcrypt
30 xenial-filestore-dmcrypt: {toxinidir}/xenial/filestore/dmcrypt
31 xenial-bluestore-dmcrypt: {toxinidir}/xenial/bluestore/dmcrypt
32 # TODO: these are placeholders for now, eventually we want to
33 # test the prepare/activate workflow of ceph-volume as well
34 xenial-filestore-prepare_activate: {toxinidir}/xenial/filestore/prepare_activate
35 xenial-bluestore-prepare_activate: {toxinidir}/xenial/bluestore/prepare_activate
36 centos7-filestore-prepare_activate: {toxinidir}/xenial/filestore/prepare_activate
37 centos7-bluestore-prepare_activate: {toxinidir}/xenial/bluestore/prepare_activate
38 commands=
39 git clone -b {env:CEPH_ANSIBLE_BRANCH:master} --single-branch https://github.com/ceph/ceph-ansible.git {envdir}/tmp/ceph-ansible
40 pip install -r {envdir}/tmp/ceph-ansible/tests/requirements.txt
41
42 bash {toxinidir}/../scripts/vagrant_up.sh {env:VAGRANT_UP_FLAGS:"--no-provision"} {posargs:--provider=virtualbox}
43 bash {toxinidir}/../scripts/generate_ssh_config.sh {changedir}
44
45 # create logical volumes to test with on the vms
46 ansible-playbook -vv -i {changedir}/hosts {envdir}/tmp/ceph-ansible/tests/functional/lvm_setup.yml
47
48 # ad-hoc/local test setup for lvm
49 ansible-playbook -vv -i {changedir}/hosts {changedir}/setup.yml
50
51 cp {toxinidir}/../playbooks/deploy.yml {envdir}/tmp/ceph-ansible
52
53 # use ceph-ansible to deploy a ceph cluster on the vms
54 ansible-playbook -vv -i {changedir}/hosts {envdir}/tmp/ceph-ansible/deploy.yml --extra-vars "fetch_directory={changedir}/fetch ceph_dev_branch={env:CEPH_DEV_BRANCH:master} ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} toxinidir={toxinidir}"
55
56 # prepare nodes for testing with testinfra
57 ansible-playbook -vv -i {changedir}/hosts {envdir}/tmp/ceph-ansible/tests/functional/setup.yml
58
59 # test cluster state using testinfra
60 py.test -n 4 --sudo -v --connection=ansible --ssh-config={changedir}/vagrant_ssh_config --ansible-inventory={changedir}/hosts {toxinidir}/../tests
61
62 # reboot all vms - attempt
63 bash {toxinidir}/../scripts/vagrant_reload.sh {env:VAGRANT_UP_FLAGS:"--no-provision"} {posargs:--provider=virtualbox}
64
65 # after a reboot, osds may take about 20 seconds to come back up
66 sleep 30
67
68 # retest to ensure cluster came back up correctly after rebooting
69 py.test -n 4 --sudo -v --connection=ansible --ssh-config={changedir}/vagrant_ssh_config --ansible-inventory={changedir}/hosts {toxinidir}/../tests
70
71 # destroy an OSD, zap it's device and recreate it using it's ID
72 ansible-playbook -vv -i {changedir}/hosts {changedir}/test.yml
73
74 # retest to ensure cluster came back up correctly
75 py.test -n 4 --sudo -v --connection=ansible --ssh-config={changedir}/vagrant_ssh_config --ansible-inventory={changedir}/hosts {toxinidir}/../tests
76
77 vagrant destroy {env:VAGRANT_DESTROY_FLAGS:"--force"}