2020-07-22 17:38:55 +08:00
|
|
|
[tox]
|
|
|
|
envlist = {centos}-{container,non_container}-{shrink_osd_single,shrink_osd_multiple}
|
|
|
|
skipsdist = True
|
|
|
|
|
|
|
|
[shrink-osd-single]
|
|
|
|
commands=
|
|
|
|
ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/shrink-osd.yml --extra-vars "\
|
|
|
|
ireallymeanit=yes \
|
|
|
|
osd_to_kill=0 \
|
|
|
|
"
|
|
|
|
ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/shrink-osd.yml --extra-vars "\
|
|
|
|
ireallymeanit=yes \
|
|
|
|
osd_to_kill=1 \
|
|
|
|
"
|
|
|
|
ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/shrink-osd.yml --extra-vars "\
|
|
|
|
ireallymeanit=yes \
|
|
|
|
osd_to_kill=2 \
|
|
|
|
"
|
|
|
|
ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/shrink-osd.yml --extra-vars "\
|
|
|
|
ireallymeanit=yes \
|
|
|
|
osd_to_kill=3 \
|
|
|
|
"
|
|
|
|
ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/shrink-osd.yml --extra-vars "\
|
|
|
|
ireallymeanit=yes \
|
|
|
|
osd_to_kill=4 \
|
|
|
|
"
|
|
|
|
ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/shrink-osd.yml --extra-vars "\
|
|
|
|
ireallymeanit=yes \
|
|
|
|
osd_to_kill=5 \
|
|
|
|
"
|
|
|
|
ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/shrink-osd.yml --extra-vars "\
|
|
|
|
ireallymeanit=yes \
|
|
|
|
osd_to_kill=6 \
|
|
|
|
"
|
|
|
|
ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/shrink-osd.yml --extra-vars "\
|
|
|
|
ireallymeanit=yes \
|
|
|
|
osd_to_kill=7 \
|
|
|
|
"
|
|
|
|
|
|
|
|
[shrink-osd-multiple]
|
|
|
|
commands=
|
|
|
|
ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/shrink-osd.yml --extra-vars "\
|
|
|
|
ireallymeanit=yes \
|
|
|
|
osd_to_kill=0,1,2,3,4,5,6,7 \
|
|
|
|
"
|
|
|
|
|
|
|
|
[testenv]
|
2022-12-06 20:14:07 +08:00
|
|
|
allowlist_externals =
|
2020-07-22 17:38:55 +08:00
|
|
|
vagrant
|
|
|
|
bash
|
|
|
|
passenv=*
|
|
|
|
sitepackages=False
|
|
|
|
setenv=
|
|
|
|
ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
|
|
|
|
ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
|
|
|
|
ANSIBLE_CALLBACK_WHITELIST = profile_tasks
|
|
|
|
ANSIBLE_KEEP_REMOTE_FILES = 1
|
|
|
|
ANSIBLE_CACHE_PLUGIN = memory
|
|
|
|
ANSIBLE_GATHERING = implicit
|
|
|
|
# only available for ansible >= 2.5
|
|
|
|
ANSIBLE_STDOUT_CALLBACK = yaml
|
|
|
|
non_container: DEV_SETUP = True
|
|
|
|
# Set the vagrant box image to use
|
2024-07-16 20:54:37 +08:00
|
|
|
centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
|
|
|
|
centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
|
2020-07-22 17:38:55 +08:00
|
|
|
INVENTORY = {env:_INVENTORY:hosts}
|
|
|
|
container: CONTAINER_DIR = /container
|
|
|
|
container: PLAYBOOK = site-container.yml.sample
|
|
|
|
container: PURGE_PLAYBOOK = purge-container-cluster.yml
|
|
|
|
non_container: PLAYBOOK = site.yml.sample
|
|
|
|
|
2021-02-10 21:42:27 +08:00
|
|
|
CEPH_DOCKER_IMAGE_TAG = latest-pacific
|
|
|
|
CEPH_DOCKER_IMAGE_TAG_BIS = latest-bis-pacific
|
|
|
|
UPDATE_CEPH_DOCKER_IMAGE_TAG = latest-pacific
|
2020-07-22 17:38:55 +08:00
|
|
|
|
|
|
|
deps= -r{toxinidir}/tests/requirements.txt
|
|
|
|
changedir=
|
|
|
|
shrink_osd_single: {toxinidir}/tests/functional/shrink_osd{env:CONTAINER_DIR:}
|
|
|
|
shrink_osd_multiple: {toxinidir}/tests/functional/shrink_osd{env:CONTAINER_DIR:}
|
|
|
|
|
|
|
|
|
|
|
|
commands=
|
|
|
|
bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
|
|
|
|
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}
|
|
|
|
|
|
|
|
# configure lvm
|
|
|
|
ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/lvm_setup.yml
|
|
|
|
|
|
|
|
ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/setup.yml
|
|
|
|
|
|
|
|
ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\
|
2022-07-04 21:17:30 +08:00
|
|
|
yes_i_know=true \
|
2020-07-22 17:38:55 +08:00
|
|
|
delegate_facts_host={env:DELEGATE_FACTS_HOST:True} \
|
|
|
|
ceph_docker_registry_auth=True \
|
|
|
|
ceph_docker_registry_username={env:DOCKER_HUB_USERNAME} \
|
|
|
|
ceph_docker_registry_password={env:DOCKER_HUB_PASSWORD} \
|
|
|
|
"
|
|
|
|
|
|
|
|
# test cluster state using ceph-ansible tests
|
|
|
|
py.test --reruns 5 --reruns-delay 1 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests
|
2022-07-04 21:17:30 +08:00
|
|
|
|
2020-07-22 17:38:55 +08:00
|
|
|
shrink_osd_single: {[shrink-osd-single]commands}
|
|
|
|
shrink_osd_multiple: {[shrink-osd-multiple]commands}
|
|
|
|
|
|
|
|
# configure lvm
|
|
|
|
ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/lvm_setup.yml
|
|
|
|
ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --limit osds --extra-vars "\
|
2022-07-04 21:17:30 +08:00
|
|
|
yes_i_know=true \
|
2020-07-22 17:38:55 +08:00
|
|
|
delegate_facts_host={env:DELEGATE_FACTS_HOST:True} \
|
|
|
|
ceph_docker_registry_auth=True \
|
|
|
|
ceph_docker_registry_username={env:DOCKER_HUB_USERNAME} \
|
|
|
|
ceph_docker_registry_password={env:DOCKER_HUB_PASSWORD} \
|
|
|
|
"
|
|
|
|
# retest to ensure OSDs are well redeployed
|
|
|
|
py.test --reruns 5 --reruns-delay 1 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests
|
|
|
|
|
|
|
|
vagrant destroy --force
|