[ONOS-7346] ver.c

Change-Id: I89f9acdf7820ffa7b0e45d9536e0357060dddb9c
diff --git a/jjb/OnosSystemTest/delta-script.sh b/jjb/OnosSystemTest/delta-script.sh
new file mode 100644
index 0000000..b67836c
--- /dev/null
+++ b/jjb/OnosSystemTest/delta-script.sh
@@ -0,0 +1,54 @@
+#!/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
\ No newline at end of file
diff --git a/jjb/OnosSystemTest/onos-test-freestyle.yaml b/jjb/OnosSystemTest/onos-test-freestyle.yaml
index 6b061fc..f3029f2 100644
--- a/jjb/OnosSystemTest/onos-test-freestyle.yaml
+++ b/jjb/OnosSystemTest/onos-test-freestyle.yaml
@@ -62,7 +62,7 @@
       - archive:
          artifacts: '*.jpg'
 
-# cleanup_stations - TDOO: need to add bash script.
+# cleanup_stations - TDOO: check if getting the directory works.
 - job-template:
     name: test-station-log-cleanup-VM
 
@@ -87,8 +87,8 @@
 
     node: 'TestStation-VMs'
 
-    triggers:
-      - timed: '01 08 1,15 * *'
+#    triggers:
+#      - timed: '01 08 1,15 * *'
 
     builders:
 
@@ -118,8 +118,8 @@
 
     node: 'TestStation-BMs'
 
-    triggers:
-      - timed: '01 08 1 * *'
+#    triggers:
+#      - timed: '01 08 1 * *'
 
     builders:
 
@@ -149,13 +149,99 @@
 
     node: 'TestStation-CHOs'
 
-    triggers:
-      - timed: '@daily'
+#    triggers:
+#      - timed: '@daily'
 
     builders:
 
       - shell: !include-raw-escape: cho-clean-up.sh
 
+# haven't done this yet.
+- job-template:
+    name: QA-check-style
+
+    <<: *test-free-job-boiler-plate
+    properties:
+
+      - build-discarder:
+         num-to-keep: 15
+
+    parameters:
+
+      - string:
+         name: 'DAYS_OLD'
+         default: '15'
+
+      - lf-infra-parameters:
+         project: '{project}'
+         branch: '{stream}'
+         stream: '{stream}'
+         lftools-version: '{lftools-version}'
+
+    node: 'TestStation-CHOs'
+
+#    triggers:
+#      - timed: '@daily'
+
+    builders:
+
+      - shell: !include-raw-escape: cho-clean-up.sh
+
+- job-template:
+    name: delta-nightly
+
+    <<: *test-free-job-boiler-plate
+    properties:
+
+      - build-discarder:
+         num-to-keep: 30
+
+    parameters:
+
+      - string:
+         name: 'NIGHTLY_FILE_NAME'
+         default: ''
+         description: |
+                      Name of ONOS nightly build file
+                      will be set to the latest file if not specified here
+
+      - string:
+         name: 'ONOS_VERSION'
+         default: '1.11.0'
+         description: 'Version number in ONOS nightly build file'
+
+      - string:
+         name: 'DELTA_PATH'
+         default: '/home/sdn'
+         description: 'Path of DELTA project'
+
+      - string:
+         name: 'WIKI_PREFIX'
+         default: 'master'
+
+      - bool:
+         name: 'CLEANUP'
+         default: true
+
+      - lf-infra-parameters:
+         project: '{project}'
+         branch: '{stream}'
+         stream: '{stream}'
+         lftools-version: '{lftools-version}'
+
+    node: 'TestStation-BMs'
+
+    wrappers:
+      - inject:
+         properties-file: '/var/jenkins/TestONOS.property'
+
+    builders:
+
+      - shell: !include-raw-escape: delta-script.sh
+
+    # Todo : add graph and confluence ( use pipeline for post build ..? )
+
+
 #TODO LIST : DELTA -> perhaps change into pipeline?? , CHO_jobs, Check_style, Personal stations : necessary?
 
 - project:
@@ -177,3 +263,19 @@
       - 'test-station-log-cleanup-VM'
       - 'test-station-log-cleanup-BM'
       - 'test-station-log-cleanup-CHO'
+
+- project:
+    name: check-style
+    project-name: check-style
+
+    <<: *test-free-init-procedure-plate
+    jobs:
+      - 'QA-check-style'
+
+- project:
+    name: delta-test
+    project-name: delta-test
+
+    <<: *test-free-init-procedure-plate
+    jobs:
+      - 'delta-nightly'
diff --git a/jjb/OnosSystemTest/onos-test-pipeline.yaml b/jjb/OnosSystemTest/onos-test-pipeline.yaml
index 4542fe1..566906f 100644
--- a/jjb/OnosSystemTest/onos-test-pipeline.yaml
+++ b/jjb/OnosSystemTest/onos-test-pipeline.yaml
@@ -104,10 +104,10 @@
 
     concurrent: false
 
-    triggers:
-      - timed: |
-                30 19 * * 1,2,3,4,5
-                30 11 * * 6,7
+#    triggers:
+#      - timed: |
+#                30 19 * * 1,2,3,4,5
+#                30 11 * * 6,7
 
     pipeline-scm:
       script-path: '{jenkins-path}/JenkinsfileTrigger'