Merge "Catch errors on synopsys jobs, so logs are still captured"
diff --git a/jjb/cord-test/att-workflow.yaml b/jjb/cord-test/att-workflow.yaml
index d740c68..fe78442 100644
--- a/jjb/cord-test/att-workflow.yaml
+++ b/jjb/cord-test/att-workflow.yaml
@@ -57,6 +57,7 @@
          config-pod: 'flex-ocp-cord-voltha-master'
          profile: 'att-workflow'
          branch: 'master'
+         test-repo: 'cord-tester'
          helmRepoUrl: 'https://charts.opencord.org'
          Jenkinsfile: 'Jenkinsfile-attworkflow-build'
          oltDebVersion: 'openolt-master.deb'
@@ -68,6 +69,7 @@
          config-pod: 'flex-ocp-cord-voltha16'
          profile: 'att-workflow'
          branch: 'cord-6.1'
+         test-repo: 'cord-tester'
          Jenkinsfile: 'Jenkinsfile-attworkflow-build'
          oltDebVersion: 'openolt-master-voltha16.deb'
          configurePod: true
diff --git a/jjb/cord-test/nightly-build-pipeline.yaml b/jjb/cord-test/nightly-build-pipeline.yaml
index a0016ba..fda3ee1 100644
--- a/jjb/cord-test/nightly-build-pipeline.yaml
+++ b/jjb/cord-test/nightly-build-pipeline.yaml
@@ -127,7 +127,7 @@
     description: |
                   <!-- Managed by Jenkins Job Builder -->
                   Nightly Kubernetes tests on {config-pod} <br /><br />
-                  Created from job-template {id} from ci-management/jjb/cord-test/cord-test-pipeline.yaml <br />
+                  Created from job-template {id} from ci-management/jjb/cord-test/nightly-build-pipeline.yaml <br />
                   Created by Suchitra Vemuri, suchitra@opennetworking.org <br />
                   Copyright (c) 2017 Open Networking Foundation (ONF)
     disabled: false
@@ -220,7 +220,7 @@
       script-path: '{Jenkinsfile}'
       scm:
         - git:
-           url: '{gerrit-server-url}/cord-tester'
+           url: '{gerrit-server-url}/{test-repo}'
            branches:
              - '{branch}'
 
@@ -789,3 +789,168 @@
            url: '{gerrit-server-url}/cord-tester'
            branches:
              - '{branch}'
+
+- job-template:
+    name: 'build_{config-pod}_voltha_{release}'
+    id: build_voltha_pod_release
+    description: |
+                  <!-- Managed by Jenkins Job Builder -->
+                  Manual Build on POD {config-pod} using {Jenkinsfile} <br /><br />
+                  Created from job-template {id} from ci-management/jjb/cord-test/nightly-build-pipeline.yaml <br />
+                  Created by QA (Suchitra Vemuri - suchitra@opennetworking.org ) <br />
+                  Copyright (c) 2018 Open Networking Foundation (ONF)
+
+    <<: *test-pipe-job-boiler-plate
+
+    parameters:
+      - string:
+         name: TestNodeName
+         default: '{testvm}'
+         description: 'Jenkins node name of TestVM Node'
+
+      - string:
+         name: cordRepoUrl
+         default: '{gerrit-server-url}'
+         description: 'The URL of the CORD Project repository'
+
+      - string:
+         name: configBaseDir
+         default: 'pod-configs'
+         description: 'The directory inside the POD configs repository'
+
+      - string:
+         name: configDeploymentDir
+         default: 'deployment-configs'
+         description: 'The deployment configs folder'
+
+      - string:
+         name: configKubernetesDir
+         default: 'kubernetes-configs'
+         description: 'The kubernetes config folder'
+
+      - string:
+         name: configToscaDir
+         default: 'tosca-configs'
+         description: 'The tosca config folder'
+
+      - string:
+         name: configFileName
+         default: '{config-pod}'
+         description: 'The config file'
+
+      - string:
+         name: oltDebVersion
+         default: '{oltDebVersion}'
+         description: 'OLT Software version to install'
+
+      - string:
+         name: helmRepoUrl
+         default: 'https://charts.opencord.org'
+         description: 'URL where helm-charts are published'
+
+      - string:
+         name: branch
+         default: '{branch}'
+
+      - string:
+         name: notificationEmail
+         default: 'you@opennetworking.org, suchitra@opennetworking.org'
+         description: ''
+
+      - bool:
+          name: configurePod
+          default: true
+          description: "Configure POD via TOSCA post build"
+
+      - bool:
+            name: reinstallOlt
+            default: true
+            description: "Re-install olt software bringing up CORD"
+
+    concurrent: true
+
+    pipeline-scm:
+      script-path: '{Jenkinsfile}'
+      scm:
+        - git:
+           url: '{gerrit-server-url}/voltha-system-tests'
+           branches:
+             - '{branch}'
+
+    triggers:
+       - timed: |
+                 TZ=America/Los_Angeles
+                 H {time} * * *
+
+- job-template:
+    name: 'build_{config-pod}_voltha_{release}_test'
+    id: build_voltha_pod_test
+    description: |
+                  <!-- Managed by Jenkins Job Builder -->
+                  Post Tests on {config-pod} triggered by build_{config-pod}_{branch} <br /><br />
+                  Created from job-template {id} from ci-management/jjb/cord-test/cord-test-pipeline.yaml <br />
+                  Created by Suchitra Vemuri, suchitra@opennetworking.org <br />
+                  Copyright (c) 2017 Open Networking Foundation (ONF)
+
+    <<: *test-pipe-job-boiler-plate
+
+    parameters:
+      - string:
+         name: TestNodeName
+         default: '{testvm}'
+         description: 'Jenkins node name of TestVM Node'
+
+      - string:
+         name: cordRepoUrl
+         default: '{gerrit-server-url}'
+         description: 'The URL of the CORD Project repository'
+
+      - string:
+         name: configBaseDir
+         default: 'pod-configs'
+         description: 'The directory inside the POD configs repository'
+
+      - string:
+         name: configDeploymentDir
+         default: 'deployment-configs'
+         description: 'The deployment configs folder'
+
+      - string:
+         name: configKubernetesDir
+         default: 'kubernetes-configs'
+         description: 'The kubernetes config folder'
+
+      - string:
+         name: configToscaDir
+         default: 'tosca-configs'
+         description: 'The tosca config folder'
+
+      - string:
+         name: configFileName
+         default: '{config-pod}'
+         description: 'The config file'
+
+      - string:
+         name: branch
+         default: '{branch}'
+
+      - string:
+         name: notificationEmail
+         default: 'you@opennetworking.org, suchitra@opennetworking.org'
+         description: ''
+
+    concurrent: true
+
+    pipeline-scm:
+      script-path: '{Jenkinsfile}'
+      scm:
+        - git:
+           url: '{gerrit-server-url}/voltha-system-tests'
+           branches:
+             - '{branch}'
+
+    triggers:
+      - reverse:
+          jobs: 'build_{config-pod}_voltha_{release}'
+          result: 'success'
+
diff --git a/jjb/cord-test/rcord-lite.yaml b/jjb/cord-test/rcord-lite.yaml
index 6168a06..8088580 100644
--- a/jjb/cord-test/rcord-lite.yaml
+++ b/jjb/cord-test/rcord-lite.yaml
@@ -15,6 +15,7 @@
          config-pod: 'flex-ocp-cord'
          profile: 'rcord-topdown'
          branch: 'master'
