Merge "Setting logs at DEBUG level on physical builds"
diff --git a/jjb/pipeline/voltha/master/periodic-bbsim-tests.groovy b/jjb/pipeline/voltha/master/periodic-bbsim-tests.groovy
index 42c4b29..f7ea4d7 100644
--- a/jjb/pipeline/voltha/master/periodic-bbsim-tests.groovy
+++ b/jjb/pipeline/voltha/master/periodic-bbsim-tests.groovy
@@ -64,6 +64,11 @@
           " --set onos-classic.onosApiPort=30120 " +
           " --set onos-classic.onosOfPort=31653 " +
           " --set onos-classic.individualOpenFlowNodePorts=true " + testSpecificHelmFlags
+
+          if (gerritProject != "") {
+            localHelmFlags = "${localHelmFlags} " + getVolthaImageFlags("${gerritProject}")
+          }
+
           volthaDeploy([
             infraNamespace: infraNamespace,
             volthaNamespace: volthaNamespace,
@@ -90,6 +95,11 @@
       JENKINS_NODE_COOKIE="dontKillMe" _TAG="voltha-voltha-api" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${volthaNamespace} svc/voltha-voltha-api 55555:55555; done"&
       JENKINS_NODE_COOKIE="dontKillMe" _TAG="voltha-infra-etcd" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${infraNamespace} svc/voltha-infra-etcd 2379:2379; done"&
       JENKINS_NODE_COOKIE="dontKillMe" _TAG="voltha-infra-kafka" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${infraNamespace} svc/voltha-infra-kafka 9092:9092; done"&
+      bbsimDmiPortFwd=50075
+      for i in {0..${olts.toInteger() - 1}}; do
+        JENKINS_NODE_COOKIE="dontKillMe" _TAG="bbsim\${i}" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${volthaNamespace} svc/bbsim\${i} 50075:\${bbsimDmiPortFwd}; done"&
+        ((bbsimDmiPortFwd++))
+      done
       ps aux | grep port-forward
       """
     }
@@ -173,6 +183,19 @@
         ])
       }
     }
+    stage('Build patch') {
+      // build the patch only if gerritProject is specified
+      when {
+        expression {
+          return !gerritProject.isEmpty()
+        }
+      }
+      steps {
+        // NOTE that the correct patch has already been checked out
+        // during the getVolthaCode step
+        buildVolthaComponent("${gerritProject}")
+      }
+    }
     stage('Create K8s Cluster') {
       steps {
         script {
@@ -185,6 +208,16 @@
         }
       }
     }
+    stage('Load image in kind nodes') {
+      when {
+        expression {
+          return !gerritProject.isEmpty()
+        }
+      }
+      steps {
+        loadToKind()
+      }
+    }
     stage('Parse and execute tests') {
         steps {
           script {
diff --git a/jjb/verify/kind-voltha.yaml b/jjb/verify/kind-voltha.yaml
index cf7e1ff..8b43798 100644
--- a/jjb/verify/kind-voltha.yaml
+++ b/jjb/verify/kind-voltha.yaml
@@ -21,3 +21,4 @@
           pipeline-script: 'voltha/voltha-2.7/voltha-bbsim-tests.groovy'
           name-extension: '-2.7'
           override-branch: 'voltha-2.7'
+          kindVolthaChange: '$GERRIT_REFSPEC'
diff --git a/jjb/verify/opendevice-manager.yaml b/jjb/verify/opendevice-manager.yaml
index f3ee4b4..14f09ae 100644
--- a/jjb/verify/opendevice-manager.yaml
+++ b/jjb/verify/opendevice-manager.yaml
@@ -8,6 +8,8 @@
     jobs:
       - 'verify-opendevice-manager-jobs':
           branch-regexp: '{all-branches-regexp}'
+      - 'publish-voltha-opendevice-manager-jobs':
+          branch-regexp: '{all-branches-regexp}'
 
 - job-group:
     name: 'verify-opendevice-manager-jobs'
@@ -20,3 +22,13 @@
           # opendm-agent uses gtest which outputs in xunit format
           junit-allow-empty-results: true
           xunit-skip-if-no-test-files: false
+
+- job-group:
+    name: 'publish-voltha-opendevice-manager-jobs'
+    jobs:
+      - 'docker-publish':
+          build-timeout: 30
+          docker-repo: 'voltha'
+          dependency-jobs: 'version-tag'
+
+
diff --git a/jjb/voltha-e2e.yaml b/jjb/voltha-e2e.yaml
index f830fe7..b211dd4 100755
--- a/jjb/voltha-e2e.yaml
+++ b/jjb/voltha-e2e.yaml
@@ -16,7 +16,7 @@
     make-target-multipleolt: bbsim-multiolt-kind
     make-target-1t4gemtest: 1t4gem-openonu-go-adapter-test
     make-target-1t8gemtest: 1t8gem-openonu-go-adapter-test
-    make-target-reconciletest: reconcile-openonu-go-adapter-test
+    make-target-reconciletest: reconcile-openonu-go-adapter-test-att
     make-target-reconciledttest: reconcile-openonu-go-adapter-test-dt
     make-target-reconciletttest: reconcile-openonu-go-adapter-test-tt
 
@@ -92,7 +92,7 @@
           time-trigger: "H H/12 * * *"
           logLevel: 'DEBUG'
           testTargets: |
-            - target: openonu-go-adapter-test
+            - target: 1t1gem-openonu-go-adapter-test
               workflow: att
               flags: ""
               teardown: true
@@ -108,7 +108,7 @@
               workflow: att
               flags: "--set pon=2,onu=2,controlledActivation=only-onu"
               teardown: true
-            - target: reconcile-openonu-go-adapter-test
+            - target: reconcile-openonu-go-adapter-test-att
               workflow: att
               flags: ""
               teardown: true
@@ -130,7 +130,7 @@
           gerritRefspec: '$GERRIT_REFSPEC'
           logLevel: 'DEBUG'
           testTargets: |
-            - target: openonu-go-adapter-test
+            - target: 1t1gem-openonu-go-adapter-test
               workflow: att
               flags: ""
               teardown: true
@@ -146,7 +146,7 @@
               workflow: att
               flags: "--set pon=2,onu=2,controlledActivation=only-onu"
               teardown: true
-            - target: reconcile-openonu-go-adapter-test
+            - target: reconcile-openonu-go-adapter-test-att
               workflow: att
               flags: ""
               teardown: true
@@ -180,7 +180,7 @@
           olts: 2
           logLevel: 'DEBUG'
           testTargets: |
-            - target: openonu-go-adapter-multi-olt-test
+            - target: 1t1gem-openonu-go-adapter-multi-olt-test
               workflow: att
               flags: ""
               teardown: true
@@ -192,7 +192,7 @@
               workflow: att
               flags: ""
               teardown: true
-            - target: reconcile-openonu-go-adapter-multi-olt-test
+            - target: reconcile-openonu-go-adapter-multi-olt-test-att
               workflow: att
               flags: ""
               teardown: true
@@ -215,7 +215,7 @@
           gerritRefspec: '$GERRIT_REFSPEC'
           logLevel: 'DEBUG'
           testTargets: |
-            - target: openonu-go-adapter-multi-olt-test
+            - target: 1t1gem-openonu-go-adapter-multi-olt-test
               workflow: att
               flags: ""
               teardown: true
@@ -227,7 +227,7 @@
               workflow: att
               flags: ""
               teardown: true
-            - target: reconcile-openonu-go-adapter-multi-olt-test
+            - target: reconcile-openonu-go-adapter-multi-olt-test-att
               workflow: att
               flags: ""
               teardown: true
@@ -248,9 +248,9 @@
           make-target: openonu-go-adapter-multi-olt-test
           make-target-1t4gemtest: 1t4gem-openonu-go-adapter-multi-olt-test
           make-target-1t8gemtest: 1t8gem-openonu-go-adapter-multi-olt-test
-          make-target-reconciletest: reconcile-openonu-go-adapter-test
-          make-target-reconciledttest: reconcile-openonu-go-adapter-test-dt
-          make-target-reconciletttest: reconcile-openonu-go-adapter-test-tt
+          make-target-reconciletest: reconcile-openonu-go-adapter-multi-olt-test
+          make-target-reconciledttest: reconcile-openonu-go-adapter-multi-olt-test-dt
+          make-target-reconciletttest: reconcile-openonu-go-adapter-multi-olt-test-tt
           withAlarms: false
           code-branch: 'voltha-2.7'
           olts: 2
@@ -484,7 +484,7 @@
       # the provided configuration and then the make target is invoked,
       # example value (has to be valid YAML):
       # testTargets: |
-      #   - target: openonu-go-adapter-test
+      #   - target: 1t1gem-openonu-go-adapter-test
       #     workflow: att
       #     flags: ""
       #     teardown: true
@@ -743,6 +743,7 @@
     volthaHelmChartsChange: ''
     extraHelmFlags: ''
     branch-regexp: '{all-branches-regexp}'
+    kindVolthaChange: '' # this is only needed to test kind-voltha patches
 
     description: |
       <!-- Managed by Jenkins Job Builder -->
@@ -795,6 +796,12 @@
           default: '{override-branch}'
           description: 'Name of the branch to use'
 
+      # Used in the 2.7 based pipeline, can be removed after 2.8
+      - string:
+          name: kindVolthaChange
+          default: '{kindVolthaChange}'
+          description: 'Download a change for gerrit in the kind-voltha repo, example value: "refs/changes/32/19132/1" (only used to test kind-voltha changes in 2.7)'
+
     project-type: pipeline
     concurrent: true
 
diff --git a/jjb/voltha-test/voltha.yaml b/jjb/voltha-test/voltha.yaml
index 658d9db..12a4a36 100644
--- a/jjb/voltha-test/voltha.yaml
+++ b/jjb/voltha-test/voltha.yaml
@@ -371,7 +371,7 @@
           pipeline-script: 'voltha-physical-soak-dt-tests.groovy'
           time-trigger: "H H */3 * *"
 
-        # Berlin pod with olt/onu - master versions timer based job , two OLTs
+      # Certification (Radisys) pod with olt/onu - master versions timer based job , two OLTs
       - 'build_voltha_pod_release_timer':
           build-node: 'menlo-certification-pod'
           config-pod: 'menlo-certification-pod-radisys-gpon'
@@ -382,7 +382,7 @@
           profile: '1T8GEM-unencrypted'
           time: '1'
 
-          # Berlin POD test job - master versions: uses tech profile on voltha branch
+      # Certification (Radisys) POD test job - master versions: uses tech profile on voltha branch
       - 'build_voltha_pod_test':
           build-node: 'menlo-certification-pod'
           config-pod: 'menlo-certification-pod-radisys-gpon'