done
fi
- cat > ${WORKSPACE}/controller-script.sh <<EOF
+ cat > ${WORKSPACE}/configuration-script.sh <<EOF
echo "Changing to /tmp"
cd /tmp
JAVA_RESOLVED=\`readlink -e "\${JAVA_HOME}/bin/java"\`
echo "Java binary pointed at by JAVA_HOME: \${JAVA_RESOLVED}"
+ EOF
+
+ # Create the startup script to be run on controller.
+ cat > ${WORKSPACE}/startup-script.sh <<EOF
+
echo "Starting controller..."
/tmp/${BUNDLEFOLDER}/bin/start
EOF
- scp ${WORKSPACE}/controller-script.sh ${ODL_SYSTEM_IP}:/tmp
- ssh ${ODL_SYSTEM_IP} 'bash /tmp/controller-script.sh'
+ # Execute the configuration script on controller.
+ scp ${WORKSPACE}/configuration-script.sh ${ODL_SYSTEM_IP}:/tmp
+ ssh ${ODL_SYSTEM_IP} 'bash /tmp/configuration-script.sh'
+
+ # Run config plan in case it exists
+ if [ -f ${WORKSPACE}/test/csit/configplans/${TESTPLAN} ]; then
+ echo "configplan exists!!!"
+ echo "Reading the configplan:"
+ cat ${WORKSPACE}/test/csit/configplans/${TESTPLAN} | sed "s:integration:${WORKSPACE}:" > configplan.txt
+ cat configplan.txt
+ for line in $( egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' configplan.txt ); do
+ echo "Executing ${line}..."
+ source ${line}
+ done
+ fi
+
+ # Copy over the startup script to controller and execute it.
+ scp ${WORKSPACE}/startup-script.sh ${ODL_SYSTEM_IP}:/tmp
+ ssh ${ODL_SYSTEM_IP} 'bash /tmp/startup-script.sh'
if [ ${NUM_OPENSTACK_SYSTEM} -gt 0 ]; then
echo "Exiting without running tests to deploy openstack for testing"
exit
fi
+echo "Lets's take the karaf thread dump"
+KARAF_PID=$(ssh ${ODL_SYSTEM_IP} "ps aux | grep 'distribution-karaf' | grep -v grep | tr -s ' ' | cut -f2 -d' '")
+ssh ${ODL_SYSTEM_IP} "jstack $KARAF_PID"> ${WORKSPACE}/karaf_threads_before.log
+
echo "Locating test plan to use..."
testplan_filepath="${WORKSPACE}/test/csit/testplans/${STREAMTESTPLAN}"
if [ ! -f "${testplan_filepath}" ]; then
-v MININET_USER:${USER} -v USER_HOME:${HOME} ${TESTOPTIONS} ${SUITES} || true
# FIXME: Sort (at least -v) options alphabetically.
+echo "Lets's take the karaf thread dump again"
+KARAF_PID=$(ssh ${ODL_SYSTEM_IP} "ps aux | grep 'distribution-karaf' | grep -v grep | tr -s ' ' | cut -f2 -d' '")
+ssh ${ODL_SYSTEM_IP} "jstack $KARAF_PID"> ${WORKSPACE}/karaf_threads_after.log
+
echo "Killing ODL and fetching Karaf log..."
set +e # We do not want to create red dot just because something went wrong while fetching logs.
ssh "${ODL_SYSTEM_IP}" bash -c 'ps axf | grep karaf | grep -v grep | awk '"'"'{print "kill -9 " $1}'"'"' | sh'