diff --git a/tests/deploy.sh b/tests/deploy.sh index efeb3c1a708274cfbd89b3052b910be121f01a8a..f54e67cdf20ca07be4aeffd3c0e9ac352ea3abf0 100755 --- a/tests/deploy.sh +++ b/tests/deploy.sh @@ -22,7 +22,10 @@ function deploy { tools/kolla-ansible -i ${RAW_INVENTORY} -vvv deploy &> /tmp/logs/ansible/deploy tools/kolla-ansible -i ${RAW_INVENTORY} -vvv post-deploy &> /tmp/logs/ansible/post-deploy tools/kolla-ansible -i ${RAW_INVENTORY} -vvv check &> /tmp/logs/ansible/check-deploy + . /etc/kolla/admin-openrc.sh + . ~/openstackclient-venv/bin/activate + # Wait for service ready sleep 15 diff --git a/tests/test-ironic.sh b/tests/test-ironic.sh index 4a5fcbb62a5a75d16a38b03e4cbe12674f6c6fab..f92c8222ce810f5ef6628112b7d5e71dba29b99b 100755 --- a/tests/test-ironic.sh +++ b/tests/test-ironic.sh @@ -96,7 +96,7 @@ function create_resources { function test_ironic_logged { # Assumes init-runonce has been executed. . /etc/kolla/admin-openrc.sh - . ~/ironic-venv/bin/activate + . ~/openstackclient-venv/bin/activate # Smoke test ironic API. if ! openstack baremetal driver list | grep fake-hardware; then diff --git a/tests/test-openstack.sh b/tests/test-openstack.sh index b4e0814b416b8b7d706672b2cf8bdd6424dc88b1..37724b8c14818ea8af559be662a903ed953d7cb4 100755 --- a/tests/test-openstack.sh +++ b/tests/test-openstack.sh @@ -8,6 +8,7 @@ export PYTHONUNBUFFERED=1 function test_openstack_logged { . /etc/kolla/admin-openrc.sh + . ~/openstackclient-venv/bin/activate openstack --debug compute service list openstack --debug network agent list diff --git a/tests/test-scenario-nfv.sh b/tests/test-scenario-nfv.sh index 5fe01340be948125915305380cbfd855024d13bf..8388ed3cec592efc6d9f8ac605b358002b02a86b 100755 --- a/tests/test-scenario-nfv.sh +++ b/tests/test-scenario-nfv.sh @@ -50,11 +50,13 @@ function test_heat { function install_requirements { echo "TESTING: Install requirements" - sudo -H pip install --ignore-installed -U "python-tackerclient" "python-heatclient" "networking-sfc" "python-mistralclient" "python-barbicanclient" + pip install "python-tackerclient" "python-heatclient" "networking-sfc" "python-mistralclient" "python-barbicanclient" } function test_scenario_nfv_logged { . /etc/kolla/admin-openrc.sh + . ~/openstackclient-venv/bin/activate + install_requirements test_tacker test_barbican diff --git a/tools/setup_gate.sh b/tools/setup_gate.sh index 54922f6024dd7dc7a414a5d8d4112ce44414fa55..e5da68d985b1db169b68055354654c79ab946fca 100755 --- a/tools/setup_gate.sh +++ b/tools/setup_gate.sh @@ -8,6 +8,19 @@ export PYTHONUNBUFFERED=1 GIT_PROJECT_DIR=$(mktemp -d) +function setup_openstack_clients { + # Prepare virtualenv for openstack deployment tests + virtualenv ~/openstackclient-venv + ~/openstackclient-venv/bin/pip install -U pip + ~/openstackclient-venv/bin/pip install python-openstackclient + if [[ $ACTION == zun ]]; then + ~/openstackclient-venv/bin/pip install python-zunclient + fi + if [[ $ACTION == ironic ]]; then + ~/openstackclient-venv/bin/pip install python-ironicclient + fi +} + function setup_config { # Use Infra provided pypi. # Wheel package mirror may be not compatible. So do not enable it. @@ -98,18 +111,10 @@ function setup_ansible { else ANSIBLE_VERSION="<2.6" fi + # TODO(SamYaple): Move to virtualenv - sudo -H pip install -U "ansible${ANSIBLE_VERSION}" "docker>=2.0.0" "python-openstackclient" "ara<1.0.0" "cmd2<0.9.0" - if [[ $ACTION == "zun" ]]; then - sudo -H pip install -U "python-zunclient" - fi - if [[ $ACTION == ironic ]]; then - # NOTE(mgoddard): Installing python-ironicclient to site-packages fails - # due to pip 10 distutils issue with ipaddress package. - virtualenv ~/ironic-venv - ~/ironic-venv/bin/pip install -U pip - ~/ironic-venv/bin/pip install python-openstackclient python-ironicclient - fi + sudo pip install -U "ansible${ANSIBLE_VERSION}" "ara<1.0.0" + detect_distro sudo mkdir /etc/ansible @@ -138,6 +143,8 @@ function prepare_images { popd } +setup_openstack_clients + setup_ansible setup_config setup_node