From 43cccf3a05882e5550db4f2db4673cbb99ecf2d1 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Sun, 2 Apr 2017 10:48:44 -0400 Subject: [PATCH] Tweak hooks for golang dsvm job $BASE is not yet defined when the gate hooks are registered, so we cannot check for the existence of those files. Instead we check the existence of files when the hooks are run. Also if the gate hook is not defined then we do what is usually done which is to run the devstack-vm-gate.sh script Change-Id: I8e664f6633289a8514834598d72f82cc403497f4 --- jenkins/jobs/golang-jobs.yaml | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/jenkins/jobs/golang-jobs.yaml b/jenkins/jobs/golang-jobs.yaml index 6d6c1f32d0..658a0a895f 100644 --- a/jenkins/jobs/golang-jobs.yaml +++ b/jenkins/jobs/golang-jobs.yaml @@ -72,26 +72,28 @@ services+=,q-svc,q-dhcp,q-meta,q-agt,q-l3 export OVERRIDE_ENABLED_SERVICES=$services - if [[ -f "$BASE/new/{name}/contrib/pre_test_hook.sh" ]]; then - function pre_test_hook {{ + function pre_test_hook {{ + if [[ -f "$BASE/new/{name}/contrib/pre_test_hook.sh" ]]; then source $BASE/new/{name}/contrib/pre_test_hook.sh - }} - export -f pre_test_hook - fi + fi + }} + export -f pre_test_hook - if [[ -f "$BASE/new/{name}/contrib/gate_hook.sh" ]]; then - function gate_hook {{ + function gate_hook {{ + if [[ -f "$BASE/new/{name}/contrib/gate_hook.sh" ]]; then source $BASE/new/{name}/contrib/gate_hook.sh - }} - export -f gate_hook - fi + else + $BASE/new/devstack-gate/devstack-vm-gate.sh + fi + }} + export -f gate_hook - if [[ -f "$BASE/new/{name}/contrib/post_test_hook.sh" ]]; then - function post_test_hook {{ - source $BASE/new/{name}/contrib/post_test_hook.sh '{suite}' - }} - export -f post_test_hook - fi + function post_test_hook {{ + if [[ -f "$BASE/new/{name}/contrib/post_test_hook.sh" ]]; then + source $BASE/new/{name}/contrib/post_test_hook.sh + fi + }} + 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