+         test-repo: 'cord-tester'
          Jenkinsfile: 'Jenkinsfile-rcordlite-topdown-build'
          oltDebVersion: 'openolt-master.deb'
          configurePod: true
@@ -35,6 +36,7 @@
          config-pod: 'flex-ocp-cord'
          profile: 'rcord-zerotouch'
          branch: 'master'
+         test-repo: 'cord-tester'
          Jenkinsfile: 'Jenkinsfile-rcordlite-zerotouch-build'
          oltDebVersion: 'openolt-master.deb'
          configurePod: true
@@ -55,6 +57,7 @@
          config-pod: 'qct-pod1'
          profile: 'rcord-topdown'
          branch: 'master'
+         test-repo: 'cord-tester'
          Jenkinsfile: 'Jenkinsfile-rcordlite-topdown-build'
          oltDebVersion: 'openolt-1.4.deb'
          configurePod: true
diff --git a/jjb/cord-test/voltha.yaml b/jjb/cord-test/voltha.yaml
index 007855c..8a0b31c 100644
--- a/jjb/cord-test/voltha.yaml
+++ b/jjb/cord-test/voltha.yaml
@@ -28,3 +28,26 @@
          branch: 'master'
          test-repo: 'voltha-system-tests'
          Jenkinsfile: 'Jenkinsfile-voltha-test'
+
+      # flex OCP pod with olt/onu - timer based job
+      - 'build_voltha_pod_release':
+         testvm: 'qa-testvm-pod'
+         config-pod: 'flex-ocp-cord'
+         release: '2.1'
+         branch: 'master'
+         test-repo: 'voltha-system-tests'
+         Jenkinsfile: 'Jenkinsfile-voltha-build'
+         oltDebVersion: 'openolt-seba-2.0.deb'
+         configurePod: true
+         time: '1'
+
+     # flex pod1 test job - using voltha branch
+      - 'build_voltha_pod_test':
+         testvm: 'qa-testvm-pod'
+         config-pod: 'flex-ocp-cord'
+         profile: 'multipleGem'
+         branch: 'master'
+         release: '2.1'
+         test-repo: 'voltha-system-tests'
+         Jenkinsfile: 'Jenkinsfile-voltha-test'
+
diff --git a/jjb/pipeline/voltha-go-tests-new-bbsim.groovy b/jjb/pipeline/voltha-go-tests-new-bbsim.groovy
index 61c91f7..65cbc24 100644
--- a/jjb/pipeline/voltha-go-tests-new-bbsim.groovy
+++ b/jjb/pipeline/voltha-go-tests-new-bbsim.groovy
@@ -31,6 +31,7 @@
     stage('Download kind-voltha') {
       steps {
         sh """
+           rm -rf kind-voltha
            git clone https://github.com/ciena/kind-voltha.git
            """
       }
@@ -45,25 +46,44 @@
       }
     }
 
