diff --git a/.gitignore b/.gitignore index 52f5d5864..e90c7e1b3 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,5 @@ designate/versioninfo /dnsmasq .testrepository/* contrib/vagrant/.vagrant/ +functionaltests/tempest.log +functionaltests/.testrepository/ diff --git a/contrib/devstack/lib/designate b/contrib/devstack/lib/designate index 1eb8ebb6c..f2c12ad57 100644 --- a/contrib/devstack/lib/designate +++ b/contrib/devstack/lib/designate @@ -57,6 +57,9 @@ DESIGNATE_TEST_NSREC=${DESIGNATE_TEST_NSREC:-ns1.devstack.org.} DESIGNATE_ENABLED_EXTENSIONS_V1=${DESIGNATE_ENABLED_EXTENSIONS_V1:-"quotas"} DESIGNATE_ENABLED_EXTENSIONS_V2=${DESIGNATE_ENABLED_EXTENSIONS_V2:-"quotas"} +# Tell Tempest this project is present +TEMPEST_SERVICES+=,designate + # Get backend configuration # ---------------------------- if is_service_enabled designate && [[ -r $DESIGNATE_PLUGINS/backend-$DESIGNATE_BACKEND_DRIVER ]]; then diff --git a/contrib/devstack/post_test_hook.sh b/contrib/devstack/post_test_hook.sh index 17d8da089..12f5c6e7e 100755 --- a/contrib/devstack/post_test_hook.sh +++ b/contrib/devstack/post_test_hook.sh @@ -4,3 +4,6 @@ set -ex # Run the Designate DevStack exercises $BASE/new/devstack/exercises/designate.sh + +# Run the Designate Tempest tests +sudo ./run_tempest_tests.sh diff --git a/contrib/devstack/run_tempest_tests.sh b/contrib/devstack/run_tempest_tests.sh new file mode 100755 index 000000000..c81eef82c --- /dev/null +++ b/contrib/devstack/run_tempest_tests.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# +# 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. + +# How many seconds to wait for the API to be responding before giving up +API_RESPONDING_TIMEOUT=20 + +if ! timeout ${API_RESPONDING_TIMEOUT} sh -c "while ! curl -s http://127.0.0.1:9001/ 2>/dev/null | grep -q 'v1' ; do sleep 1; done"; then + echo "The Designate API failed to respond within ${API_RESPONDING_TIMEOUT} seconds" + exit 1 +fi + +echo "Successfully contacted the Designate API" + +# Where Designate and Tempest code lives +DESIGNATE_DIR=${DESIGNATE_DIR:-/opt/stack/new/designate} +TEMPEST_DIR=${TEMPEST_DIR:-/opt/stack/new/tempest} + +# Install tempest +pip install -e $TEMPEST_DIR + +pushd $DESIGNATE_DIR/functionaltests + +# run the tests in parallel +testr init +testr run --parallel --subunit | subunit-trace --no-failure-debug -f +retval=$? +testr slowest + +popd + +exit $retval diff --git a/contrib/vagrant/localrc b/contrib/vagrant/localrc index 703959e80..00fb7eff2 100644 --- a/contrib/vagrant/localrc +++ b/contrib/vagrant/localrc @@ -37,6 +37,9 @@ ENABLED_SERVICES+=,designate,designate-central,designate-api,designate-pool-mana # Optional TLS Proxy #ENABLED_SERVICES+=,tls-proxy +# Optional Tempest +#ENABLED_SERVICES+=,tempest + # Optional Rally #ENABLED_SERVICES+=,rally diff --git a/functionaltests/__init__.py b/functionaltests/__init__.py index 071905439..e69de29bb 100644 --- a/functionaltests/__init__.py +++ b/functionaltests/__init__.py @@ -1,19 +0,0 @@ -""" -Copyright 2015 Rackspace - -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. -""" - -from tempest.config import CONF - -CONF.set_config_path('designate-tempest.conf')