2016-11-05 01:25:06 +08:00
|
|
|
[tox]
|
2017-03-08 04:05:03 +08:00
|
|
|
envlist = {ansible2.2}-{xenial_cluster,journal_collocation,centos7_cluster,dmcrypt_journal,dmcrypt_journal_collocation,docker_cluster,purge_cluster,purge_dmcrypt,docker_dedicated_journal,docker_dmcrypt_journal_collocation,update_dmcrypt,update_cluster}
|
2016-11-05 01:25:06 +08:00
|
|
|
skipsdist = True
|
|
|
|
|
2017-01-27 00:38:10 +08:00
|
|
|
# extra commands for purging clusters
|
|
|
|
# that purge the cluster and then set it up again to
|
|
|
|
# ensure that a purge can clear nodes well enough that they
|
|
|
|
# can be redployed to.
|
|
|
|
[purge]
|
|
|
|
commands=
|
|
|
|
cp {toxinidir}/infrastructure-playbooks/purge-cluster.yml {toxinidir}/purge-cluster.yml
|
2017-03-16 19:16:09 +08:00
|
|
|
ansible-playbook -vv -i {changedir}/hosts {toxinidir}/purge-cluster.yml -e ireallymeanit=yes --extra-vars '\
|
|
|
|
\{\
|
2017-03-21 05:22:07 +08:00
|
|
|
"fetch_directory":"{env:FETCH_DIRECTORY:{changedir}/fetch}",\
|
2017-03-16 19:16:09 +08:00
|
|
|
"ceph_rhcs":{env:CEPH_RHCS:false},\
|
|
|
|
"ceph_origin":"{env:CEPH_ORIGIN:upstream}",\
|
|
|
|
"ceph_dev":{env:CEPH_DEV:false},\
|
|
|
|
"ceph_dev_branch":"{env:CEPH_DEV_BRANCH:master}",\
|
|
|
|
"ceph_dev_sha1":"{env:CEPH_DEV_SHA1:latest}",\
|
|
|
|
"ceph_stable_release":"{env:CEPH_STABLE_RELEASE:jewel}",\
|
|
|
|
"ceph_stable":{env:CEPH_STABLE:true}\
|
|
|
|
\}'
|
2017-01-27 00:38:10 +08:00
|
|
|
# set up the cluster again
|
2017-03-16 19:16:09 +08:00
|
|
|
ansible-playbook -vv -i {changedir}/hosts {toxinidir}/site.yml.sample --extra-vars '\
|
|
|
|
\{\
|
2017-03-21 05:22:07 +08:00
|
|
|
"fetch_directory":"{env:FETCH_DIRECTORY:{changedir}/fetch}",\
|
2017-03-16 19:16:09 +08:00
|
|
|
"ceph_rhcs":{env:CEPH_RHCS:false},\
|
|
|
|
"ceph_origin":"{env:CEPH_ORIGIN:upstream}",\
|
|
|
|
"ceph_dev":{env:CEPH_DEV:false},\
|
|
|
|
"ceph_dev_branch":"{env:CEPH_DEV_BRANCH:master}",\
|
|
|
|
"ceph_dev_sha1":"{env:CEPH_DEV_SHA1:latest}",\
|
|
|
|
"ceph_stable_release":"{env:CEPH_STABLE_RELEASE:jewel}",\
|
|
|
|
"ceph_stable":{env:CEPH_STABLE:true}\
|
|
|
|
\}'
|
2017-01-27 00:38:10 +08:00
|
|
|
# test that the cluster can be redeployed in a healthy state
|
|
|
|
testinfra -n 4 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts {toxinidir}/tests/functional/tests
|
|
|
|
|
2017-02-18 04:33:30 +08:00
|
|
|
# extra commands for performing a rolling update
|
|
|
|
# currently this hardcodes the release to kraken
|
|
|
|
# as we're still installing jewel by default
|
|
|
|
[update]
|
|
|
|
commands=
|
|
|
|
cp {toxinidir}/infrastructure-playbooks/rolling_update.yml {toxinidir}/rolling_update.yml
|
2017-03-16 19:16:09 +08:00
|
|
|
ansible-playbook -vv -i {changedir}/hosts {toxinidir}/rolling_update.yml -e ireallymeanit=yes --extra-vars '\
|
|
|
|
\{\
|
2017-03-21 05:22:07 +08:00
|
|
|
"fetch_directory":"{env:FETCH_DIRECTORY:{changedir}/fetch}",\
|
2017-03-16 19:16:09 +08:00
|
|
|
"ceph_rhcs":{env:CEPH_RHCS:false},\
|
|
|
|
"ceph_origin":"{env:CEPH_ORIGIN:upstream}",\
|
|
|
|
"ceph_dev":{env:CEPH_DEV:false},\
|
|
|
|
"ceph_dev_branch":"{env:UPDATE_CEPH_DEV_BRANCH:master}",\
|
|
|
|
"ceph_dev_sha1":"{env:UPDATE_CEPH_DEV_SHA1:latest}",\
|
|
|
|
"ceph_stable_release":"{env:UPDATE_CEPH_STABLE_RELEASE:kraken}",\
|
|
|
|
"ceph_stable":{env:CEPH_STABLE:true}\
|
|
|
|
\}'
|
2017-02-18 04:33:30 +08:00
|
|
|
|
|
|
|
testinfra -n 4 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts {toxinidir}/tests/functional/tests
|
|
|
|
|
2016-11-05 01:25:06 +08:00
|
|
|
[testenv]
|
2016-11-05 02:01:28 +08:00
|
|
|
whitelist_externals =
|
|
|
|
vagrant
|
|
|
|
bash
|
2017-01-10 20:53:17 +08:00
|
|
|
pip
|
2017-01-11 06:56:07 +08:00
|
|
|
cp
|
2016-11-05 01:25:06 +08:00
|
|
|
passenv=*
|
|
|
|
setenv=
|
2016-11-05 01:49:18 +08:00
|
|
|
ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config
|
2016-11-05 01:25:06 +08:00
|
|
|
ANSIBLE_ACTION_PLUGINS = {toxinidir}/plugins/actions
|
2016-12-16 02:23:17 +08:00
|
|
|
# only available for ansible >= 2.2
|
|
|
|
ANSIBLE_STDOUT_CALLBACK = debug
|
2016-12-02 00:19:19 +08:00
|
|
|
docker_cluster: PLAYBOOK = site-docker.yml.sample
|
2017-02-11 00:37:52 +08:00
|
|
|
docker_dedicated_journal: PLAYBOOK = site-docker.yml.sample
|
2017-02-17 04:25:29 +08:00
|
|
|
docker_dmcrypt_journal_collocation = site-docker.yml.sample
|
2016-11-05 01:25:06 +08:00
|
|
|
deps=
|
2016-11-09 00:34:16 +08:00
|
|
|
ansible1.9: ansible==1.9.4
|
2016-11-05 01:25:06 +08:00
|
|
|
ansible2.1: ansible==2.1
|
2016-12-14 23:57:40 +08:00
|
|
|
ansible2.2: ansible==2.2.1
|
2016-11-05 01:25:06 +08:00
|
|
|
-r{toxinidir}/tests/requirements.txt
|
|
|
|
changedir=
|
2016-11-29 05:05:48 +08:00
|
|
|
# tests a 1 mon, 1 osd, 1 mds and 1 rgw xenial cluster using raw_multi_journal OSD scenario
|
2016-12-02 06:48:06 +08:00
|
|
|
xenial_cluster: {toxinidir}/tests/functional/ubuntu/16.04/cluster
|
2016-11-29 05:02:16 +08:00
|
|
|
# tests a 1 mon 1 osd centos7 cluster using journal_collocation OSD scenario
|
2016-11-30 04:01:31 +08:00
|
|
|
journal_collocation: {toxinidir}/tests/functional/centos/7/journal-collocation
|
2016-11-29 01:20:31 +08:00
|
|
|
# tests a 1 mon 1 osd centos7 cluster using dmcrypt_dedicated_journal OSD scenario
|
2016-11-30 04:01:31 +08:00
|
|
|
dmcrypt_journal: {toxinidir}/tests/functional/centos/7/dmcrypt-dedicated-journal
|
2016-11-29 02:03:00 +08:00
|
|
|
# tests a 1 mon 1 osd centos7 cluster using dmcrypt_journal_collocation OSD scenario
|
2016-11-30 04:01:31 +08:00
|
|
|
dmcrypt_journal_collocation: {toxinidir}/tests/functional/centos/7/dmcrypt-journal-collocation
|
2016-11-29 05:10:07 +08:00
|
|
|
# tests a 1 mon, 1 osd, 1 mds and 1 rgw centos7 cluster using raw_multi_journal OSD scenario
|
2016-12-02 06:59:27 +08:00
|
|
|
centos7_cluster: {toxinidir}/tests/functional/centos/7/cluster
|
2016-12-01 02:20:07 +08:00
|
|
|
# tests a 1 mon, 1 osd, 1 mds and 1 rgw centos7 cluster using docker
|
|
|
|
docker_cluster: {toxinidir}/tests/functional/centos/7/docker-cluster
|
2017-02-11 00:37:52 +08:00
|
|
|
docker_dedicated_journal: {toxinidir}/tests/functional/centos/7/docker-cluster-dedicated-journal
|
2017-02-17 04:25:29 +08:00
|
|
|
docker_dmcrypt_journal_collocation: {toxinidir}/tests/functional/centos/7/docker-cluster-dmcrypt-journal-collocation
|
2017-01-27 20:12:10 +08:00
|
|
|
purge_cluster: {toxinidir}/tests/functional/ubuntu/16.04/cluster
|
2017-01-27 00:38:10 +08:00
|
|
|
purge_dmcrypt: {toxinidir}/tests/functional/centos/7/dmcrypt-dedicated-journal
|
2017-02-18 04:33:30 +08:00
|
|
|
update_dmcrypt: {toxinidir}/tests/functional/centos/7/dmcrypt-dedicated-journal
|
2017-03-08 04:05:03 +08:00
|
|
|
update_cluster: {toxinidir}/tests/functional/centos/7/cluster
|
2016-11-05 01:25:06 +08:00
|
|
|
commands=
|
2016-11-09 07:00:09 +08:00
|
|
|
vagrant up --no-provision {posargs:--provider=virtualbox}
|
2016-11-05 02:01:28 +08:00
|
|
|
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}
|
2016-11-05 01:25:06 +08:00
|
|
|
|
2017-03-16 19:16:09 +08:00
|
|
|
ansible-playbook -vv -i {changedir}/hosts {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars '\
|
|
|
|
\{\
|
2017-03-21 05:22:07 +08:00
|
|
|
"fetch_directory":"{env:FETCH_DIRECTORY:{changedir}/fetch}",\
|
2017-03-16 19:16:09 +08:00
|
|
|
"ceph_rhcs":{env:CEPH_RHCS:false},\
|
|
|
|
"ceph_origin":"{env:CEPH_ORIGIN:upstream}",\
|
|
|
|
"ceph_dev":{env:CEPH_DEV:false},\
|
|
|
|
"ceph_dev_branch":"{env:CEPH_DEV_BRANCH:master}",\
|
|
|
|
"ceph_dev_sha1":"{env:CEPH_DEV_SHA1:latest}",\
|
|
|
|
"ceph_stable_release":"{env:CEPH_STABLE_RELEASE:jewel}",\
|
|
|
|
"ceph_stable":{env:CEPH_STABLE:true}\
|
|
|
|
\}'
|
|
|
|
|
2016-12-04 10:08:53 +08:00
|
|
|
ansible-playbook -vv -i {changedir}/hosts {toxinidir}/tests/functional/setup.yml
|
2016-11-05 01:25:06 +08:00
|
|
|
|
2016-12-04 10:09:37 +08:00
|
|
|
testinfra -n 4 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts {toxinidir}/tests/functional/tests
|
2016-12-23 04:13:08 +08:00
|
|
|
|
2017-01-27 00:38:10 +08:00
|
|
|
purge_cluster: {[purge]commands}
|
|
|
|
purge_dmcrypt: {[purge]commands}
|
2017-02-18 04:33:30 +08:00
|
|
|
update_dmcrypt: {[update]commands}
|
2017-03-08 04:05:03 +08:00
|
|
|
update_cluster: {[update]commands}
|
2017-01-27 00:38:10 +08:00
|
|
|
|
2016-11-05 02:01:28 +08:00
|
|
|
vagrant destroy --force
|