Merge "[COMAC-337]: License Scan Automation"
diff --git a/jjb/cord-test/voltha.yaml b/jjb/cord-test/voltha.yaml
index 3cc63ce..83b1095 100644
--- a/jjb/cord-test/voltha.yaml
+++ b/jjb/cord-test/voltha.yaml
@@ -17,7 +17,7 @@
           branch: 'master'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-bal31-build'
-          oltDebVersion: 'openolt_asfvolt16.deb'
+          oltDebVersion: 'openolt_asfvolt16_bal3.2.deb'
           profile: '1T4GEM-bal31'
 
       # flex pod1 test job - using voltha branch
@@ -37,7 +37,7 @@
           branch: 'master'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-bal31-build'
-          oltDebVersion: 'openolt-2.2.deb'
+          oltDebVersion: 'openolt_asfvolt16_bal3.2.deb'
           profile: '1T4GEM-bal31'
 
       # onlab pod1 test job - BAL3.1 tests using voltha branch
@@ -58,7 +58,7 @@
           released: false
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-bal31-build'
-          oltDebVersion: 'openolt_asfvolt16.deb'
+          oltDebVersion: 'openolt_asfvolt16_bal3.2.deb'
           configurePod: true
           profile: 'Default'
           time: '1'
@@ -82,7 +82,7 @@
           released: false
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-bal31-build'
-          oltDebVersion: 'openolt_asfvolt16.deb'
+          oltDebVersion: 'openolt_asfvolt16_bal3.2.deb'
           configurePod: true
           profile: '1T4GEM-bal31'
           time: '3'
@@ -224,7 +224,7 @@
           configurePod: true
           profile: 'Default'
 
-      # ONF DEMO OCP test job - voltha-master branch 
+      # ONF DEMO OCP test job - voltha-master branch
       - 'build_pod_test':
           testvm: 'menlo-demo-pod'
           config-pod: 'onf-demo-pod'
diff --git a/jjb/pipeline/voltha-physical-functional-tests.groovy b/jjb/pipeline/voltha-physical-functional-tests.groovy
index 6e76584..05b6a90 100644
--- a/jjb/pipeline/voltha-physical-functional-tests.groovy
+++ b/jjb/pipeline/voltha-physical-functional-tests.groovy
@@ -82,14 +82,14 @@
       }
     }
 
