2016-11-05 01:25:06 +08:00
|
|
|
[tox]
|
2024-02-14 17:36:19 +08:00
|
|
|
envlist = centos-{container,non_container}-{all_daemons,all_daemons_ipv6,collocation,lvm_osds,shrink_mon,shrink_mgr,shrink_mds,shrink_rbdmirror,shrink_rgw,lvm_batch,add_mons,add_mgrs,add_mdss,add_rbdmirrors,add_rgws,purge,storage_inventory,lvm_auto_discovery,all_in_one,cephadm_adopt,purge_dashboard}
|
2020-07-22 22:29:55 +08:00
|
|
|
centos-non_container-{switch_to_containers}
|
2018-10-25 22:15:36 +08:00
|
|
|
infra_lv_create
|
2019-03-28 03:36:51 +08:00
|
|
|
migrate_ceph_disk_to_ceph_volume
|
2024-02-13 04:04:12 +08:00
|
|
|
flake8
|
2017-07-12 21:02:32 +08:00
|
|
|
|
2016-11-05 01:25:06 +08:00
|
|
|
skipsdist = True
|
|
|
|
|
2018-08-09 06:12:30 +08:00
|
|
|
# a test scenario for the lv-create.yml and lv-teardown playbooks
|
|
|
|
[testenv:infra_lv_create]
|
2022-05-25 02:43:05 +08:00
|
|
|
allowlist_externals =
|
2018-08-09 06:12:30 +08:00
|
|
|
vagrant
|
|
|
|
bash
|
|
|
|
mkdir
|
2018-08-09 20:26:58 +08:00
|
|
|
cat
|
2018-08-09 06:12:30 +08:00
|
|
|
passenv=*
|
|
|
|
setenv=
|
2019-06-15 05:31:39 +08:00
|
|
|
ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
|
2019-09-09 23:11:43 +08:00
|
|
|
ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
|
2018-08-09 06:12:30 +08:00
|
|
|
ANSIBLE_ACTION_PLUGINS = {toxinidir}/plugins/actions
|
|
|
|
ANSIBLE_CALLBACK_PLUGINS = {toxinidir}/plugins/callback
|
|
|
|
ANSIBLE_CALLBACK_WHITELIST = profile_tasks
|
2018-12-14 18:14:30 +08:00
|
|
|
# only available for ansible >= 2.5
|
|
|
|
ANSIBLE_STDOUT_CALLBACK = yaml
|
2018-08-09 06:12:30 +08:00
|
|
|
deps= -r{toxinidir}/tests/requirements.txt
|
2019-08-06 16:57:26 +08:00
|
|
|
changedir={toxinidir}/tests/functional/infra_lv_create
|
2018-08-09 06:12:30 +08:00
|
|
|
commands=
|
2024-02-17 05:59:09 +08:00
|
|
|
bash {toxinidir}/tests/scripts/vagrant_up.sh {changedir} --no-provision {posargs:--provider=virtualbox}
|
2018-08-09 06:12:30 +08:00
|
|
|
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}
|
|
|
|
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/hosts {toxinidir}/infrastructure-playbooks/lv-create.yml
|
2018-08-09 06:12:30 +08:00
|
|
|
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/hosts {toxinidir}/infrastructure-playbooks/lv-teardown.yml --extra-vars "ireallymeanit=yes"
|
2018-08-09 06:12:30 +08:00
|
|
|
|
2019-08-06 16:57:26 +08:00
|
|
|
cat {toxinidir}/infrastructure-playbooks/lv-create.log
|
2018-08-09 20:26:58 +08:00
|
|
|
|
2018-08-09 06:12:30 +08:00
|
|
|
vagrant destroy --force
|
|
|
|
|
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=
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/rbd_map_devices.yml --extra-vars "\
|
2022-12-06 20:14:07 +08:00
|
|
|
ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:quay.io} \
|
2023-06-02 16:09:30 +08:00
|
|
|
ceph_docker_image={env:CEPH_DOCKER_IMAGE:ceph/daemon-base} \
|
2022-05-25 02:40:00 +08:00
|
|
|
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-main} \
|
2019-11-07 20:39:25 +08:00
|
|
|
"
|
|
|
|
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/{env:PURGE_PLAYBOOK:purge-cluster.yml} --extra-vars "\
|
2017-05-03 00:15:23 +08:00
|
|
|
ireallymeanit=yes \
|
2017-05-25 20:50:37 +08:00
|
|
|
remove_packages=yes \
|
2022-12-06 20:14:07 +08:00
|
|
|
ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:quay.io} \
|
2023-06-02 16:09:30 +08:00
|
|
|
ceph_docker_image={env:CEPH_DOCKER_IMAGE:ceph/daemon-base} \
|
2022-05-25 02:40:00 +08:00
|
|
|
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-main} \
|
2017-05-03 00:15:23 +08:00
|
|
|
"
|
2017-08-23 22:12:40 +08:00
|
|
|
|
2021-02-02 03:32:37 +08:00
|
|
|
# re-setup lvm, we exclude osd2 given this node uses lvm batch scenario (see corresponding inventory host file)
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/lvm_setup.yml --limit 'osds:!osd2'
|
2018-12-04 16:21:51 +08:00
|
|
|
|
2017-08-23 22:12:40 +08:00
|
|
|
# set up the cluster again
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars @ceph-override.json --extra-vars "\
|
2022-06-15 15:16:26 +08:00
|
|
|
yes_i_know=true \
|
2022-05-25 02:40:00 +08:00
|
|
|
ceph_dev_branch={env:CEPH_DEV_BRANCH:main} \
|
2022-06-22 16:11:40 +08:00
|
|
|
ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
|
2020-07-07 23:11:27 +08:00
|
|
|
ceph_docker_registry_auth=True \
|
|
|
|
ceph_docker_registry_username={env:DOCKER_HUB_USERNAME} \
|
|
|
|
ceph_docker_registry_password={env:DOCKER_HUB_PASSWORD} \
|
2017-08-23 22:12:40 +08:00
|
|
|
"
|
|
|
|
# test that the cluster can be redeployed in a healthy state
|
2019-05-22 16:42:33 +08:00
|
|
|
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
|
2017-08-23 22:12:40 +08:00
|
|
|
|
2021-07-06 02:07:05 +08:00
|
|
|
[purge-dashboard]
|
|
|
|
commands=
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/purge-dashboard.yml --extra-vars "\
|
2021-07-06 02:07:05 +08:00
|
|
|
ireallymeanit=yes \
|
2022-12-06 20:14:07 +08:00
|
|
|
ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:quay.io} \
|
2023-06-02 16:09:30 +08:00
|
|
|
ceph_docker_image={env:CEPH_DOCKER_IMAGE:ceph/daemon-base} \
|
2022-05-25 02:40:00 +08:00
|
|
|
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-main} \
|
2021-07-06 02:07:05 +08:00
|
|
|
"
|
|
|
|
|
|
|
|
# set up the cluster again
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars @ceph-override.json --extra-vars "\
|
2022-06-15 15:16:26 +08:00
|
|
|
yes_i_know=true \
|
2022-05-25 02:40:00 +08:00
|
|
|
ceph_dev_branch={env:CEPH_DEV_BRANCH:main} \
|
2022-06-22 16:11:40 +08:00
|
|
|
ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
|
2021-07-06 02:07:05 +08:00
|
|
|
ceph_docker_registry_auth=True \
|
|
|
|
ceph_docker_registry_username={env:DOCKER_HUB_USERNAME} \
|
|
|
|
ceph_docker_registry_password={env:DOCKER_HUB_PASSWORD} \
|
|
|
|
"
|
|
|
|
# test that the cluster can be redeployed in a healthy state
|
|
|
|
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
|
|
|
|
|
2017-08-23 22:12:40 +08:00
|
|
|
[purge-lvm]
|
|
|
|
commands=
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/{env:PURGE_PLAYBOOK:purge-cluster.yml} --extra-vars "\
|
2017-08-23 22:12:40 +08:00
|
|
|
ireallymeanit=yes \
|
|
|
|
remove_packages=yes \
|
2020-07-07 23:11:27 +08:00
|
|
|
ceph_docker_registry_auth=True \
|
|
|
|
ceph_docker_registry_username={env:DOCKER_HUB_USERNAME} \
|
|
|
|
ceph_docker_registry_password={env:DOCKER_HUB_PASSWORD} \
|
2017-08-23 22:12:40 +08:00
|
|
|
"
|
|
|
|
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/lvm_setup.yml
|
2017-08-23 22:12:40 +08:00
|
|
|
|
2017-01-27 00:38:10 +08:00
|
|
|
# set up the cluster again
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\
|
2022-06-15 15:16:26 +08:00
|
|
|
yes_i_know=true \
|
2022-05-25 02:40:00 +08:00
|
|
|
ceph_dev_branch={env:CEPH_DEV_BRANCH:main} \
|
2022-06-22 16:11:40 +08:00
|
|
|
ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
|
2017-05-03 00:15:23 +08:00
|
|
|
"
|
2017-01-27 00:38:10 +08:00
|
|
|
# test that the cluster can be redeployed in a healthy state
|
2019-05-22 16:42:33 +08:00
|
|
|
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
|
2017-01-27 00:38:10 +08:00
|
|
|
|
2017-08-31 06:07:28 +08:00
|
|
|
[shrink-mon]
|
|
|
|
commands=
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/shrink-mon.yml --extra-vars "\
|
2017-08-31 06:07:28 +08:00
|
|
|
ireallymeanit=yes \
|
2018-12-20 20:52:22 +08:00
|
|
|
mon_to_kill={env:MON_TO_KILL:mon2} \
|
2017-08-31 06:07:28 +08:00
|
|
|
"
|
|
|
|
[shrink-osd]
|
|
|
|
commands=
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/shrink-osd.yml --extra-vars "\
|
2017-08-31 06:07:28 +08:00
|
|
|
ireallymeanit=yes \
|
2020-02-27 00:03:32 +08:00
|
|
|
osd_to_kill={env:OSD_TO_KILL:0} \
|
2017-08-31 06:07:28 +08:00
|
|
|
"
|
|
|
|
|
2019-06-20 18:23:22 +08:00
|
|
|
[shrink-mgr]
|
|
|
|
commands=
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/shrink-mgr.yml --extra-vars "\
|
2019-06-20 18:23:22 +08:00
|
|
|
ireallymeanit=yes \
|
2020-02-27 00:03:32 +08:00
|
|
|
mgr_to_kill={env:MGR_TO_KILL:mgr1} \
|
2019-06-20 18:23:22 +08:00
|
|
|
"
|
|
|
|
|
2019-05-11 00:10:07 +08:00
|
|
|
[shrink-mds]
|
|
|
|
commands=
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/shrink-mds.yml --extra-vars "\
|
2019-05-11 00:10:07 +08:00
|
|
|
ireallymeanit=yes \
|
2020-02-27 00:03:32 +08:00
|
|
|
mds_to_kill={env:MDS_TO_KILL:mds0} \
|
2019-05-11 00:10:07 +08:00
|
|
|
"
|
|
|
|
|
2019-06-25 21:30:53 +08:00
|
|
|
[shrink-rbdmirror]
|
|
|
|
commands=
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/shrink-rbdmirror.yml --extra-vars "\
|
2019-06-25 21:30:53 +08:00
|
|
|
ireallymeanit=yes \
|
2020-02-27 00:03:32 +08:00
|
|
|
rbdmirror_to_kill={env:RBDMIRROR_TO_KILL:rbd-mirror0} \
|
2019-06-25 21:30:53 +08:00
|
|
|
"
|
|
|
|
|
2019-06-26 14:09:45 +08:00
|
|
|
[shrink-rgw]
|
|
|
|
commands=
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/shrink-rgw.yml --extra-vars "\
|
2019-06-26 14:09:45 +08:00
|
|
|
ireallymeanit=yes \
|
2020-02-27 00:03:32 +08:00
|
|
|
rgw_to_kill={env:RGW_TO_KILL:rgw0.rgw0} \
|
2019-06-26 14:09:45 +08:00
|
|
|
"
|
|
|
|
|
2017-08-25 20:36:07 +08:00
|
|
|
[switch-to-containers]
|
|
|
|
commands=
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml --extra-vars "\
|
2017-08-25 20:36:07 +08:00
|
|
|
ireallymeanit=yes \
|
2022-05-25 02:40:00 +08:00
|
|
|
ceph_docker_image_tag=latest-main-devel \
|
2022-12-06 20:14:07 +08:00
|
|
|
ceph_docker_registry=quay.io \
|
2023-06-02 16:09:30 +08:00
|
|
|
ceph_docker_image=ceph/daemon-base \
|
2020-07-07 23:11:27 +08:00
|
|
|
ceph_docker_registry_auth=True \
|
|
|
|
ceph_docker_registry_username={env:DOCKER_HUB_USERNAME} \
|
|
|
|
ceph_docker_registry_password={env:DOCKER_HUB_PASSWORD} \
|
2017-08-25 20:36:07 +08:00
|
|
|
"
|
|
|
|
|
2019-05-22 16:42:33 +08:00
|
|
|
py.test --reruns 5 --reruns-delay 1 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-switch-to-containers --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests
|
2020-10-20 05:22:31 +08:00
|
|
|
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/reboot.yml
|
2020-10-20 05:22:31 +08:00
|
|
|
|
|
|
|
py.test --reruns 5 --reruns-delay 1 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-switch-to-containers --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests
|
2017-08-25 20:36:07 +08:00
|
|
|
|
2018-11-08 21:47:51 +08:00
|
|
|
[add-mons]
|
|
|
|
commands=
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/hosts-2 --limit mon1 {toxinidir}/tests/functional/setup.yml
|
|
|
|
ansible-playbook -vv --diff -i {changedir}/hosts-2 {toxinidir}/infrastructure-playbooks/add-mon.yml --extra-vars "\
|
2018-11-08 21:47:51 +08:00
|
|
|
ireallymeanit=yes \
|
2022-05-25 02:40:00 +08:00
|
|
|
ceph_dev_branch={env:CEPH_DEV_BRANCH:main} \
|
2022-06-22 16:11:40 +08:00
|
|
|
ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
|
2018-11-08 21:47:51 +08:00
|
|
|
"
|
2019-05-22 16:42:33 +08:00
|
|
|
py.test --reruns 5 --reruns-delay 1 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-2 --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests
|
2018-11-08 21:47:51 +08:00
|
|
|
|
2019-02-09 15:46:12 +08:00
|
|
|
[add-mgrs]
|
|
|
|
commands=
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/hosts-2 --limit mgrs {toxinidir}/tests/functional/setup.yml
|
|
|
|
ansible-playbook -vv --diff -i {changedir}/hosts-2 --limit mgrs {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\
|
2022-06-15 15:16:26 +08:00
|
|
|
yes_i_know=true \
|
2019-02-09 15:46:12 +08:00
|
|
|
ireallymeanit=yes \
|
2022-05-25 02:40:00 +08:00
|
|
|
ceph_dev_branch={env:CEPH_DEV_BRANCH:main} \
|
2022-06-22 16:11:40 +08:00
|
|
|
ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
|
2020-07-07 23:11:27 +08:00
|
|
|
ceph_docker_registry_auth=True \
|
|
|
|
ceph_docker_registry_username={env:DOCKER_HUB_USERNAME} \
|
|
|
|
ceph_docker_registry_password={env:DOCKER_HUB_PASSWORD} \
|
2019-02-09 15:46:12 +08:00
|
|
|
"
|
2020-04-03 04:26:48 +08:00
|
|
|
py.test --reruns 5 --reruns-delay 1 -n 8 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-2 --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests
|
2019-02-09 15:46:12 +08:00
|
|
|
|
2019-02-12 11:15:44 +08:00
|
|
|
[add-mdss]
|
|
|
|
commands=
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/hosts-2 --limit mdss {toxinidir}/tests/functional/setup.yml
|
|
|
|
ansible-playbook -vv --diff -i {changedir}/hosts-2 --limit mdss {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\
|
2022-06-15 15:16:26 +08:00
|
|
|
yes_i_know=true \
|
2019-02-12 11:15:44 +08:00
|
|
|
ireallymeanit=yes \
|
2022-05-25 02:40:00 +08:00
|
|
|
ceph_dev_branch={env:CEPH_DEV_BRANCH:main} \
|
2022-06-22 16:11:40 +08:00
|
|
|
ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
|
2020-07-07 23:11:27 +08:00
|
|
|
ceph_docker_registry_auth=True \
|
|
|
|
ceph_docker_registry_username={env:DOCKER_HUB_USERNAME} \
|
|
|
|
ceph_docker_registry_password={env:DOCKER_HUB_PASSWORD} \
|
2019-02-12 11:15:44 +08:00
|
|
|
"
|
2019-05-22 16:42:33 +08:00
|
|
|
py.test --reruns 5 --reruns-delay 1 -n 8 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-2 --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests
|
2019-02-12 11:15:44 +08:00
|
|
|
|
2019-04-07 14:14:05 +08:00
|
|
|
[add-rbdmirrors]
|
|
|
|
commands=
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/hosts-2 --limit rbdmirrors {toxinidir}/tests/functional/setup.yml
|
|
|
|
ansible-playbook -vv --diff -i {changedir}/hosts-2 --limit rbdmirrors {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\
|
2022-06-15 15:16:26 +08:00
|
|
|
yes_i_know=true \
|
2019-04-07 14:14:05 +08:00
|
|
|
ireallymeanit=yes \
|
2022-05-25 02:40:00 +08:00
|
|
|
ceph_dev_branch={env:CEPH_DEV_BRANCH:main} \
|
2022-06-22 16:11:40 +08:00
|
|
|
ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
|
2020-07-07 23:11:27 +08:00
|
|
|
ceph_docker_registry_auth=True \
|
|
|
|
ceph_docker_registry_username={env:DOCKER_HUB_USERNAME} \
|
|
|
|
ceph_docker_registry_password={env:DOCKER_HUB_PASSWORD} \
|
2019-04-07 14:14:05 +08:00
|
|
|
"
|
2019-05-22 16:42:33 +08:00
|
|
|
py.test --reruns 5 --reruns-delay 1 -n 8 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-2 --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests
|
2019-04-07 14:14:05 +08:00
|
|
|
|
2019-04-07 14:36:31 +08:00
|
|
|
[add-rgws]
|
|
|
|
commands=
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/hosts-2 --limit rgws {toxinidir}/tests/functional/setup.yml
|
|
|
|
ansible-playbook -vv --diff -i {changedir}/hosts-2 --limit rgws {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\
|
2022-06-15 15:16:26 +08:00
|
|
|
yes_i_know=true \
|
2019-04-07 14:36:31 +08:00
|
|
|
ireallymeanit=yes \
|
2022-05-25 02:40:00 +08:00
|
|
|
ceph_dev_branch={env:CEPH_DEV_BRANCH:main} \
|
2022-06-22 16:11:40 +08:00
|
|
|
ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
|
2020-07-07 23:11:27 +08:00
|
|
|
ceph_docker_registry_auth=True \
|
|
|
|
ceph_docker_registry_username={env:DOCKER_HUB_USERNAME} \
|
|
|
|
ceph_docker_registry_password={env:DOCKER_HUB_PASSWORD} \
|
2019-04-07 14:36:31 +08:00
|
|
|
"
|
2019-05-22 16:42:33 +08:00
|
|
|
py.test --reruns 5 --reruns-delay 1 -n 8 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-2 --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests
|
2019-04-07 14:36:31 +08:00
|
|
|
|
2018-12-06 07:15:02 +08:00
|
|
|
[storage-inventory]
|
|
|
|
commands=
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/hosts {toxinidir}/infrastructure-playbooks/storage-inventory.yml --extra-vars "\
|
2022-05-25 02:40:00 +08:00
|
|
|
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-main} \
|
2018-12-06 07:15:02 +08:00
|
|
|
"
|
|
|
|
|
2020-07-07 02:27:50 +08:00
|
|
|
[cephadm-adopt]
|
|
|
|
commands=
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/cephadm-adopt.yml --extra-vars "\
|
2020-07-07 02:27:50 +08:00
|
|
|
ireallymeanit=yes \
|
|
|
|
delegate_facts_host={env:DELEGATE_FACTS_HOST:True} \
|
2021-08-05 23:48:38 +08:00
|
|
|
ceph_repository=dev \
|
2020-07-07 02:27:50 +08:00
|
|
|
"
|
2021-01-22 00:27:10 +08:00
|
|
|
# idempotency test
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/cephadm-adopt.yml --extra-vars "\
|
2021-01-22 00:27:10 +08:00
|
|
|
ireallymeanit=yes \
|
|
|
|
delegate_facts_host={env:DELEGATE_FACTS_HOST:True} \
|
2021-08-05 23:48:38 +08:00
|
|
|
ceph_repository=dev \
|
2021-01-22 00:27:10 +08:00
|
|
|
"
|
2020-07-07 02:27:50 +08:00
|
|
|
|
2016-11-05 01:25:06 +08:00
|
|
|
[testenv]
|
2022-05-25 02:43:05 +08:00
|
|
|
allowlist_externals =
|
2016-11-05 02:01:28 +08:00
|
|
|
vagrant
|
|
|
|
bash
|
2017-01-10 20:53:17 +08:00
|
|
|
pip
|
2018-10-16 23:05:10 +08:00
|
|
|
rm
|
2016-11-05 01:25:06 +08:00
|
|
|
passenv=*
|
2020-05-13 23:49:07 +08:00
|
|
|
sitepackages=False
|
2016-11-05 01:25:06 +08:00
|
|
|
setenv=
|
2019-06-15 05:31:39 +08:00
|
|
|
ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
|
2018-10-25 20:42:54 +08:00
|
|
|
ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
|
2022-07-29 17:15:17 +08:00
|
|
|
ANSIBLE_CALLBACKS_ENABLED = profile_tasks
|
2018-12-19 21:23:48 +08:00
|
|
|
ANSIBLE_KEEP_REMOTE_FILES = 1
|
2019-02-13 23:35:57 +08:00
|
|
|
ANSIBLE_CACHE_PLUGIN = memory
|
|
|
|
ANSIBLE_GATHERING = implicit
|
2022-07-29 17:15:17 +08:00
|
|
|
ANSIBLE_COLLECTIONS_PATH = {envdir}/ansible_collections
|
2018-12-14 18:14:30 +08:00
|
|
|
# only available for ansible >= 2.5
|
|
|
|
ANSIBLE_STDOUT_CALLBACK = yaml
|
2019-01-29 19:16:28 +08:00
|
|
|
non_container: DEV_SETUP = True
|
2018-12-14 19:01:16 +08:00
|
|
|
# Set the vagrant box image to use
|
2023-06-02 17:34:15 +08:00
|
|
|
centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
|
|
|
|
centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/stream9
|
2018-12-14 17:45:04 +08:00
|
|
|
INVENTORY = {env:_INVENTORY:hosts}
|
2018-12-06 06:19:48 +08:00
|
|
|
container: CONTAINER_DIR = /container
|
2020-03-31 20:08:30 +08:00
|
|
|
container: PLAYBOOK = site-container.yml.sample
|
2019-12-03 22:48:59 +08:00
|
|
|
container: PURGE_PLAYBOOK = purge-container-cluster.yml
|
2018-12-06 06:19:48 +08:00
|
|
|
non_container: PLAYBOOK = site.yml.sample
|
2020-02-27 00:03:32 +08:00
|
|
|
shrink_mds: MDS_TO_KILL = mds0
|
2019-06-20 18:23:22 +08:00
|
|
|
shrink_mgr: MGR_TO_KILL = mgr1
|
2020-02-27 00:03:32 +08:00
|
|
|
shrink_mon: MON_TO_KILL = mon2
|
|
|
|
shrink_rbdmirror: RBDMIRROR_TO_KILL = rbd-mirror0
|
|
|
|
shrink_rgw: RGW_TO_KILL = rgw0.rgw0
|
2017-07-12 21:02:32 +08:00
|
|
|
|
2022-05-25 02:40:00 +08:00
|
|
|
CEPH_DOCKER_IMAGE_TAG = latest-main
|
|
|
|
CEPH_DOCKER_IMAGE_TAG_BIS = latest-bis-main
|
|
|
|
UPDATE_CEPH_DOCKER_IMAGE_TAG = latest-main
|
2018-11-27 06:22:35 +08:00
|
|
|
|
2022-05-25 02:40:00 +08:00
|
|
|
switch_to_containers: CEPH_DOCKER_IMAGE_TAG = latest-main-devel
|
2019-04-04 20:41:46 +08:00
|
|
|
|
2018-05-31 18:02:26 +08:00
|
|
|
deps= -r{toxinidir}/tests/requirements.txt
|
2016-11-05 01:25:06 +08:00
|
|
|
changedir=
|
2018-12-14 19:01:16 +08:00
|
|
|
all_daemons: {toxinidir}/tests/functional/all_daemons{env:CONTAINER_DIR:}
|
2023-06-07 23:10:52 +08:00
|
|
|
all_daemons_ipv6: {toxinidir}/tests/functional/all_daemons_ipv6{env:CONTAINER_DIR:}
|
2018-12-14 19:01:16 +08:00
|
|
|
cluster: {toxinidir}/tests/functional/all_daemons{env:CONTAINER_DIR:}
|
|
|
|
shrink_mon: {toxinidir}/tests/functional/shrink_mon{env:CONTAINER_DIR:}
|
2019-06-20 18:23:22 +08:00
|
|
|
shrink_mgn: {toxinidir}/tests/functional/shrink_mon{env:CONTAINER_DIR:}
|
|
|
|
shrink_mgr: {toxinidir}/tests/functional/shrink_mgr{env:CONTAINER_DIR:}
|
2019-05-11 00:10:07 +08:00
|
|
|
shrink_mds: {toxinidir}/tests/functional/shrink_mds{env:CONTAINER_DIR:}
|
2019-06-25 21:30:53 +08:00
|
|
|
shrink_rbdmirror: {toxinidir}/tests/functional/shrink_rbdmirror{env:CONTAINER_DIR:}
|
2019-06-26 14:09:45 +08:00
|
|
|
shrink_rgw: {toxinidir}/tests/functional/shrink_rgw{env:CONTAINER_DIR:}
|
2016-12-01 02:20:07 +08:00
|
|
|
# tests a 1 mon, 1 osd, 1 mds and 1 rgw centos7 cluster using docker
|
2018-12-14 19:01:16 +08:00
|
|
|
collocation: {toxinidir}/tests/functional/collocation{env:CONTAINER_DIR:}
|
|
|
|
purge: {toxinidir}/tests/functional/all_daemons{env:CONTAINER_DIR:}
|
2021-07-06 02:07:05 +08:00
|
|
|
purge_dashboard: {toxinidir}/tests/functional/all_daemons{env:CONTAINER_DIR:}
|
2018-12-14 19:01:16 +08:00
|
|
|
switch_to_containers: {toxinidir}/tests/functional/all_daemons
|
|
|
|
lvm_osds: {toxinidir}/tests/functional/lvm-osds{env:CONTAINER_DIR:}
|
|
|
|
lvm_batch: {toxinidir}/tests/functional/lvm-batch{env:CONTAINER_DIR:}
|
2018-11-08 21:47:51 +08:00
|
|
|
add_mons: {toxinidir}/tests/functional/add-mons{env:CONTAINER_DIR:}
|
2019-02-09 15:46:12 +08:00
|
|
|
add_mgrs: {toxinidir}/tests/functional/add-mgrs{env:CONTAINER_DIR:}
|
2019-02-12 11:15:44 +08:00
|
|
|
add_mdss: {toxinidir}/tests/functional/add-mdss{env:CONTAINER_DIR:}
|
2019-04-07 14:14:05 +08:00
|
|
|
add_rbdmirrors: {toxinidir}/tests/functional/add-rbdmirrors{env:CONTAINER_DIR:}
|
2019-04-07 14:36:31 +08:00
|
|
|
add_rgws: {toxinidir}/tests/functional/add-rgws{env:CONTAINER_DIR:}
|
2018-12-14 19:01:16 +08:00
|
|
|
storage_inventory: {toxinidir}/tests/functional/lvm-osds{env:CONTAINER_DIR:}
|
2019-01-11 03:05:56 +08:00
|
|
|
lvm_auto_discovery: {toxinidir}/tests/functional/lvm-auto-discovery{env:CONTAINER_DIR:}
|
2020-01-27 22:49:30 +08:00
|
|
|
all_in_one: {toxinidir}/tests/functional/all-in-one{env:CONTAINER_DIR:}
|
2020-07-07 02:27:50 +08:00
|
|
|
cephadm_adopt: {toxinidir}/tests/functional/all_daemons{env:CONTAINER_DIR:}
|
2017-07-04 23:12:32 +08:00
|
|
|
|
2016-11-05 01:25:06 +08:00
|
|
|
commands=
|
2022-07-29 17:15:17 +08:00
|
|
|
ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
|
2024-02-18 18:50:29 +08:00
|
|
|
non_container: ansible-playbook -vv --diff -i "localhost," -c local {toxinidir}/tests/functional/dev_setup.yml --extra-vars "dev_setup={env:DEV_SETUP:False} change_dir={changedir} ceph_dev_branch={env:CEPH_DEV_BRANCH:main} ceph_dev_sha1={env:CEPH_DEV_SHA1:latest}" --tags "vagrant_setup"
|
2017-03-22 23:14:41 +08:00
|
|
|
|
2024-02-17 05:59:09 +08:00
|
|
|
bash {toxinidir}/tests/scripts/vagrant_up.sh {changedir} --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
|
|
|
|
2021-02-02 03:32:37 +08:00
|
|
|
# configure lvm, we exclude osd2 given this node uses lvm batch scenario (see corresponding inventory host file)
|
2024-02-18 18:50:29 +08:00
|
|
|
!lvm_batch-!lvm_auto_discovery: ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/lvm_setup.yml --limit 'osds:!osd2'
|
|
|
|
lvm_osds: ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/lvm_setup.yml --limit 'osd2'
|
|
|
|
all_in_one: ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/lvm_setup.yml
|
2018-11-27 16:02:09 +08:00
|
|
|
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/setup.yml
|
2018-05-28 18:02:49 +08:00
|
|
|
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\
|
2022-08-02 02:22:10 +08:00
|
|
|
no_log_on_ceph_key_tasks=false \
|
2022-06-15 15:16:26 +08:00
|
|
|
yes_i_know=true \
|
2022-05-25 02:40:00 +08:00
|
|
|
ceph_dev_branch={env:CEPH_DEV_BRANCH:main} \
|
2022-06-22 16:11:40 +08:00
|
|
|
ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
|
2020-07-07 23:11:27 +08:00
|
|
|
ceph_docker_registry_auth=True \
|
|
|
|
ceph_docker_registry_username={env:DOCKER_HUB_USERNAME} \
|
|
|
|
ceph_docker_registry_password={env:DOCKER_HUB_PASSWORD} \
|
2017-05-03 00:15:23 +08:00
|
|
|
"
|
2017-03-16 19:16:09 +08:00
|
|
|
|
2017-09-22 05:47:36 +08:00
|
|
|
# test cluster state using ceph-ansible tests
|
2021-03-03 15:51:25 +08:00
|
|
|
py.test --reruns 20 --reruns-delay 3 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests
|
2017-09-22 05:47:36 +08:00
|
|
|
|
|
|
|
# reboot all vms
|
2024-02-18 18:50:29 +08:00
|
|
|
all_daemons,all_daemons_ipv6,collocation: ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/reboot.yml
|
2017-09-22 05:47:36 +08:00
|
|
|
|
|
|
|
# retest to ensure cluster came back up correctly after rebooting
|
2023-06-07 23:10:52 +08:00
|
|
|
all_daemons,all_daemons_ipv6,collocation: py.test --reruns 20 --reruns-delay 3 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests
|
2016-12-23 04:13:08 +08:00
|
|
|
|
2017-10-03 04:46:28 +08:00
|
|
|
# handlers/idempotency test
|
2024-02-18 18:50:29 +08:00
|
|
|
all_daemons,all_daemon_ipv6,all_in_one,collocation: ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "no_log_on_ceph_key_tasks=false delegate_facts_host={env:DELEGATE_FACTS_HOST:True} ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG_BIS:latest-bis-main} ceph_dev_branch={env:CEPH_DEV_BRANCH:main} ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} yes_i_know=true" --extra-vars @ceph-override.json
|
2017-10-03 04:46:28 +08:00
|
|
|
|
2018-12-14 19:01:16 +08:00
|
|
|
purge: {[purge]commands}
|
2021-07-06 02:07:05 +08:00
|
|
|
purge_dashboard: {[purge-dashboard]commands}
|
2017-08-25 20:36:07 +08:00
|
|
|
switch_to_containers: {[switch-to-containers]commands}
|
2017-08-31 06:07:28 +08:00
|
|
|
shrink_mon: {[shrink-mon]commands}
|
2019-06-20 18:23:22 +08:00
|
|
|
shrink_mgr: {[shrink-mgr]commands}
|
2019-05-11 00:10:07 +08:00
|
|
|
shrink_mds: {[shrink-mds]commands}
|
2019-06-25 21:30:53 +08:00
|
|
|
shrink_rbdmirror: {[shrink-rbdmirror]commands}
|
2019-06-26 14:09:45 +08:00
|
|
|
shrink_rgw: {[shrink-rgw]commands}
|
2018-11-08 21:47:51 +08:00
|
|
|
add_mons: {[add-mons]commands}
|
2019-02-09 15:46:12 +08:00
|
|
|
add_mgrs: {[add-mgrs]commands}
|
2019-02-12 11:15:44 +08:00
|
|
|
add_mdss: {[add-mdss]commands}
|
2019-04-07 14:14:05 +08:00
|
|
|
add_rbdmirrors: {[add-rbdmirrors]commands}
|
2019-04-07 14:36:31 +08:00
|
|
|
add_rgws: {[add-rgws]commands}
|
2018-12-06 07:15:02 +08:00
|
|
|
storage_inventory: {[storage-inventory]commands}
|
2020-07-07 02:27:50 +08:00
|
|
|
cephadm_adopt: {[cephadm-adopt]commands}
|
2017-01-27 00:38:10 +08:00
|
|
|
|
2016-11-05 02:01:28 +08:00
|
|
|
vagrant destroy --force
|
2024-02-13 04:04:12 +08:00
|
|
|
|
|
|
|
[testenv:flake8]
|
|
|
|
max-line-length = 100
|
|
|
|
ignore =
|
|
|
|
E501,
|
|
|
|
W503,
|
|
|
|
exclude =
|
|
|
|
.tox \
|
|
|
|
.vagrant \
|
|
|
|
__pycache__ \
|
|
|
|
*.pyc \
|
|
|
|
templates \
|
|
|
|
.eggs
|
|
|
|
statistics = True
|
|
|
|
deps =
|
|
|
|
flake8
|
|
|
|
commands =
|
|
|
|
flake8 --max-line-length=160 ./library ./module_utils/ ./tests/library/ ./tests/module_utils/ ./tests/functional/tests/ {posargs}
|