From 057398f8fad345f9f3b8d44a7c7a058c48c0aa7c Mon Sep 17 00:00:00 2001
From: Steve Baker <sbaker@redhat.com>
Date: Mon, 25 Aug 2014 11:02:09 +1200
Subject: [PATCH] check-heat-dsvm-functional pre/post hooks

This change calls pre_test_hook.sh and post_test_hook.sh
in the heat source tree.
(related change I174429c16bb606c5c325ee8b62c6e600ea77a6e6)

This will have the side-effect of fixing the job check-heat-dsvm-functional
since post_test_hook.sh will call tox with sudo.

Change-Id: I6339eb82649fa6770e8da6c2b4d01ba58028d23a
---
 .../files/jenkins_job_builder/config/heat.yaml     | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/modules/openstack_project/files/jenkins_job_builder/config/heat.yaml b/modules/openstack_project/files/jenkins_job_builder/config/heat.yaml
index 1a86c0be7b..cb84073ea0 100644
--- a/modules/openstack_project/files/jenkins_job_builder/config/heat.yaml
+++ b/modules/openstack_project/files/jenkins_job_builder/config/heat.yaml
@@ -50,18 +50,24 @@
           export DEVSTACK_GATE_NEUTRON=1
           export DEVSTACK_GATE_TEMPEST=0
           export DEVSTACK_GATE_EXERCISES=0
-          export HEAT_CREATE_TEST_IMAGE=True
+
           export BRANCH_OVERRIDE={branch-override}
           if [ "$BRANCH_OVERRIDE" != "default" ] ; then
               export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
           fi
 
+          function pre_test_hook {{
+              cd /opt/stack/new/heat/heat_integrationtests
+              ./pre_test_hook.sh
+          }}
+          export -f pre_test_hook
+
           function post_test_hook {{
-              source /opt/stack/new/devstack/accrc/demo/demo
-              cd /opt/stack/new/heat
-              tox -efunctional
+              cd /opt/stack/new/heat/heat_integrationtests
+              ./post_test_hook.sh
           }}
           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