| #!/bin/bash |
| |
| echo Test date: |
| date |
| |
| if [[ -z $NIGHTLY_FILE_NAME ]] |
| then |
| NIGHTLY_FILE_NAME=onos-$ONOS_VERSION.$(date +%Y%m%d)-NIGHTLY |
| fi |
| echo ONOS nightly file to use: $NIGHTLY_FILE_NAME |
| |
| echo $DELTA_PATH |
| |
| # Trigger DELTA tests |
| cd ~/OnosSystemTest/DELTA |
| if [ "$CLEANUP" = true ] |
| then |
| ./run-DELTA.sh -v -o $NIGHTLY_FILE_NAME -p $DELTA_PATH |
| else |
| ./run-DELTA.sh -o $NIGHTLY_FILE_NAME -p $DELTA_PATH |
| fi |
| |
| # Copy delta.log to logs folder |
| [[ -d logs ]] || mkdir logs |
| FOLDER_NAME=$(date +%Y_%m_%d_%H_%M_%S)-$NIGHTLY_FILE_NAME |
| mkdir logs/$FOLDER_NAME |
| cp delta.log logs/$FOLDER_NAME |
| rm delta.log |
| |
| echo "Job name is: ${JOB_NAME}" |
| echo "Workspace is: ${WORKSPACE}" |
| echo "Wiki page to post is: ${WIKI_PREFIX}" |
| |
| # Generate csv file for plot |
| cd ~/OnosSystemTest/DELTA |
| echo "Tests Failed,Tests Passed,Tests Triggered" > DELTA-nightly.csv |
| echo $(cat summary.txt | grep FAIL |wc -l)","$(cat summary.txt | grep PASS |wc -l)","$(cat summary.txt |wc -l) >> DELTA-nightly.csv |
| |
| # Remove any leftover files from previous tests |
| rm ${WORKSPACE}/*.txt |
| rm ${WORKSPACE}/*.csv |
| |
| # copy files to workspace |
| cp summary.txt ${WORKSPACE}/ |
| cp *.csv ${WORKSPACE}/ |
| rm summary.txt |
| rm *.csv |
| |
| # Generate summary file for wiki |
| cd ${WORKSPACE} |
| cp summary.txt summaryWiki.txt |
| sed -i '/PASS/s/.*/<li> & <ac:emoticon ac:name="tick" \/><\/li>/' summaryWiki.txt |
| sed -i '/FAIL/s/.*/<li> & <ac:emoticon ac:name="cross" \/><\/li>/' summaryWiki.txt |
| sed -i '/UNKNOWN/s/.*/<li> & <\/li>/' summaryWiki.txt |