aboutsummaryrefslogtreecommitdiffstats
path: root/integration/storperf/start_job.sh
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2017-08-02 11:24:27 +0800
committerYujun Zhang <zhang.yujunz@zte.com.cn>2017-08-08 09:15:44 +0800
commitc420248ac1daed625ab0d05d1a663c877426701a (patch)
tree107f5a3b23b0061f3d56b98d4400de75a1c25074 /integration/storperf/start_job.sh
parentf708300052c2315994ba16793972ce0dfbfa237e (diff)
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 <zhang.yujunz@zte.com.cn>
Diffstat (limited to 'integration/storperf/start_job.sh')
-rwxr-xr-xintegration/storperf/start_job.sh7
1 files changed, 5 insertions, 2 deletions
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