From 1f724b754db10a3f6913ce0703bb2767fef32aa6 Mon Sep 17 00:00:00 2001 From: Noam Bloom Date: Tue, 12 Apr 2016 15:23:48 +0300 Subject: [PATCH] Add tempest tests to Gerrit Gate - Experimental Change-Id: I694e3412d32e1125e388f7520d5b7b2598479edc --- devstack/files/tempest/tempest.conf | 34 +++++++++++++++++++++++ devstack/gate_hook.sh | 42 +++++++++++++++++++++++++++++ devstack/post_test_hook.sh | 33 +++++++++++++++++++++++ devstack/pre_test_hook.sh | 14 ++++++++++ 4 files changed, 123 insertions(+) create mode 100644 devstack/files/tempest/tempest.conf create mode 100644 devstack/gate_hook.sh create mode 100644 devstack/post_test_hook.sh create mode 100644 devstack/pre_test_hook.sh diff --git a/devstack/files/tempest/tempest.conf b/devstack/files/tempest/tempest.conf new file mode 100644 index 000000000..595ce9ab5 --- /dev/null +++ b/devstack/files/tempest/tempest.conf @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +# Copyright 2015 - Alcatel-Lucent +# Copyright 2016 - Nokia +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +[identity] + +username = demo +password = password +tenant_name = demo +domain_name = default +admin_username = admin +admin_password = password +admin_domain_name = default +admin_tenant_name = admin +use_ssl = False +auth_version = v3 +uri = http://127.0.0.1:5000/v2.0/ +uri_v3 = http://127.0.0.1:35357/v3/ + +[auth] + +use_dynamic_credentials = true \ No newline at end of file diff --git a/devstack/gate_hook.sh b/devstack/gate_hook.sh new file mode 100644 index 000000000..38a38a5f9 --- /dev/null +++ b/devstack/gate_hook.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# Copyright 2016 - Nokia +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +export DEVSTACK_GATE_NEUTRON=1 +export DEVSTACK_GATE_TEMPEST=1 +export DEVSTACK_GATE_TEMPEST_ALL=1 +export DEVSTACK_GATE_TEMPEST_FULL=0 +export DEVSTACK_GATE_TEMPEST_ALL_PLUGINS=0 +export DEVSTACK_GATE_TEMPEST_REGEX="vitrage_tempest_tests" + +if [ -z ${DEVSTACK_LOCAL_CONFIG+x} ]; then + DEVSTACK_LOCAL_CONFIG="enable_plugin vitrage git://git.openstack.org/openstack/vitrage" +fi + +DEVSTACK_LOCAL_CONFIG+=$'\n'"enable_plugin ceilometer https://git.openstack.org/openstack/ceilometer" +DEVSTACK_LOCAL_CONFIG+=$'\n'"enable_plugin aodh git://git.openstack.org/openstack/aodh" +export DEVSTACK_LOCAL_CONFIG + +if [ -z ${ENABLED_SERVICES+x} ]; then + ENABLED_SERVICES=tempest +fi + +ENABLED_SERVICES+=key,aodi-api,aodh-notifier,aodh-evaluator +ENABLED_SERVICES+=ceilometer-acompute,ceilometer-acentral,ceilometer-anotification,ceilometer-collector +ENABLED_SERVICES+=ceilometer-alarm-evaluator,ceilometer-alarm-notifier +ENABLED_SERVICES+=ceilometer-api +export ENABLED_SERVICES +export KEEP_LOCALRC=1 + +$BASE/new/devstack-gate/devstack-vm-gate.sh \ No newline at end of file diff --git a/devstack/post_test_hook.sh b/devstack/post_test_hook.sh new file mode 100644 index 000000000..57ca2c5a2 --- /dev/null +++ b/devstack/post_test_hook.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Copyright 2016 - Nokia +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +(cd $BASE/new/tempest/; sudo virtualenv .venv) +source $BASE/new/tempest/.venv/bin/activate + +(cd $BASE/new/tempest/; sudo pip install -r requirements.txt -r test-requirements.txt) +sudo pip install nose + +(cd $BASE/new/tempest/; sudo oslo-config-generator --config-file etc/config-generator.tempest.conf --output-file etc/tempest.conf) +(cd $BASE/new/; sudo sh -c 'cat vitrage/devstack/files/tempest/tempest.conf >> tempest/etc/tempest.conf') + +sudo cp $BASE/new/tempest/etc/logging.conf.sample $BASE/new/tempest/etc/logging.conf + +(cd $BASE/new/vitrage/; sudo pip install -r requirements.txt -r test-requirements.txt) +(cd $BASE/new/vitrage/; sudo python setup.py install) + +(cd $BASE/new/tempest/; sudo testr init) + +(cd $BASE/new/tempest/; sudo sh -c 'testr list-tests vitrage_tempest_tests > vitrage_tempest_tests') +(cd $BASE/new/tempest/; sudo sh -c 'testr run --subunit --load-list=vitrage_tempest_tests | subunit-trace --fails') \ No newline at end of file diff --git a/devstack/pre_test_hook.sh b/devstack/pre_test_hook.sh new file mode 100644 index 000000000..bb8fb633e --- /dev/null +++ b/devstack/pre_test_hook.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# Copyright 2016 - Nokia +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. \ No newline at end of file