diff options
| author | SamYaple <sam@yaple.net> | 2016-02-16 15:04:18 +0000 |
|---|---|---|
| committer | SamYaple <sam@yaple.net> | 2016-02-18 19:55:24 +0000 |
| commit | ae4407a2aba49984ad327e464b1964a8db0872d2 (patch) | |
| tree | 7a8952aa3ecc68d4921eb2a0b1f9df0dd3166c76 | |
| parent | 457ce3301ef2cddccd5af067e164b545f14e590e (diff) | |
| download | kolla-ae4407a2aba49984ad327e464b1964a8db0872d2.tar.gz kolla-ae4407a2aba49984ad327e464b1964a8db0872d2.zip | |
Launch VM in gate
Change-Id: I18b1015ca62a352e193ef01bd49cd6d6f9372193
Partially-Implements: blueprint functional-testing-gate
| -rwxr-xr-x | tools/deploy_aio.sh | 40 | ||||
| -rwxr-xr-x | tools/setup_gate.sh | 3 |
2 files changed, 35 insertions, 8 deletions
diff --git a/tools/deploy_aio.sh b/tools/deploy_aio.sh index 74d5b617a..3cd3bda29 100755 --- a/tools/deploy_aio.sh +++ b/tools/deploy_aio.sh @@ -8,7 +8,14 @@ export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" export KOLLA_BASE=$1 export KOLLA_TYPE=$2 +function copy_logs { + docker cp rsyslog:/var/log/ /tmp/logs +} + function check_failure { + # Command failures after this point can be expected + set +o errexit + docker ps -a failed_containers=$(docker ps -a --format "{{.Names}}" --filter status=exited) @@ -16,13 +23,18 @@ function check_failure { docker logs --tail all ${failed} done - journalctl --no-pager -u docker.service || : - cat /var/log/upstart/docker.log || : + journalctl --no-pager -u docker.service + cat /var/log/upstart/docker.log + + nova service-list + neutron agent-list - if [[ -n ${failed_containers} ]]; then - echo 'FAILED' - exit 1 - fi + nova list + nova list | awk '/4/ {print $2}' | xargs -n1 nova show + + # NOTE(SamYaple): The copy logs functions is put on hold until Heka is all + # merged in. At that point we will pull the logs from Heka's volume + #copy_logs } function write_configs { @@ -40,6 +52,11 @@ enable_horizon: "no" enable_heat: "no" EOF + cat << EOF > /etc/kolla/config/nova-compute.conf +[libvirt] +virt_type=qemu +EOF + cat << EOF > /etc/kolla/config/nova.conf [DEFAULT] osapi_compute_workers = 1 @@ -69,5 +86,14 @@ ip l a fake_interface type dummy # Actually do the deployment tools/kolla-ansible -vvv deploy +tools/kolla-ansible -vvv post-deploy + +# Test OpenStack Environment +source /etc/kolla/admin-openrc.sh +tools/init-runonce +# Wait for service ready +sleep 15 +nova boot --poll --image $(openstack image list | awk '/cirros/ {print $2}') --nic net-id=$(openstack network list | awk '/demo-net/ {print $2}') --flavor 1 kolla_boot_test -# TODO(SamYaple): Actually do functional testing of OpenStack +# If the status is not ACTIVE, print info and exit 1 +nova show kolla_boot_test | awk '{buf=buf"\n"$0} $2=="status" && $4!="ACTIVE" {failed="yes"}; END {if (failed=="yes") {print buf; exit 1}}' diff --git a/tools/setup_gate.sh b/tools/setup_gate.sh index c701e10ed..a8cd2836c 100755 --- a/tools/setup_gate.sh +++ b/tools/setup_gate.sh @@ -81,7 +81,8 @@ function setup_ansible { RAW_INVENTORY=/tmp/kolla/raw_inventory mkdir /tmp/kolla - sudo -H pip install "ansible<2" "docker-py>=1.6.0" + # TODO(SamYaple): Move to virtualenv + sudo -H pip install -U "ansible<2" "docker-py>=1.6.0" "python-openstackclient" "python-neutronclient" detect_distro setup_inventory |
