blob: b17b41e99c5f3ab225ab5f1d60d7fcbdd7957299 [file] [log] [blame]
#!/bin/bash -i
#set -u # Exit on unset variables
shopt -s expand_aliases # expand alias in non-interactive mode
source ~/.bash_profile
export PYTHONUNBUFFERED=1
echo "${USER} is the current user."
echo "Test date: "
date
cd ~
source ~/onos/tools/dev/bash_profile
cell borrow 190 7+0 jhall hotel
export OCN=localhost
cell
#o
# TODO make this a build option
#git pull --ff-only
rm -rf ~/TestON/logs/HA*
stc teardown
cd ~/OnosSystemTest/TestON/bin
./copy-key-to-cells.sh
./cleanup.sh -f
sudo pkill python
./cli.py run ${TEST_NAME}
taillog
echo ${JOB_NAME##*/}
echo ${WORKSPACE}/
# remove any leftover files from previous tests
sudo rm ${WORKSPACE}/*Wiki.txt
sudo rm ${WORKSPACE}/*Summary.txt
sudo rm ${WORKSPACE}/*.csv
#copy files to workspace
cd `ls -t ~/OnosSystemTest/TestON/logs/*/ | head -1 | sed 's/://'`
sudo cp *.txt ${WORKSPACE}/
sudo cp *.csv ${WORKSPACE}/
ls -al ${WORKSPACE}
cd ${WORKSPACE}
mv ${TEST_NAME}.csv results.csv
ls -al ${WORKSPACE}
cd
cd ~/OnosSystemTest/TestON/logs
echo "Job Name is: ${JOB_NAME}"
TestONlogDir=$(ls -t | grep ${TEST_NAME}_ |head -1)
echo "########################################################################################"
echo "/n##### copying ONOS logs from all nodes to TestON/logs directory: ${TestONlogDir}#####"
echo "########################################################################################"
cd $TestONlogDir
if [ $? -eq 1 ]
then
echo "Job name does not match any test suite name to move log!"
else
pwd
for i in $OC{1..7}; do onos-fetch-logs $i; done
fi