-    stage('Deploy and run BBSim') {
-      // This step doing multple things as it is (hopefully) a temporary step
-      // once the new-bbsim is integrated with kind-voltha this all pipeline should be dismissed
+    stage('Download BBSim repo') {
       steps {
         sh """
           cd $WORKSPACE
+          rm -rf bbsim
           git clone https://github.com/opencord/bbsim.git bbsim
-          cd bbsim
-          # override sadis config
-          curl --user karaf:karaf -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d @examples/sadis-minimal.json http://127.0.0.1:8181/onos/v1/network/configuration/apps
-          curl --user karaf:karaf -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d @examples/onos-dhcp.json  http://127.0.0.1:8181/onos/v1/network/configuration/apps
-          # build and run BBSim
-          DOCKER_TAG=candidate make docker-build
-          TYPE=minimal kind load docker-image voltha/bbsim:candidate --name voltha-\$TYPE --nodes voltha-\$TYPE-worker,voltha-\$TYPE-worker2;
-          helm install -n bbsim deployments/helm-chart/bbsim/ --set images.bbsim.tag=candidate --set images.bbsim.pullPolicy=IfNotProsent
           """
       }
     }
 
+    stage('config ONOS with BBSim sadis values') {
+      steps {
+        sh """
+          cd $WORKSPACE/bbsim
+          curl --user karaf:karaf -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d @examples/sadis-minimal-voltha-2.json http://127.0.0.1:8181/onos/v1/network/configuration/apps
+          curl --user karaf:karaf -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d @examples/onos-dhcp.json  http://127.0.0.1:8181/onos/v1/network/configuration/apps
+          """
+      }
+    }
+
+    stage('Build and Deploy BBSim') {
+      // This step doing multple things as it is (hopefully) a temporary step
+      // once the new-bbsim is integrated with kind-voltha this all pipeline should be dismissed
+      steps {
+        sh '''
+          cd $WORKSPACE/kind-voltha/
+          export KUBECONFIG="$(./bin/kind get kubeconfig-path --name="voltha-minimal")"
+          export VOLTCONFIG="/home/jenkins/.volt/config-minimal"
+          export PATH=$WORKSPACE/kind-voltha/bin:$PATH
+          cd $WORKSPACE/bbsim
+          # DOCKER_TAG=candidate make docker-build
+          # TYPE=minimal kind load docker-image voltha/bbsim:candidate --name voltha-\$TYPE --nodes voltha-\$TYPE-worker,voltha-\$TYPE-worker2;
+          # helm install -n bbsim deployments/helm-chart/bbsim/ --set images.bbsim.tag=candidate --set images.bbsim.pullPolicy=IfNotProsent
+          helm install -n bbsim deployments/helm-chart/bbsim/ --set images.bbsim.tag=master
+          '''
+      }
+    }
+
     stage('Run E2E Tests') {
       steps {
         sh '''
@@ -123,11 +143,11 @@
             otherFiles: '',
             outputFileName: 'RobotLogs/output*.xml',
             outputPath: '.',
-            passThreshold: 80,
+            passThreshold: 100,
             reportFileName: 'RobotLogs/report*.html',
             unstableThreshold: 0]);
          archiveArtifacts artifacts: '*.log'
-
+         step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "teo@opennetworking.org", sendToIndividuals: false])
     }
   }
 }
diff --git a/jjb/pipeline/voltha-go-tests.groovy b/jjb/pipeline/voltha-go-tests.groovy
index 5cc1857..029e5c9 100644
--- a/jjb/pipeline/voltha-go-tests.groovy
+++ b/jjb/pipeline/voltha-go-tests.groovy
@@ -104,7 +104,7 @@
             otherFiles: '',
             outputFileName: 'RobotLogs/output*.xml',
             outputPath: '.',
-            passThreshold: 80,
+            passThreshold: 100,
             reportFileName: 'RobotLogs/report*.html',
             unstableThreshold: 0]);
          archiveArtifacts artifacts: '*.log'
diff --git a/jjb/verify/voltha-openonu-adapter.yaml b/jjb/verify/voltha-openonu-adapter.yaml
index 248cfe9..8c41c58 100644
--- a/jjb/verify/voltha-openonu-adapter.yaml
+++ b/jjb/verify/voltha-openonu-adapter.yaml
@@ -23,6 +23,7 @@
           unit-test-targets: 'test'
           unit-test-keep-going: 'true'
           junit-allow-empty-results: true
+          build-timeout: 15
 
 - job-group:
     name: 'publish-voltha-openonu-adapter-jobs'