From 90c708c10ee96fe4cdb23a0db86d7d5a8ce1ba3d Mon Sep 17 00:00:00 2001
From: frtabu <francois.taburet@nokia-bell-labs.com>
Date: Fri, 23 Aug 2019 19:08:09 +0200
Subject: [PATCH] bug fixing in the way customized behavior of CI depending of
 jenkins server is triggered

---
 ci-scripts/oai-ci-vm-tool | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/ci-scripts/oai-ci-vm-tool b/ci-scripts/oai-ci-vm-tool
index 6c8ae9ad25..07ecb54a0f 100755
--- a/ci-scripts/oai-ci-vm-tool
+++ b/ci-scripts/oai-ci-vm-tool
@@ -146,9 +146,9 @@ function platform_set {
 	if [ "$TESTPLATFORM_OWNER" != "" ]
 	then
 	  echo "Running on $TESTPLATFORM_OWNER platform"
-	  if [ -x "${TESTPLATFORM_OWNER}_setenv.sh" ]
+	  if [ -x "/usr/local/bin/oai_${TESTPLATFORM_OWNER}_setenv.sh" ]
 	  then
-	    . ${TESTPLATFORM_OWNER}_setenv.sh
+	    . /usr/local/bin/oai_${TESTPLATFORM_OWNER}_setenv.sh
 	  fi
 	fi
 }
@@ -157,7 +157,8 @@ function setvar_usage {
 	declare -A HELP_VAR
 	HELP_VAR["VM_OSREL"]="OS release to use in virtual machines"
 	HELP_VAR["RUN_EXPERIMENTAL"]="Enforce execution of variants with EXPERIMENTAL variable set to \"true\"" 
-        HELP_VAR["OPTIONAL_APTCACHER"]="build and Run tests will fail if apt-cacher not installed and this variable not set to \"true\"" 
+    HELP_VAR["OPTIONAL_APTCACHER"]="build and Run tests will fail if apt-cacher not installed and this variable not set to \"true\""
+    HELP_VAR["TESTPLATFORM_OWNER"]="Allow pipeline customization via execution of an externel scripts residing on the jenkins server" 
     echo "--setvar_<varname> <value> where varname is one of:"
 	for i in ${AUTHORIZED_VAR[@]}; do printf "%20s :     %s\n" "$i" "${HELP_VAR[$i]}" ;done
 }
@@ -456,7 +457,7 @@ RUN_OPTIONS="none"
 
 
 # list of variables that can be set via the --setvar option
-AUTHORIZED_VAR=("VM_OSREL RUN_EXPERIMENTAL OPTIONAL_APTCACHER")
+AUTHORIZED_VAR=("VM_OSREL RUN_EXPERIMENTAL OPTIONAL_APTCACHER TESTPLATFORM_OWNER")
 
 
 #variables to set which OS VM should use
-- 
2.26.2