blob: b17b41e99c5f3ab225ab5f1d60d7fcbdd7957299 [file] [log] [blame]
Devin Limb00d26a2018-02-01 17:27:59 -08001#!/bin/bash -i
2#set -u # Exit on unset variables
3shopt -s expand_aliases # expand alias in non-interactive mode
4source ~/.bash_profile
5export PYTHONUNBUFFERED=1
6
7
8
9echo "${USER} is the current user."
10echo "Test date: "
11date
12
13cd ~
14source ~/onos/tools/dev/bash_profile
15cell borrow 190 7+0 jhall hotel
16export OCN=localhost
17cell
18
19#o
20# TODO make this a build option
21#git pull --ff-only
22
23rm -rf ~/TestON/logs/HA*
24stc teardown
25
26cd ~/OnosSystemTest/TestON/bin
27./copy-key-to-cells.sh
28./cleanup.sh -f
29sudo pkill python
30./cli.py run ${TEST_NAME}
31taillog
32
33echo ${JOB_NAME##*/}
34echo ${WORKSPACE}/
35
36# remove any leftover files from previous tests
37sudo rm ${WORKSPACE}/*Wiki.txt
38sudo rm ${WORKSPACE}/*Summary.txt
39sudo rm ${WORKSPACE}/*.csv
40
41#copy files to workspace
42cd `ls -t ~/OnosSystemTest/TestON/logs/*/ | head -1 | sed 's/://'`
43sudo cp *.txt ${WORKSPACE}/
44sudo cp *.csv ${WORKSPACE}/
45ls -al ${WORKSPACE}
46cd ${WORKSPACE}
47mv ${TEST_NAME}.csv results.csv
48ls -al ${WORKSPACE}
49cd
50
51cd ~/OnosSystemTest/TestON/logs
52echo "Job Name is: ${JOB_NAME}"
53TestONlogDir=$(ls -t | grep ${TEST_NAME}_ |head -1)
54echo "########################################################################################"
55echo "/n##### copying ONOS logs from all nodes to TestON/logs directory: ${TestONlogDir}#####"
56echo "########################################################################################"
57cd $TestONlogDir
58if [ $? -eq 1 ]
59then
60 echo "Job name does not match any test suite name to move log!"
61else
62 pwd
63 for i in $OC{1..7}; do onos-fetch-logs $i; done
64fi