]>
Commit | Line | Data |
---|---|---|
1adf2230 | 1 | [tox] |
9f95a23c | 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} |
1adf2230 AA |
3 | skipsdist = True |
4 | ||
5 | [testenv] | |
92f5a8d4 | 6 | deps = mock |
1adf2230 AA |
7 | whitelist_externals = |
8 | vagrant | |
9 | bash | |
10 | git | |
11 | cp | |
9f95a23c | 12 | sleep |
1adf2230 AA |
13 | passenv=* |
14 | setenv= | |
6d8e3169 FG |
15 | ANSIBLE_CONFIG = {envdir}/tmp/ceph-ansible/ansible.cfg |
16 | ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey | |
1adf2230 | 17 | ANSIBLE_STDOUT_CALLBACK = debug |
1adf2230 AA |
18 | VAGRANT_CWD = {changedir} |
19 | CEPH_VOLUME_DEBUG = 1 | |
494da23a | 20 | DEBIAN_FRONTEND=noninteractive |
1adf2230 | 21 | changedir= |
9f95a23c TL |
22 | centos8-filestore-single_type: {toxinidir}/centos8/filestore/single-type |
23 | centos8-filestore-single_type_dmcrypt: {toxinidir}/centos8/filestore/single-type-dmcrypt | |
24 | centos8-filestore-mixed_type: {toxinidir}/centos8/filestore/mixed-type | |
25 | centos8-filestore-mixed_type_dmcrypt: {toxinidir}/centos8/filestore/mixed-type-dmcrypt | |
26 | centos8-filestore-mixed_type_explicit: {toxinidir}/centos8/filestore/mixed-type-explicit | |
27 | centos8-filestore-mixed_type_dmcrypt_explicit: {toxinidir}/centos8/filestore/mixed-type-dmcrypt-explicit | |
28 | centos8-bluestore-single_type: {toxinidir}/centos8/bluestore/single-type | |
29 | centos8-bluestore-single_type_dmcrypt: {toxinidir}/centos8/bluestore/single-type-dmcrypt | |
30 | centos8-bluestore-mixed_type: {toxinidir}/centos8/bluestore/mixed-type | |
31 | centos8-bluestore-mixed_type_dmcrypt: {toxinidir}/centos8/bluestore/mixed-type-dmcrypt | |
32 | centos8-bluestore-mixed_type_explicit: {toxinidir}/centos8/bluestore/mixed-type-explicit | |
33 | centos8-bluestore-mixed_type_dmcrypt_explicit: {toxinidir}/centos8/bluestore/mixed-type-dmcrypt-explicit | |
1adf2230 | 34 | commands= |
f6b5b4d7 | 35 | 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 |
11fdf7f2 | 36 | python -m pip install -r {envdir}/tmp/ceph-ansible/tests/requirements.txt |
1adf2230 | 37 | |
9f95a23c TL |
38 | # bash {toxinidir}/../scripts/vagrant_up.sh {env:VAGRANT_UP_FLAGS:""} {posargs:--provider=virtualbox} |
39 | bash {toxinidir}/../scripts/vagrant_up.sh {posargs:--provider=virtualbox} | |
1adf2230 AA |
40 | bash {toxinidir}/../scripts/generate_ssh_config.sh {changedir} |
41 | ||
42 | cp {toxinidir}/../playbooks/deploy.yml {envdir}/tmp/ceph-ansible | |
43 | ||
91327a77 AA |
44 | # individual scenario setup |
45 | ansible-playbook -vv -i {changedir}/hosts {changedir}/setup.yml | |
46 | ||
1adf2230 AA |
47 | # use ceph-ansible to deploy a ceph cluster on the vms |
48 | 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}" | |
49 | ||
50 | # prepare nodes for testing with testinfra | |
51 | ansible-playbook -vv -i {changedir}/hosts {envdir}/tmp/ceph-ansible/tests/functional/setup.yml | |
52 | ||
81eedcae | 53 | # test cluster state using testinfra |
6d8e3169 | 54 | py.test --reruns 5 --reruns-delay 10 -n 4 --sudo -v --connection=ansible --ssh-config={changedir}/vagrant_ssh_config --ansible-inventory={changedir}/hosts {toxinidir}/../tests |
1adf2230 AA |
55 | |
56 | # reboot all vms - attempt | |
57 | bash {toxinidir}/../scripts/vagrant_reload.sh {env:VAGRANT_UP_FLAGS:"--no-provision"} {posargs:--provider=virtualbox} | |
58 | ||
81eedcae TL |
59 | # after a reboot, osds may take about 20 seconds to come back up |
60 | sleep 30 | |
61 | ||
1adf2230 | 62 | # retest to ensure cluster came back up correctly after rebooting |
6d8e3169 | 63 | py.test --reruns 5 --reruns-delay 10 -n 4 --sudo -v --connection=ansible --ssh-config={changedir}/vagrant_ssh_config --ansible-inventory={changedir}/hosts {toxinidir}/../tests |
1adf2230 AA |
64 | |
65 | # destroy an OSD, zap it's device and recreate it using it's ID | |
66 | ansible-playbook -vv -i {changedir}/hosts {changedir}/test.yml | |
67 | ||
68 | # retest to ensure cluster came back up correctly | |
6d8e3169 | 69 | py.test --reruns 5 --reruns-delay 10 -n 4 --sudo -v --connection=ansible --ssh-config={changedir}/vagrant_ssh_config --ansible-inventory={changedir}/hosts {toxinidir}/../tests |
1adf2230 | 70 | |
f64942e4 AA |
71 | # test zap OSDs by ID |
72 | ansible-playbook -vv -i {changedir}/hosts {changedir}/test_zap.yml | |
73 | ||
1adf2230 | 74 | vagrant destroy {env:VAGRANT_DESTROY_FLAGS:"--force"} |