]>
Commit | Line | Data |
---|---|---|
d2e6a577 FG |
1 | [tox] |
2 | envlist = {centos7,xenial}-{create,prepare_activate} | |
3 | skipsdist = True | |
4 | ||
5 | [testenv] | |
6 | whitelist_externals = | |
7 | vagrant | |
8 | bash | |
9 | git | |
10 | passenv=* | |
11 | setenv= | |
12 | ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config | |
13 | ANSIBLE_STDOUT_CALLBACK = debug | |
14 | ANSIBLE_RETRY_FILES_ENABLED = False | |
15 | VAGRANT_CWD = {changedir} | |
16 | CEPH_VOLUME_DEBUG = 1 | |
17 | deps= | |
181888fb | 18 | ansible==2.3.1 |
d2e6a577 FG |
19 | testinfra==1.6.0 |
20 | pytest-xdist | |
21 | changedir= | |
22 | centos7-create: {toxinidir}/centos7/create | |
23 | xenial-create: {toxinidir}/xenial/create | |
24 | # TODO: these are placeholders for now, eventually we want to | |
25 | # test the prepare/activate workflow of ceph-volume as well | |
26 | xenial-prepare_activate: {toxinidir}/xenial/prepare_activate | |
27 | centos7-prepare_activate: {toxinidir}/xenial/prepare_activate | |
28 | commands= | |
29 | git clone -b {env:CEPH_ANSIBLE_BRANCH:master} --single-branch https://github.com/ceph/ceph-ansible.git {envdir}/tmp/ceph-ansible | |
30 | ||
31 | vagrant up --no-provision {posargs:--provider=virtualbox} | |
32 | bash {toxinidir}/scripts/generate_ssh_config.sh {changedir} | |
33 | ||
34 | # create logical volumes to test with on the vms | |
35 | ansible-playbook -vv -i {changedir}/hosts {envdir}/tmp/ceph-ansible/tests/functional/lvm_setup.yml | |
36 | ||
37 | # use ceph-ansible to deploy a ceph cluster on the vms | |
38 | ansible-playbook -vv -i {changedir}/hosts {envdir}/tmp/ceph-ansible/site.yml.sample --extra-vars "fetch_directory={changedir}/fetch ceph_dev_branch={env:CEPH_DEV_BRANCH:master} ceph_dev_sha1={env:CEPH_DEV_SHA1:latest}" | |
39 | ||
40 | # prepare nodes for testing with testinfra | |
41 | ansible-playbook -vv -i {changedir}/hosts {envdir}/tmp/ceph-ansible/tests/functional/setup.yml | |
42 | ||
43 | # test cluster state using ceph-ansible tests | |
44 | testinfra -n 4 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts {envdir}/tmp/ceph-ansible/tests/functional/tests | |
45 | ||
46 | # reboot all vms | |
47 | vagrant reload --no-provision | |
48 | ||
49 | # retest to ensure cluster came back up correctly after rebooting | |
50 | testinfra -n 4 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts {envdir}/tmp/ceph-ansible/tests/functional/tests | |
51 | ||
52 | vagrant destroy --force |