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