#!/bin/bash
#set -v
#Get the Test dir from the build Plan Name or from command line

TOP_DIR=`pwd`
TEST=`echo $1 | awk -F " - " '{print $3}'`
shift
cd test/core/$TEST

echo "TEST is $TEST"
pwd

#Launch the test

. ./run-bamboo-test "$@"

STATUS=$?
if [ $STATUS != 0 ]; then
   echo "Workflow submission failed"
   exit $STATUS
fi

#Get RUNDIR from the planning output
echo "RUNDIR is $RUN_DIR"

# Change in to the rundir
cd $RUN_DIR

# REPORT LAST FEW LINES OF JOBSTATE.log

tail -10 jobstate.log

exit