-    stage('Error Scenario Tests') {
+    stage('Failure/Recovery Tests') {
       when {
         expression { ! params.released }
       }
       environment {
         ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}.yaml"
-        ROBOT_FILE="Voltha_ErrorScenarios.robot"
-        ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ErrorScenarios"
+        ROBOT_FILE="Voltha_FailureScenarios.robot"
+        ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/FailureScenarios"
       }
       steps {
         sh """
@@ -100,14 +100,14 @@
       }
     }
 
-    stage('Failure/Recovery Tests') {
+    stage('Error Scenario Tests') {
       when {
         expression { ! params.released }
       }
       environment {
         ROBOT_CONFIG_FILE="$WORKSPACE/${configBaseDir}/${configDeploymentDir}/${configFileName}.yaml"
-        ROBOT_FILE="Voltha_FailureScenarios.robot"
-        ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/FailureScenarios"
+        ROBOT_FILE="Voltha_ErrorScenarios.robot"
+        ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ErrorScenarios"
       }
       steps {
         sh """
diff --git a/jjb/pipeline/voltha-system-test-bbsim.groovy b/jjb/pipeline/voltha-system-test-bbsim.groovy
index 68f96d7..78e6d3a 100644
--- a/jjb/pipeline/voltha-system-test-bbsim.groovy
+++ b/jjb/pipeline/voltha-system-test-bbsim.groovy
@@ -17,37 +17,37 @@
 // uses bbsim to simulate OLT/ONUs
 
 
-  def logKubernetes(prefix) {
-      sh """
-         set +e
-         cd kind-voltha/
-         cp install-minimal.log $WORKSPACE/${prefix}_instsall-minimal.log
-         kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\t'}{.imageID}{'\\n'}" | sort | uniq -c
-         kubectl get nodes -o wide
-         kubectl get pods -o wide
-         kubectl get pods -n voltha -o wide
-         ## get default pod logs
-         for pod in \$(kubectl get pods --no-headers | awk '{print \$1}');
-         do
-           if [[ \$pod == *"onos"* && \$pod != *"onos-service"* ]]; then
-             kubectl logs \$pod onos> $WORKSPACE/${prefix}_\$pod.log;
-           else
-             kubectl logs \$pod> $WORKSPACE/${prefix}_\$pod.log;
-           fi
-         done
-         ## get voltha pod logs
-         for pod in \$(kubectl get pods --no-headers -n voltha | awk '{print \$1}');
-         do
-           if [[ \$pod == *"-api-"* ]]; then
-             kubectl logs \$pod arouter -n voltha > $WORKSPACE/${prefix}_\$pod.log;
-           elif [[ \$pod == "bbsim-"* ]]; then
-             kubectl logs \$pod -n voltha -p > $WORKSPACE/${prefix}_\$pod.log;
-           else
-             kubectl logs \$pod -n voltha > $WORKSPACE/${prefix}_\$pod.log;
-           fi
-         done
-         """
-  }
+def logKubernetes(prefix) {
+    sh """
+        set +e
+        cd kind-voltha/
+        cp install-minimal.log $WORKSPACE/${prefix}_instsall-minimal.log
+        kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\t'}{.imageID}{'\\n'}" | sort | uniq -c
+        kubectl get nodes -o wide
+        kubectl get pods -o wide
+        kubectl get pods -n voltha -o wide
+        ## get default pod logs
+        for pod in \$(kubectl get pods --no-headers | awk '{print \$1}');
+    do
+        if [[ \$pod == *"onos"* && \$pod != *"onos-service"* ]]; then
+            kubectl logs \$pod onos> $WORKSPACE/${prefix}_\$pod.log;
+        else
+            kubectl logs \$pod> $WORKSPACE/${prefix}_\$pod.log;
+    fi
+        done
+        ## get voltha pod logs
+        for pod in \$(kubectl get pods --no-headers -n voltha | awk '{print \$1}');
+    do
+        if [[ \$pod == *"-api-"* ]]; then
+            kubectl logs \$pod arouter -n voltha > $WORKSPACE/${prefix}_\$pod.log;
+    elif [[ \$pod == "bbsim-"* ]]; then
+        kubectl logs \$pod -n voltha -p > $WORKSPACE/${prefix}_\$pod.log;
+        else
+            kubectl logs \$pod -n voltha > $WORKSPACE/${prefix}_\$pod.log;
+    fi
+        done
+        """
+}
 
 
 pipeline {
@@ -169,7 +169,7 @@
     aborted {
         logKubernetes('last')
     }
-    always {
+    cleanup {
 
          step([$class: 'RobotPublisher',
             disableArchiveOutput: false,
diff --git a/jjb/verify/kafka-topic-exporter.yaml b/jjb/verify/kafka-topic-exporter.yaml
index 270ae1c..3231c4c 100644
--- a/jjb/verify/kafka-topic-exporter.yaml
+++ b/jjb/verify/kafka-topic-exporter.yaml
@@ -8,6 +8,7 @@
     jobs:
       - 'verify-kafka-topic-exporter-jobs':
           branch-regexp: '{supported-branches-regexp}'
+      - 'publish-kafka-topic-exporter-jobs'
 
 - job-group:
     name: 'verify-kafka-topic-exporter-jobs'
@@ -15,91 +16,15 @@
       - 'verify-licensed'
       - 'tag-collision-reject':
           dependency-jobs: 'verify_kafka-topic-exporter_licensed'
-      - 'verify-sonarqube':
-          dependency-jobs: 'verify_kafka-topic-exporter_tag-collision'
-      - 'kafka-topic-exporter-tests':
-          dependency-jobs: 'verify_kafka-topic-exporter_sonarqube'
+      - 'make-unit-test':
+          build-timeout: 30
+          unit-test-targets: 'test docker-build'
+          junit-allow-empty-results: true
 
-- job-template:
-    id: 'kafka-topic-exporter-tests'
-    name: 'verify_{project}_tests'
-
-    description: |
-      Created by {id} job-template from ci-management/jjb/verify/kafka-topic-exporter.yaml
-
-    triggers:
-      - cord-infra-gerrit-trigger-patchset:
-          gerrit-server-name: '{gerrit-server-name}'
-          project-regexp: '^{project}$'
-          branch-regexp: '{branch-regexp}'
-          dependency-jobs: '{dependency-jobs}'
-          file-include-regexp: '{all-files-regexp}'
-
-    properties:
-      - cord-infra-properties:
-          build-days-to-keep: '{build-days-to-keep}'
-          artifact-num-to-keep: '{artifact-num-to-keep}'
-
-    wrappers:
-      - lf-infra-wrappers:
-          build-timeout: 20
-          jenkins-ssh-credential: '{jenkins-ssh-credential}'
-
-    scm:
-      - cord-infra-gerrit-scm:
-          git-url: '$GIT_URL/$GERRIT_PROJECT'
-          refspec: '$GERRIT_REFSPEC'
-          branch: '$GERRIT_BRANCH'
-          submodule-recursive: 'false'
-          choosing-strategy: 'gerrit'
-          jenkins-ssh-credential: '{jenkins-ssh-credential}'
-          basedir: '{project}'
-
-    node: 'ubuntu16.04-basebuild-1c-2g'
-    project-type: freestyle
-    concurrent: true
-
-    builders:
-      - shell: |
-          #!/usr/bin/env bash
-          set -eux -o pipefail
-
-          export GOPATH=~/go
-          export PATH=$PATH:/usr/lib/go-1.12/bin:/usr/local/go/bin:~/go/bin
-
-          # move code the proper location
-          mkdir -p $GOPATH/src/gerrit.opencord.org
-          mv kafka-topic-exporter $GOPATH/src/gerrit.opencord.org/kafka-topic-exporter
-
-          pushd $GOPATH/src/gerrit.opencord.org/kafka-topic-exporter
-
-          # get prereqs
-          dep ensure --vendor-only
-
-          go test -v ./...
-
-          # generate Jenkins report
-          go test -v ./...  2>&1 | go-junit-report > $WORKSPACE/junit-report.xml
-
-          # generate Jenkins coverage
-          go test -coverprofile=coverage.txt -covermode=count ./...
-          gocover-cobertura < coverage.txt > $WORKSPACE/coverage.xml
-
-          popd
-
-
-    publishers:
-      - junit:
-          results: "junit-report.xml"
-          allow-empty-results: true
-      - cobertura:
-          report-file: "coverage.xml"
-          targets:
-            - files:
-                healthy: 80
-                unhealthy: 0
-                failing: 0
-            - method:
-                healthy: 50
-                unhealthy: 0
-                failing: 0
+- job-group:
+    name: 'publish-kafka-topic-exporter-jobs'
+    jobs:
+      - 'docker-publish':
+          build-timeout: 30
+          docker-repo: 'opencord'
+          dependency-jobs: 'version-tag'
diff --git a/jjb/verify/voltha-protos.yaml b/jjb/verify/voltha-protos.yaml
index a02f309..aefda8b 100644
--- a/jjb/verify/voltha-protos.yaml
+++ b/jjb/verify/voltha-protos.yaml
@@ -18,12 +18,11 @@
     jobs:
       - 'verify-licensed'
       - 'tag-collision-reject':
-          dependency-jobs: 'verify_voltha-protos_licensed'
-      #     - 'verify-sonarqube':
-      #         dependency-jobs: 'verify_voltha-protos_tag-collision'
-      - 'python-unit-test':
-          dependency-jobs: 'verify_voltha-protos_tag-collision'
-#         dependency-jobs: 'verify_voltha-protos_sonarqube'
+      - 'make-unit-test':
+          build-node: 'ubuntu16.04-basebuild-2c-4g'
+          build-timeout: 20
+          unit-test-targets: 'test'
+          unit-test-keep-going: 'true'
 
 - job-group:
     name: 'post-merge-voltha-protos-jobs'
diff --git a/jjb/voltha-e2e.yaml b/jjb/voltha-e2e.yaml
index 0b0034c..53bb807 100644
--- a/jjb/voltha-e2e.yaml
+++ b/jjb/voltha-e2e.yaml
@@ -241,7 +241,6 @@
                   Created from job-template {id} from ci-management/jjb/voltha-e2e.yaml <br />
                   Created by Andy Bavier, andy@opennetworking.org <br />
                   Copyright (c) 2019 Open Networking Foundation (ONF)
-    project-type: pipeline
     sandbox: true
     pipeline-script: 'voltha-physical-build-and-tests.groovy'
 
@@ -383,7 +382,6 @@
                   Created from job-template {id} from ci-management/jjb/voltha-e2e.yaml <br />
                   Created by Andy Bavier, andy@opennetworking.org <br />
                   Copyright (c) 2019 Open Networking Foundation (ONF)
-    project-type: pipeline
     sandbox: true
     pipeline-script: 'voltha-physical-build-and-tests.groovy'
 
@@ -526,7 +524,6 @@
                   Created from job-template {id} from ci-management/jjb/voltha-e2e.yaml <br />
                   Created by Andy Bavier, andy@opennetworking.org <br />
                   Copyright (c) 2019 Open Networking Foundation (ONF)
-    project-type: pipeline
     sandbox: true
     pipeline-script: 'voltha-physical-build-and-tests.groovy'