]> git.proxmox.com Git - ceph.git/blob - ceph/src/ceph-volume/ceph_volume/tests/functional/batch/tox.ini
f7969fe9bde07dbe444e7cfaf198bb59bdd9cfb1
[ceph.git] / ceph / src / ceph-volume / ceph_volume / tests / functional / batch / tox.ini
1 [tox]
2 envlist = centos8-{bluestore,filestore}-{single_type,single_type_dmcrypt},centos8-{bluestore,filestore}-{mixed_type,mixed_type_dmcrypt,mixed_type_explicit, mixed_type_dmcrypt_explicit}
3 skipsdist = True
4
5 [testenv]
6 deps = mock
7 whitelist_externals =
8 vagrant
9 bash
10 git
11 cp
12 sleep
13 passenv=*
14 setenv=
15 ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config
16 ANSIBLE_ACTION_PLUGINS = {envdir}/tmp/ceph-ansible/plugins/actions
17 ANSIBLE_STDOUT_CALLBACK = debug
18 ANSIBLE_RETRY_FILES_ENABLED = False
19 ANSIBLE_SSH_RETRIES = 5
20 VAGRANT_CWD = {changedir}
21 CEPH_VOLUME_DEBUG = 1
22 DEBIAN_FRONTEND=noninteractive
23 changedir=
24 centos8-filestore-single_type: {toxinidir}/centos8/filestore/single-type
25 centos8-filestore-single_type_dmcrypt: {toxinidir}/centos8/filestore/single-type-dmcrypt
26 centos8-filestore-mixed_type: {toxinidir}/centos8/filestore/mixed-type
27 centos8-filestore-mixed_type_dmcrypt: {toxinidir}/centos8/filestore/mixed-type-dmcrypt
28 centos8-filestore-mixed_type_explicit: {toxinidir}/centos8/filestore/mixed-type-explicit
29 centos8-filestore-mixed_type_dmcrypt_explicit: {toxinidir}/centos8/filestore/mixed-type-dmcrypt-explicit
30 centos8-bluestore-single_type: {toxinidir}/centos8/bluestore/single-type
31 centos8-bluestore-single_type_dmcrypt: {toxinidir}/centos8/bluestore/single-type-dmcrypt
32 centos8-bluestore-mixed_type: {toxinidir}/centos8/bluestore/mixed-type
33 centos8-bluestore-mixed_type_dmcrypt: {toxinidir}/centos8/bluestore/mixed-type-dmcrypt
34 centos8-bluestore-mixed_type_explicit: {toxinidir}/centos8/bluestore/mixed-type-explicit
35 centos8-bluestore-mixed_type_dmcrypt_explicit: {toxinidir}/centos8/bluestore/mixed-type-dmcrypt-explicit
36 commands=
37 git clone -b {env:CEPH_ANSIBLE_BRANCH:master} --single-branch {env:CEPH_ANSIBLE_CLONE:"https://github.com/ceph/ceph-ansible.git"} {envdir}/tmp/ceph-ansible
38 python -m pip install -r {envdir}/tmp/ceph-ansible/tests/requirements.txt
39
40 # bash {toxinidir}/../scripts/vagrant_up.sh {env:VAGRANT_UP_FLAGS:""} {posargs:--provider=virtualbox}
41 bash {toxinidir}/../scripts/vagrant_up.sh {posargs:--provider=virtualbox}
42 bash {toxinidir}/../scripts/generate_ssh_config.sh {changedir}
43
44 cp {toxinidir}/../playbooks/deploy.yml {envdir}/tmp/ceph-ansible
45
46 # individual scenario setup
47 ansible-playbook -vv -i {changedir}/hosts {changedir}/setup.yml
48
49 # use ceph-ansible to deploy a ceph cluster on the vms
50 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}"
51
52 # prepare nodes for testing with testinfra
53 ansible-playbook -vv -i {changedir}/hosts {envdir}/tmp/ceph-ansible/tests/functional/setup.yml
54
55 # test cluster state using testinfra
56 py.test -n 4 --sudo -v --connection=ansible --ssh-config={changedir}/vagrant_ssh_config --ansible-inventory={changedir}/hosts {toxinidir}/../tests
57
58 # reboot all vms - attempt
59 bash {toxinidir}/../scripts/vagrant_reload.sh {env:VAGRANT_UP_FLAGS:"--no-provision"} {posargs:--provider=virtualbox}
60
61 # after a reboot, osds may take about 20 seconds to come back up
62 sleep 30
63
64 # retest to ensure cluster came back up correctly after rebooting
65 py.test -n 4 --sudo -v --connection=ansible --ssh-config={changedir}/vagrant_ssh_config --ansible-inventory={changedir}/hosts {toxinidir}/../tests
66
67 # destroy an OSD, zap it's device and recreate it using it's ID
68 ansible-playbook -vv -i {changedir}/hosts {changedir}/test.yml
69
70 # retest to ensure cluster came back up correctly
71 py.test -n 4 --sudo -v --connection=ansible --ssh-config={changedir}/vagrant_ssh_config --ansible-inventory={changedir}/hosts {toxinidir}/../tests
72
73 # test zap OSDs by ID
74 ansible-playbook -vv -i {changedir}/hosts {changedir}/test_zap.yml
75
76 vagrant destroy {env:VAGRANT_DESTROY_FLAGS:"--force"}