Devin Lim | 9c8fa3e | 2018-01-24 16:47:15 -0800 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | echo Test date: |
| 4 | date |
| 5 | |
| 6 | if [[ -z $NIGHTLY_FILE_NAME ]] |
| 7 | then |
| 8 | NIGHTLY_FILE_NAME=onos-$ONOS_VERSION.$(date +%Y%m%d)-NIGHTLY |
| 9 | fi |
| 10 | echo ONOS nightly file to use: $NIGHTLY_FILE_NAME |
| 11 | |
| 12 | echo $DELTA_PATH |
| 13 | |
| 14 | # Trigger DELTA tests |
| 15 | cd ~/OnosSystemTest/DELTA |
| 16 | if [ "$CLEANUP" = true ] |
| 17 | then |
| 18 | ./run-DELTA.sh -v -o $NIGHTLY_FILE_NAME -p $DELTA_PATH |
| 19 | else |
| 20 | ./run-DELTA.sh -o $NIGHTLY_FILE_NAME -p $DELTA_PATH |
| 21 | fi |
| 22 | |
| 23 | # Copy delta.log to logs folder |
| 24 | [[ -d logs ]] || mkdir logs |
| 25 | FOLDER_NAME=$(date +%Y_%m_%d_%H_%M_%S)-$NIGHTLY_FILE_NAME |
| 26 | mkdir logs/$FOLDER_NAME |
| 27 | cp delta.log logs/$FOLDER_NAME |
| 28 | rm delta.log |
| 29 | |
| 30 | echo "Job name is: ${JOB_NAME}" |
| 31 | echo "Workspace is: ${WORKSPACE}" |
| 32 | echo "Wiki page to post is: ${WIKI_PREFIX}" |
| 33 | |
| 34 | # Generate csv file for plot |
| 35 | cd ~/OnosSystemTest/DELTA |
| 36 | echo "Tests Failed,Tests Passed,Tests Triggered" > DELTA-nightly.csv |
| 37 | echo $(cat summary.txt | grep FAIL |wc -l)","$(cat summary.txt | grep PASS |wc -l)","$(cat summary.txt |wc -l) >> DELTA-nightly.csv |
| 38 | |
| 39 | # Remove any leftover files from previous tests |
| 40 | rm ${WORKSPACE}/*.txt |
| 41 | rm ${WORKSPACE}/*.csv |
| 42 | |
| 43 | # copy files to workspace |
| 44 | cp summary.txt ${WORKSPACE}/ |
| 45 | cp *.csv ${WORKSPACE}/ |
| 46 | rm summary.txt |
| 47 | rm *.csv |
| 48 | |
| 49 | # Generate summary file for wiki |
| 50 | cd ${WORKSPACE} |
| 51 | cp summary.txt summaryWiki.txt |
| 52 | sed -i '/PASS/s/.*/<li> & <ac:emoticon ac:name="tick" \/><\/li>/' summaryWiki.txt |
| 53 | sed -i '/FAIL/s/.*/<li> & <ac:emoticon ac:name="cross" \/><\/li>/' summaryWiki.txt |
| 54 | sed -i '/UNKNOWN/s/.*/<li> & <\/li>/' summaryWiki.txt |