Browse Source

Add Tempest Plugin to DevStack Plugin

Additionally, execute the tests in the gate

Change-Id: I58930c40243068e97ff8f6f1684cfbe5565ac7f1
Depends-On: I7733e8786d6b525a7c9a8d4f12add329cd030d9d
Depends-On: Ic1ee7f8bfea7954fca4057b74b76fcb502bb782d
Partially-Implements: blueprint designate-tempest-plugin
Kiall Mac Innes 3 years ago
parent
commit
fc2fe86807

+ 8
- 0
contrib/vagrant/Vagrantfile View File

@@ -26,6 +26,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
26 26
       override.vm.synced_folder "../../../designate-dashboard", "/opt/stack/designate-dashboard"
27 27
     end
28 28
 
29
+    if File.directory?("../../../designate-tempest-plugin")
30
+      override.vm.synced_folder "../../../designate-tempest-plugin", "/opt/stack/designate-tempest-plugin"
31
+    end
32
+
29 33
     if File.directory?("../../../../openstack/rally")
30 34
       override.vm.synced_folder "../../../../openstack/rally", "/opt/stack/rally"
31 35
     end
@@ -50,6 +54,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
50 54
       override.vm.synced_folder "../../../designate-dashboard", "/opt/stack/designate-dashboard", type: "nfs"
51 55
     end
52 56
 
57
+    if File.directory?("../../../designate-tempest-plugin")
58
+      override.vm.synced_folder "../../../designate-tempest-plugin", "/opt/stack/designate-tempest-plugin", type: "nfs"
59
+    end
60
+
53 61
     if File.directory?("../../../../openstack/rally")
54 62
       override.vm.synced_folder "../../../../openstack/rally", "/opt/stack/rally", type: "nfs"
55 63
     end

+ 2
- 2
contrib/vagrant/local.conf View File

@@ -106,8 +106,8 @@ enable_service designate,designate-central,designate-api,designate-pool-manager,
106 106
 # Optional TLS Proxy
107 107
 #enable_service tls-proxy
108 108
 
109
-# Optional Tempest
110
-#enable_service tempest
109
+# Optional Tempest (Recommended)
110
+enable_service tempest
111 111
 
112 112
 # Optional Rally
113 113
 #enable_service rally

+ 4
- 0
devstack/gate/post_test_hook.sh View File

@@ -8,6 +8,10 @@ $BASE/new/designate/devstack/exercise.sh
8 8
 # Import functions needed for the below workaround
9 9
 source $BASE/new/devstack/functions
10 10
 
11
+# Run the new style tempest plugin first, so the workaround below is not
12
+# applied.
13
+sudo BASE=$BASE ./run_tempest_plugin.sh
14
+
11 15
 # Workaround for Tempest architectural changes
12 16
 # See bugs:
13 17
 # 1) https://bugs.launchpad.net/manila/+bug/1531049

+ 33
- 0
devstack/gate/run_tempest_plugin.sh View File

@@ -0,0 +1,33 @@
1
+#!/bin/bash -e
2
+#
3
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
4
+# not use this file except in compliance with the License. You may obtain
5
+# a copy of the License at
6
+#
7
+#      http://www.apache.org/licenses/LICENSE-2.0
8
+#
9
+# Unless required by applicable law or agreed to in writing, software
10
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
+# License for the specific language governing permissions and limitations
13
+# under the License.
14
+
15
+# TODO(kiall): One old style tests are no longer used, we should switch from
16
+# this pattern for executing the tests to a true tempest gate job.
17
+
18
+# How many seconds to wait for the API to be responding before giving up
19
+API_RESPONDING_TIMEOUT=20
20
+
21
+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
22
+    echo "The Designate API failed to respond within ${API_RESPONDING_TIMEOUT} seconds"
23
+    exit 1
24
+fi
25
+
26
+echo "Successfully contacted the Designate API"
27
+
28
+# Where Tempest code lives
29
+TEMPEST_DIR=${TEMPEST_DIR:-"$BASE/new/tempest"}
30
+
31
+pushd $TEMPEST_DIR
32
+tox -e all-plugin -- designate
33
+popd

+ 11
- 0
devstack/plugin.sh View File

@@ -262,6 +262,12 @@ function install_designatedashboard {
262 262
     ln -fs $DESIGNATEDASHBOARD_DIR/designatedashboard/enabled/_1720_project_dns_panel.py $HORIZON_DIR/openstack_dashboard/local/enabled/_1720_project_dns_panel.py
263 263
 }
264 264
 
265
+# install_designatetempest - Collect source and prepare
266
+function install_designatetempest {
267
+    git_clone_by_name "designate-tempest-plugin"
268
+    setup_dev_lib "designate-tempest-plugin"
269
+}
270
+
265 271
 # start_designate - Start running processes, including screen
266 272
 function start_designate {
267 273
     start_designate_backend
@@ -313,6 +319,11 @@ if is_service_enabled designate; then
313 319
             install_designatedashboard
314 320
         fi
315 321
 
322
+        if is_service_enabled tempest; then
323
+            echo_summary "Installing Designate Tempest Plugin"
324
+            install_designatetempest
325
+        fi
326
+
316 327
     elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
317 328
         echo_summary "Configuring Designate"
318 329
         configure_designate

+ 4
- 0
devstack/settings View File

@@ -42,6 +42,10 @@ DESIGNATEDASHBOARD_REPO=${DESIGNATEDASHBOARD_REPO:-${GIT_BASE}/openstack/designa
42 42
 DESIGNATEDASHBOARD_BRANCH=${DESIGNATEDASHBOARD_BRANCH:-master}
43 43
 GITDIR["python-designateclient"]=$DEST/python-designateclient
44 44
 
45
+GITREPO["designate-tempest-plugin"]=${DESIGNATETEMPEST_REPO:-${GIT_BASE}/openstack/designate-tempest-plugin.git}
46
+GITBRANCH["designate-tempest-plugin"]=${DESIGNATETEMPEST_BRANCH:-master}
47
+GITDIR["designate-tempest-plugin"]=$DEST/designate-tempest-plugin
48
+
45 49
 # Tell Tempest this project is present
46 50
 TEMPEST_SERVICES+=,designate
47 51
 

Loading…
Cancel
Save