From c420248ac1daed625ab0d05d1a663c877426701a Mon Sep 17 00:00:00 2001 From: Yujun Zhang Date: Wed, 2 Aug 2017 11:24:27 +0800 Subject: Fix bug in running storperf.sh when WORKSPACE is defined When working directory changes, the script and default configuration will not be found. Change-Id: Iab6e4f9b014c12a863498de42553b043357aa876 Signed-off-by: Yujun Zhang --- integration/storperf/start_job.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'integration/storperf/start_job.sh') diff --git a/integration/storperf/start_job.sh b/integration/storperf/start_job.sh index 363072f6..e94356e5 100755 --- a/integration/storperf/start_job.sh +++ b/integration/storperf/start_job.sh @@ -26,11 +26,14 @@ while getopts ":s:j:he" optchar; do esac done +# See https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within +script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + if [[ -z $WORKSPACE ]];then WORKSPACE=`pwd` fi -source $WORKSPACE/openstack.sh +source $script_dir/openstack.sh echo ========================================================================== echo "Start to create storperf stack" @@ -65,7 +68,7 @@ else JOB_STATUS=`cat $WORKSPACE/status.json | awk '/Status/ {print $2}' | cut -d\" -f2` while [ "$JOB_STATUS" != "Completed" ] do - sleep 300 + sleep 30 mv $WORKSPACE/status.json $WORKSPACE/old-status.json curl -s -X GET "http://127.0.0.1:5000/api/v1.0/jobs?id=$JOB&type=status" \ -o $WORKSPACE/status.json -- cgit 1.2.3-korg