From c444eca75b29dd5c36550772235eb0731bcda5b3 Mon Sep 17 00:00:00 2001
From: Steve Leon <kokhang@gmail.com>
Date: Wed, 6 May 2015 15:17:43 -0700
Subject: [PATCH] Add devstack gate job for Cue project

This job will run the API tests on devstack environment

Change-Id: Ie27db60dc06c8775316b76ad6f23fe2012ea0225
---
 jenkins/jobs/cue.yaml      | 46 ++++++++++++++++++++++++++++++++++++++
 jenkins/jobs/projects.yaml |  2 ++
 zuul/layout.yaml           |  4 ++++
 3 files changed, 52 insertions(+)
 create mode 100644 jenkins/jobs/cue.yaml

diff --git a/jenkins/jobs/cue.yaml b/jenkins/jobs/cue.yaml
new file mode 100644
index 0000000000..b2d95da029
--- /dev/null
+++ b/jenkins/jobs/cue.yaml
@@ -0,0 +1,46 @@
+- job-template:
+    name: 'gate-cue-integration-dsvm-{broker}'
+    node: 'devstack-precise || devstack-trusty'
+
+    wrappers:
+      - build-timeout:
+          timeout: 105
+      - timestamps
+
+    builders:
+      - link-logs
+      - net-info
+      - devstack-checkout
+      - shell: |
+          #!/bin/bash -xe
+          export PYTHONUNBUFFERED=true
+          export DEVSTACK_GATE_TIMEOUT=100
+          export DEVSTACK_GATE_INSTALL_TESTONLY=1
+          export DEVSTACK_GATE_TEMPEST=1
+          export DEVSTACK_GATE_TEMPEST_NOTESTS=1
+          export PROJECTS="stackforge/cue stackforge/python-cueclient $PROJECTS"
+
+          function gate_hook {{
+              cd /opt/stack/new/cue/tests
+              ./gate_hook.sh {broker}
+          }}
+          export -f gate_hook
+
+          function pre_test_hook {{
+              cd /opt/stack/new/cue/tests
+              ./pre_test_hook.sh {broker}
+          }}
+          export -f pre_test_hook
+
+          function post_test_hook {{
+              cd /opt/stack/new/cue/tests
+              ./post_test_hook.sh {broker}
+          }}
+          export -f post_test_hook
+
+          cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh
+          ./safe-devstack-vm-gate-wrap.sh
+
+    publishers:
+      - devstack-logs
+      - console-log
diff --git a/jenkins/jobs/projects.yaml b/jenkins/jobs/projects.yaml
index 7b2016cde1..410fe098f5 100755
--- a/jenkins/jobs/projects.yaml
+++ b/jenkins/jobs/projects.yaml
@@ -3638,6 +3638,8 @@
     jobs:
       - hook-{name}-rtfd
       - python-jobs
+      - 'gate-cue-integration-dsvm-{broker}':
+          broker: 'rabbitmq'
 
 - project:
     name: cue-dashboard
diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 440ea1d832..642da9d80b 100755
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -904,6 +904,9 @@ jobs:
   - name: gate-cloudkitty-dashboard-python34
     voting: false
 
+  - name: gate-cue-integration-dsvm-rabbitmq
+    voting: false
+
   - name: gate-hacking-python34
     voting: false
 
@@ -5317,6 +5320,7 @@ projects:
       - name: python-jobs
     check:
       - cue-coverage
+      - gate-cue-integration-dsvm-rabbitmq
     pre-release:
       - cue-tarball
     release: