2020-01-30 20:00:47 +08:00
|
|
|
[tox]
|
2020-07-22 22:29:55 +08:00
|
|
|
envlist = centos-{container,non_container}-external_clients
|
2020-01-30 20:00:47 +08:00
|
|
|
|
|
|
|
skipsdist = True
|
|
|
|
|
|
|
|
[testenv]
|
2022-05-25 02:43:05 +08:00
|
|
|
allowlist_externals =
|
2020-01-30 20:00:47 +08:00
|
|
|
vagrant
|
|
|
|
bash
|
|
|
|
git
|
|
|
|
pip
|
|
|
|
passenv=*
|
|
|
|
setenv=
|
|
|
|
ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
|
2022-07-29 17:15:17 +08:00
|
|
|
ANSIBLE_COLLECTIONS_PATH = {envdir}/ansible_collections
|
2020-01-30 20:00:47 +08:00
|
|
|
ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
|
2022-07-29 17:15:17 +08:00
|
|
|
ANSIBLE_CALLBACK_ENABLED = profile_tasks
|
2020-01-30 20:00:47 +08:00
|
|
|
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
|
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
|
2020-01-30 20:00:47 +08:00
|
|
|
|
|
|
|
container: CONTAINER_DIR = /container
|
2020-03-31 20:08:30 +08:00
|
|
|
container: PLAYBOOK = site-container.yml.sample
|
2020-01-30 20:00:47 +08:00
|
|
|
non_container: PLAYBOOK = site.yml.sample
|
|
|
|
|
|
|
|
deps= -r{toxinidir}/tests/requirements.txt
|
|
|
|
changedir={toxinidir}/tests/functional/external_clients{env:CONTAINER_DIR:}
|
|
|
|
commands=
|
2022-07-29 17:15:17 +08:00
|
|
|
ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
|
2024-02-17 05:59:09 +08:00
|
|
|
bash {toxinidir}/tests/scripts/vagrant_up.sh {changedir} --no-provision {posargs:--provider=virtualbox}
|
2020-01-30 20:00:47 +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}/inventory {toxinidir}/tests/functional/setup.yml
|
2020-01-30 20:00:47 +08:00
|
|
|
|
|
|
|
# configure lvm
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/inventory/hosts {toxinidir}/tests/functional/lvm_setup.yml
|
2020-01-30 20:00:47 +08:00
|
|
|
|
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=True change_dir={changedir} ceph_dev_branch=main ceph_dev_sha1=latest" --tags "vagrant_setup"
|
|
|
|
ansible-playbook -vv --diff -i {changedir}/inventory/hosts {toxinidir}/{env:PLAYBOOK:site.yml.sample} --limit 'all:!clients' --extra-vars "\
|
2022-06-15 15:16:26 +08:00
|
|
|
yes_i_know=true \
|
2020-01-30 20:00:47 +08:00
|
|
|
delegate_facts_host={env:DELEGATE_FACTS_HOST:True} \
|
2022-05-25 02:40:00 +08:00
|
|
|
ceph_dev_branch=main \
|
2022-06-22 16:11:40 +08:00
|
|
|
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} \
|
2020-01-30 20:00:47 +08:00
|
|
|
"
|
|
|
|
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/inventory {toxinidir}/tests/functional/external_clients_admin_key.yml
|
2020-03-28 00:56:26 +08:00
|
|
|
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/inventory/external_clients-hosts {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\
|
2022-06-15 15:16:26 +08:00
|
|
|
yes_i_know=true \
|
2020-01-30 20:00:47 +08:00
|
|
|
ireallymeanit=yes \
|
|
|
|
fsid=40358a87-ab6e-4bdc-83db-1d909147861c \
|
|
|
|
external_cluster_mon_ips=192.168.31.10,192.168.31.11,192.168.31.12 \
|
|
|
|
generate_fsid=false \
|
2022-05-25 02:40:00 +08:00
|
|
|
ceph_dev_branch=main \
|
2022-06-22 16:11:40 +08:00
|
|
|
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} \
|
2020-01-30 20:00:47 +08:00
|
|
|
"
|
|
|
|
|
2020-03-28 00:56:26 +08:00
|
|
|
py.test --reruns 5 --reruns-delay 1 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/inventory/external_clients-hosts --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests/test_install.py::TestCephConf
|
2020-01-30 20:00:47 +08:00
|
|
|
|
2024-02-18 18:50:29 +08:00
|
|
|
ansible-playbook -vv --diff -i {changedir}/inventory/external_clients-hosts {toxinidir}/infrastructure-playbooks/rolling_update.yml --extra-vars "\
|
2020-09-10 22:12:13 +08:00
|
|
|
ireallymeanit=yes \
|
|
|
|
fsid=40358a87-ab6e-4bdc-83db-1d909147861c \
|
|
|
|
external_cluster_mon_ips=192.168.31.10,192.168.31.11,192.168.31.12 \
|
|
|
|
generate_fsid=false \
|
2022-05-25 02:40:00 +08:00
|
|
|
ceph_dev_branch=main \
|
2022-06-22 16:11:40 +08:00
|
|
|
ceph_dev_sha1=latest \
|
2020-09-10 22:12:13 +08:00
|
|
|
ceph_docker_registry_auth=True \
|
|
|
|
ceph_docker_registry_username={env:DOCKER_HUB_USERNAME} \
|
|
|
|
ceph_docker_registry_password={env:DOCKER_HUB_PASSWORD} \
|
|
|
|
"
|
|
|
|
|
|
|
|
py.test --reruns 5 --reruns-delay 1 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/inventory/external_clients-hosts --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests/test_install.py::TestCephConf
|
|
|
|
|
2020-01-30 20:00:47 +08:00
|
|
|
vagrant destroy --force
|