Merge "[VOL-2585] Variable refrences fixed - awk"
diff --git a/jjb/cord-test/nightly-build-pipeline.yaml b/jjb/cord-test/nightly-build-pipeline.yaml
index 6de1fcd..d2240d1 100644
--- a/jjb/cord-test/nightly-build-pipeline.yaml
+++ b/jjb/cord-test/nightly-build-pipeline.yaml
@@ -865,7 +865,7 @@
       - string:
           name: onosVersion
           default: '{onos-version}'
-          description: 'ONOS version that needs to be installed'
+          description: 'ONOS version that needs to be configured'
 
       - bool:
           name: released
@@ -988,4 +988,3 @@
       - reverse:
           jobs: 'build_{config-pod}_{profile}_voltha_{release}'
           result: 'success'
-
diff --git a/jjb/cord-test/voltha.yaml b/jjb/cord-test/voltha.yaml
index 557d50c..dabe712 100644
--- a/jjb/cord-test/voltha.yaml
+++ b/jjb/cord-test/voltha.yaml
@@ -84,6 +84,7 @@
           release: 'master'
           branch: 'master'
           released: false
+          onos-version: '2.2'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-bal31-build'
           oltDebVersion: 'openolt_asfvolt16_bal3.2.deb'
diff --git a/jjb/defaults.yaml b/jjb/defaults.yaml
index ed6fb3c..6a32bd4 100644
--- a/jjb/defaults.yaml
+++ b/jjb/defaults.yaml
@@ -193,3 +193,8 @@
     # maintainers
     # Used to notify users in supported tests
     maintainers: 'zdw@opennetworking.org'
+
+    # onos version
+    # is used by the voltha-bbsim-tests.groovy and physical pod pipelines to
+    # know which sadis config needs to be pushed
+    onos-version: '1.13.9'
diff --git a/jjb/pipeline/omec-fossa-scan.groovy b/jjb/pipeline/omec-fossa-scan.groovy
index 53c19e9..f59f276 100644
--- a/jjb/pipeline/omec-fossa-scan.groovy
+++ b/jjb/pipeline/omec-fossa-scan.groovy
@@ -53,6 +53,8 @@
                         #!/usr/bin/env bash
 
                         git checkout FETCH_HEAD
+                        git show
+
                         echo "Testing project: ${params.project}"
 
                         echo "Run 'fossa init'"
diff --git a/jjb/pipeline/omec-reuse-scan.groovy b/jjb/pipeline/omec-reuse-scan.groovy
index dc2cf1f..f4fcf51 100644
--- a/jjb/pipeline/omec-reuse-scan.groovy
+++ b/jjb/pipeline/omec-reuse-scan.groovy
@@ -52,6 +52,8 @@
                     #!/usr/bin/env bash
 
                     git checkout FETCH_HEAD
+                    git show
+
                     reuse lint
                     """
             }
diff --git a/jjb/pipeline/voltha-bbsim-tests.groovy b/jjb/pipeline/voltha-bbsim-tests.groovy
index c82501b..0b77619 100644
--- a/jjb/pipeline/voltha-bbsim-tests.groovy
+++ b/jjb/pipeline/voltha-bbsim-tests.groovy
@@ -84,7 +84,14 @@
     stage('Build Images') {
       steps {
         sh """
-           if ! [[ "${gerritProject}" =~ ^(voltha-helm-charts|voltha-system-tests)\$ ]]; then
+           if [ "${gerritProject}" = "pyvoltha" ]; then
+             cd $WORKSPACE/voltha/pyvoltha/
+             make dist
+             cd $WORKSPACE/voltha/voltha-openonu-adapter
+             export LOCAL_PYVOLTHA=$WORKSPACE/voltha/pyvoltha/
+             make local-pyvoltha
+             make DOCKER_REPOSITORY=voltha/ DOCKER_TAG=citest docker-build
+           elif ! [[ "${gerritProject}" =~ ^(voltha-helm-charts|voltha-system-tests)\$ ]]; then
              cd $WORKSPACE/voltha/${gerritProject}/
              make DOCKER_REPOSITORY=voltha/ DOCKER_TAG=citest docker-build
            fi
@@ -124,6 +131,8 @@
              IMAGES="afrouter afrouterd "
            elif [ "${gerritProject}" = "bbsim" ]; then
              IMAGES="bbsim "
+           elif [ "${gerritProject}" = "pyvoltha" ]; then
+             IMAGES="adapter_open_onu "
            else
              echo "No images to push"
            fi
@@ -151,6 +160,82 @@
       }
     }
 
