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