Skip to content

Commit

Permalink
tests: run vagrant_up.sh from dirname
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Abrioux <[email protected]>
  • Loading branch information
guits committed Mar 15, 2024
1 parent b60e013 commit 3c0e06e
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 12 deletions.
11 changes: 10 additions & 1 deletion tests/scripts/vagrant_up.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/bin/bash
set -x
if [[ -n $1 ]]; then
DIRECTORY=$1
shift
else
DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
fi
pushd "${DIRECTORY}"

if [[ "${CEPH_ANSIBLE_VAGRANT_BOX}" =~ "centos/stream" ]]; then
EL_VERSION="${CEPH_ANSIBLE_VAGRANT_BOX: -1}"
Expand All @@ -16,4 +24,5 @@ do
sleep 5
done

sleep 10
sleep 10
popd
2 changes: 1 addition & 1 deletion tox-cephadm.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ changedir= {toxinidir}/tests/functional/cephadm

commands=
ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/vagrant_up.sh {changedir} --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}

ansible-playbook -vv --diff -i {changedir}/hosts {toxinidir}/infrastructure-playbooks/cephadm.yml --extra-vars "\
Expand Down
2 changes: 1 addition & 1 deletion tox-docker2podman.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ changedir= {toxinidir}/tests/functional/docker2podman

commands=
ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/vagrant_up.sh {changedir} --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}

# configure lvm
Expand Down
2 changes: 1 addition & 1 deletion tox-external_clients.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ deps= -r{toxinidir}/tests/requirements.txt
changedir={toxinidir}/tests/functional/external_clients{env:CONTAINER_DIR:}
commands=
ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/vagrant_up.sh {changedir} --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}

ansible-playbook -vv --diff -i {changedir}/inventory {toxinidir}/tests/functional/setup.yml
Expand Down
2 changes: 1 addition & 1 deletion tox-podman.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ changedir= {toxinidir}/tests/functional/podman

commands=
ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/vagrant_up.sh {changedir} --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}

# configure lvm
Expand Down
4 changes: 2 additions & 2 deletions tox-rbdmirror.ini
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ deps= -r{toxinidir}/tests/requirements.txt
changedir={toxinidir}/tests/functional/rbdmirror{env:CONTAINER_DIR:}
commands=
ansible-galaxy install -r {toxinidir}/requirements.yml -v
bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/vagrant_up.sh {changedir} --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}

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"
Expand All @@ -63,7 +63,7 @@ commands=
ceph_docker_registry_password={env:DOCKER_HUB_PASSWORD} \
"

bash -c "cd {changedir}/secondary && bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}"
bash -c "cd {changedir}/secondary && bash {toxinidir}/tests/scripts/vagrant_up.sh {changedir}/secondary --no-provision {posargs:--provider=virtualbox}"
bash -c "cd {changedir}/secondary && bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}/secondary"
ansible-playbook --ssh-common-args='-F {changedir}/secondary/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey' -vv -i {changedir}/secondary/hosts {toxinidir}/tests/functional/setup.yml
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}/secondary ceph_dev_branch={env:CEPH_DEV_BRANCH:main} ceph_dev_sha1={env:CEPH_DEV_SHA1:latest}" --tags "vagrant_setup"
Expand Down
2 changes: 1 addition & 1 deletion tox-shrink_osd.ini
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ commands=
ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
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"

bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/vagrant_up.sh {changedir} --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}

# configure lvm
Expand Down
2 changes: 1 addition & 1 deletion tox-subset_update.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ deps= -r{toxinidir}/tests/requirements.txt
changedir={toxinidir}/tests/functional/subset_update{env:CONTAINER_DIR:}
commands=
ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/vagrant_up.sh {changedir} --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}

ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/setup.yml
Expand Down
2 changes: 1 addition & 1 deletion tox-update.ini
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ setenv=
deps= -r{toxinidir}/tests/requirements.txt
changedir={toxinidir}/tests/functional/all_daemons{env:CONTAINER_DIR:}
commands=
bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/vagrant_up.sh {changedir} --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}

ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ setenv=
deps= -r{toxinidir}/tests/requirements.txt
changedir={toxinidir}/tests/functional/infra_lv_create
commands=
bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/vagrant_up.sh {changedir} --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}

ansible-playbook -vv --diff -i {changedir}/hosts {toxinidir}/infrastructure-playbooks/lv-create.yml
Expand Down Expand Up @@ -330,7 +330,7 @@ commands=
ansible-galaxy collection install -r {toxinidir}/requirements.yml -v -p {envdir}/ansible_collections
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"

bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/vagrant_up.sh {changedir} --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}

# configure lvm, we exclude osd2 given this node uses lvm batch scenario (see corresponding inventory host file)
Expand Down

0 comments on commit 3c0e06e

Please sign in to comment.