+    stage('ONOS Config') {
+      steps {
+        sh '''
+          if [[ ${onosVersion} == "1.13.10" ]]; then
+            curl -sSL --user karaf:karaf \
+              -X POST \
+              -H Content-Type:application/json \
+              http://localhost:8181/onos/v1/network/configuration/apps \
+              --data @- << EOF
+              {
+                 "org.opencord.sadis":{
+                    "sadis":{
+                       "integration":{
+                          "cache":{
+                             "enabled":false,
+                             "maxsize":50,
+                             "ttl":"PT0m"
+                          }
+                       },
+                       "entries":[
+                          {
+                             "id":"BBSIM_OLT_0",
+                             "hardwareIdentifier":"0f:f1:ce:c0:ff:ee",
+                             "nasId":"BBSIMOLT000",
+                             "uplinkPort":1048576
+                          },
+                          {
+                             "id":"BBSM00000001-1",
+                             "nasPortId":"BBSM00000001-1",
+                             "circuitId":"BBSM00000001-1",
+                             "remoteId":"BBSM00000001-1",
+                             "uniTagList":[
+                                {
+                                   "ponCTag":900,
+                                   "ponSTag":900,
+                                   "technologyProfileId":64,
+                                   "downstreamBandwidthProfile":"Default",
+                                   "upstreamBandwidthProfile":"Default",
+                                   "isDhcpRequired":true
+                                }
+                             ]
+                          }
+                       ]
+                    },
+                    "bandwidthprofile":{
+                       "integration":{
+                          "cache":{
+                             "enabled":true,
+                             "maxsize":40,
+                             "ttl":"PT1m"
+                          }
+                       },
+                       "entries":[
+                          {
+                             "id":"Default",
+                             "cir":1000000,
+                             "cbs":1001,
+                             "eir":1002,
+                             "ebs":1003,
+                             "air":1004
+                          }
+                       ]
+                    }
+                 }
+              }
+            EOF
+            sshpass -p karaf ssh -p 30115 karaf@${deployment_config.nodes[0].ip} "cfg set org.opencord.olt.impl.OltFlowService enableDhcpOnProvisioning true"
+            sshpass -p karaf ssh -p 30115 karaf@${deployment_config.nodes[0].ip} "cfg set org.opencord.olt.impl.OltFlowService enableDhcpV4 true"
+            sshpass -p karaf ssh -p 30115 karaf@${deployment_config.nodes[0].ip} "cfg set org.opencord.olt.impl.OltFlowService enableEapol true"
+        else
+            echo "Using kind-voltha defaults"
+        fi
+        '''
+      }
+    }
+
     stage('Run E2E Tests') {
       steps {
         sh '''
diff --git a/jjb/verify/pyvoltha.yaml b/jjb/verify/pyvoltha.yaml
index a16817d..8bc15db 100644
--- a/jjb/verify/pyvoltha.yaml
+++ b/jjb/verify/pyvoltha.yaml
@@ -20,6 +20,8 @@
           dependency-jobs: 'verify_pyvoltha_licensed'
       - 'python-unit-test':
           dependency-jobs: 'verify_pyvoltha_tag-collision'
+      - 'voltha-patch-test':
+          pipeline-script: 'voltha-bbsim-tests.groovy'
 
 - job-group:
     name: 'publish-pyvoltha-jobs'
diff --git a/jjb/verify/voltha-onos.yaml b/jjb/verify/voltha-onos.yaml
index 7d426ca..9f1672d 100644
--- a/jjb/verify/voltha-onos.yaml
+++ b/jjb/verify/voltha-onos.yaml
@@ -6,13 +6,18 @@
     project: '{name}'
 
     jobs:
-      - 'verify-voltha-onos-jobs':
+      - 'verify-voltha-onos-jobs-common':
           branch-regexp: '{all-branches-regexp}'
+      - 'verify-voltha-onos-jobs-master':
+          branch-regexp: 'master'
+      - 'verify-voltha-onos-jobs-branches':
+          branch-regexp: '^(onos-1.13.10|onos-2.2)$'
+          name-extension: '-branches'
       - 'publish-voltha-onos-jobs':
-          branch-regexp: '{all-branches-regexp}'
+        branch-regexp: '{all-branches-regexp}'
 
 - job-group:
-    name: 'verify-voltha-onos-jobs'
+    name: 'verify-voltha-onos-jobs-common'
     jobs:
       - 'verify-licensed'
       - 'tag-collision-reject':
@@ -20,10 +25,21 @@
       - 'make-unit-test':
           unit-test-targets: 'build'
           junit-allow-empty-results: true
+
+- job-group:
+    name: 'verify-voltha-onos-jobs-master'
+    jobs:
       - 'voltha-patch-test':
           pipeline-script: 'voltha-bbsim-tests.groovy'
 
 - job-group:
+    name: 'verify-voltha-onos-jobs-branches'
+    jobs:
+      - 'voltha-patch-test':
+          pipeline-script: 'voltha-bbsim-tests.groovy'
+          onos-version: '1.13.10'
+
+- job-group:
     name: 'publish-voltha-onos-jobs'
     jobs:
       - 'docker-publish':
diff --git a/jjb/versioning.yaml b/jjb/versioning.yaml
index 9c25666..b4103c2 100644
--- a/jjb/versioning.yaml
+++ b/jjb/versioning.yaml
@@ -121,4 +121,3 @@
           properties-content:
             SEMVER_STRICT={semver-strict}
       - shell: !include-raw-escape: shell/versiontag.sh
-
diff --git a/jjb/voltha-e2e.yaml b/jjb/voltha-e2e.yaml
index 56510d3..751f267 100644
--- a/jjb/voltha-e2e.yaml
+++ b/jjb/voltha-e2e.yaml
@@ -162,7 +162,7 @@
 
 - job-template:
     id: 'voltha-patch-test'
-    name: 'verify_{project}_sanity-test'
+    name: 'verify_{project}_sanity-test{name-extension}'
     extra-helm-flags: ''
 
     description: |
@@ -216,6 +216,11 @@
           default: '{extra-helm-flags}'
           description: 'Helm flags to pass to ./voltha up'
 
+      - string:
+          name: onosVersion
+          default: '{onos-version}'
+          description: 'ONOS version that needs to be configured'
+
     project-type: pipeline
     concurrent: true